| OLD | NEW |
| 1 nacl-docs-rst | 1 nacl-docs-rst |
| 2 ============= | 2 ============= |
| 3 | 3 |
| 4 Directory structure | 4 Directory structure |
| 5 ------------------- | 5 ------------------- |
| 6 | 6 |
| 7 This is a tree of .rst files that represent the source of the NaCl | 7 This is a tree of .rst files that represent the source of the NaCl |
| 8 documentation. Some of the files and directories here are special: | 8 documentation. Some of the files and directories here are special: |
| 9 | 9 |
| 10 * conf.py: Sphinx configuration file | 10 * conf.py: Sphinx configuration file |
| 11 * images/: Images are stored here. Note that this isn't necessary - Sphinx | 11 * images/: Images are stored here. Note that this isn't necessary - Sphinx |
| 12 doesn't mind about interspersing images in .rst directories. | 12 doesn't mind about interspersing images in .rst directories. |
| 13 * _sphinxext/: Code of the Sphinx extension we use to generate HTML from .rst | 13 * _sphinxext/: Code of the Sphinx extension we use to generate HTML from .rst |
| 14 * _static/: Static files, like CSS, for the documentation. This should be seen | 14 * _static/: Static files, like CSS, for the documentation. This should be seen |
| 15 as part of the infrastructure - the real CSS comes from the real doc | 15 as part of the infrastructure - the real CSS comes from the real doc |
| 16 publishing server. | 16 publishing server. |
| 17 * _build/: Build artifacts (not checked into source control). | 17 * _build/: Build artifacts (not checked into source control). |
| 18 * Makefile & README | 18 * Makefile & README |
| 19 | 19 |
| 20 How to build | 20 How to build |
| 21 ------------ | 21 ------------ |
| 22 | 22 |
| 23 To build the docs you will needs sphinx installed (and sphinx-build in your | 23 To build the docs you will needs sphinx installed (and sphinx-build in your |
| 24 path), and simply run: | 24 path). On debian/ubuntu this command is part of the ``python-sphinx`` package. |
| 25 | 25 |
| 26 make | 26 There are many different output formats that can be generated using the targets |
| 27 in the included Makefile. The three most commonly used ones are ``devsite``, |
| 28 ``devsite-prod`` and ``devsite-staging``. |
| 27 | 29 |
| 28 To rebuild all the pages always, add 'SPHINXOPTS=-a', e.g.: | 30 The ``devsite`` configuration is for generating docs for local viewing and is |
| 31 also the default make target. To build this config simply run:: |
| 29 | 32 |
| 30 make SPHINXOPTS=-a | 33 make |
| 31 | 34 |
| 32 To emit local-testing mode, instead of production mode, add: | 35 To rebuild all the pages always, add ``SPHINXOPTS=-a``, e.g.:: |
| 33 SPHINXOPTS='-D devsite_production_mode=0' | |
| 34 e.g.: | |
| 35 | 36 |
| 36 make SPHINXOPTS='-D devsite_production_mode=0' | 37 make SPHINXOPTS=-a |
| 38 |
| 39 To emit docs suitable for pushing to production use:: |
| 40 |
| 41 make devsite-prod |
| 37 | 42 |
| 38 Production mode contains devsite-specific templating and non-HTML constructs. | 43 Production mode contains devsite-specific templating and non-HTML constructs. |
| 39 | 44 The ``devsite-staging`` target is exactly the same except that the html pages |
| 40 The builder prints out the value of this setting - make sure it's what you | 45 are all rooted under a folder called $USER, which allows each user to stage his |
| 41 expect it to be. For example: | 46 own copy of the docs. |
| 42 | |
| 43 $ make | |
| 44 sphinx-build -b devsite -d _build/doctrees . _build/devsite | |
| 45 Running Sphinx v1.2b1 | |
| 46 loading pickled environment... done | |
| 47 ----> Devsite builder with production mode = 1 | |
| 48 | 47 |
| 49 Local HTTP server to view the docs | 48 Local HTTP server to view the docs |
| 50 ---------------------------------- | 49 ---------------------------------- |
| 51 | 50 |
| 52 To view the HTML locally, build the docs with production mode turned off, and | 51 To view the HTML locally, build the docs with production mode turned off, and |
| 53 run: | 52 run:: |
| 54 | 53 |
| 55 make serve | 54 make serve |
| 56 | 55 |
| 57 This will start a webserver on the local machine, and allows the pages | 56 This will start a webserver on the local machine, and allows the pages |
| 58 to be viewed by in a browser by navigating to: | 57 to be viewed by in a browser by navigating to:: |
| 59 | 58 |
| 60 http://localhost:8009/ | 59 http://localhost:8009/ |
| 61 | 60 |
| 62 Serving through a server and not just file:/// because this way the <link> | 61 Serving through a server and not just file:/// because this way the <link> |
| 63 relative paths to CSS actually work. | 62 relative paths to CSS actually work. |
| 64 | |
| OLD | NEW |