Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 503d833

Browse files
authored
Merge pull request #40 from tthelin/daux-instructions
Add instructions on how to use daux to render the tutorial
2 parents 840ee6b + e8312f9 commit 503d833

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,90 @@ using the `incremental_patch.sh` script. Run it like this:
3131
* Clean up the `base_code_fixed.cpp` and `patch.txt` files.
3232
* Commit.
3333

34+
Rendering the tutorial
35+
-----------------------------
36+
37+
To render the tutorial (i.e. convert the markdown to html), you have two options:
38+
39+
1. Serve rendered files on the fly using a web server that has php installed
40+
2. Generate static html files that you can view locally or put on a server
41+
42+
For either of these options, you'll need php and a patch'ed daux.
43+
44+
### PHP
45+
46+
1. Make sure [PHP](http://php.net/downloads.php) is installed (Daux is written
47+
in PHP)
48+
1. Both the `php_mbstring` and `php_openssl` extensions need to be enabled
49+
2. The `phar.readonly` setting needs to be set to `Off` (to be able to
50+
rebuild Daux)
51+
2. Make sure [Composer](https://getcomposer.org/) is installed, a php dependency
52+
manager that Daux uses
53+
54+
### Clone, patch, and rebuild daux
55+
56+
1. Clone [daux](https://github.com/justinwalsh/daux.io)
57+
* `git clone https://github.com/justinwalsh/daux.io.git`
58+
2. Make a new branch at the older revision that the VulkanTutorial patch is
59+
against:
60+
* `git checkout d45ccff -b vtpatch`
61+
* Making a new branch isn't strictly necessary, as you could reset `master`,
62+
but this keeps master intact.
63+
3. Copy over the `daux.patch` file into the daux.io directory, make sure line
64+
endings are UNIX style (in case you're using Windows), and apply the patch.
65+
It should apply cleanly.
66+
* `git am daux.patch`
67+
4. Run composer in the daux.io directory so that it downloads the dependencies
68+
Daux needs in order to be built
69+
* `composer install`
70+
5. Rebuild Daux
71+
* `php bin/compile` (this can take a while)
72+
* A newly made `daux.phar` will now be in your base directory
73+
74+
### Using Daux to serve rendered files on the fly
75+
76+
Once you've completed the above, follow the instructions on the daux site
77+
for how to [run daux using a web server](https://github.com/justinwalsh/daux.io/blob/master/README.md#running-remotely).
78+
79+
As a simple option considering you have php installed, you can also use php's
80+
built in development web server if you just need to locally see what things
81+
look like:
82+
83+
1. In the `daux.io` directory, edit `global.json` so that the `docs_directory`
84+
option points at your VulkanTutorial directory
85+
* `"docs_directory": "../VulkanTutorial",`
86+
2. In the `daux.io` directory, run
87+
* ` php -S localhost:8080 index.php`
88+
3. Type `localhost:8080` in your web browser URL bar and hit enter. You should
89+
now see the VulkanTutorial front page.
90+
91+
### Using Daux to statically generate html files
92+
93+
Before we generate the static files, we need to tweak daux and the tutorial
94+
setup to prevent it from trying to load a few outside resources (which will
95+
stall your browser when trying to load the otherwise static page)
96+
97+
1. In the `VulkanTutorial` directory, edit `config.json` and remove the
98+
`google_analytics` line so daux doesn't try to load that.
99+
2. In the `daux.io` directory, edit `themes/daux/config.json` and remove the
100+
`font` line so that daux doesn't try to load an external font.
101+
3. Rebuild daux according to the earlier instructions so it picks up the theme
102+
changes.
103+
104+
We're working on improvements so in the future the above steps won't be
105+
necessary.
106+
107+
Now with the above done, we can generate the static files. Asuming the daux.io
108+
and VulkanTutorial directories are next to each other, go into the `daux.io`
109+
directory and run a command similar to:
110+
`php generate -s ../VulkanTutorial -d ../VulkanTutorial\out`.
111+
112+
`-s` tells it where to find the documentation, while `-d` tells it where to put
113+
the generated files.
114+
115+
Note: if you want to generate the docs again, delete the `out` directory first
116+
or daux will make a new `out` directory within the existing `out` directory.
117+
34118
License
35119
-------
36120

0 commit comments

Comments
 (0)