| 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 * doxygen/: Contains scripts for building doxygen docs. | 
| 18 * Makefile & README | 18 * Makefile & README | 
| 19 | 19 | 
|  | 20 All output is written to native_client_sdk/doc_generated/... | 
|  | 21 | 
| 20 How to build | 22 How to build | 
| 21 ------------ | 23 ------------ | 
| 22 | 24 | 
| 23 To build the docs you will needs sphinx installed (and sphinx-build in your | 25 To build the docs you will needs sphinx installed (and sphinx-build in your | 
| 24 path). On debian/ubuntu this command is part of the ``python-sphinx`` package. | 26 path). On debian/ubuntu this command is part of the ``python-sphinx`` package. | 
| 25 | 27 | 
| 26 There are many different output formats that can be generated using the targets | 28 There are two primary make targets: ``chromesite`` and ``chromesite_rst``. The | 
| 27 in the included Makefile.  The three most commonly used ones are ``devsite``, | 29 ``chromesite`` target will build all documentation, including the doxygen docs. | 
| 28 ``devsite-prod`` and ``devsite-staging``. | 30 This usually takes about a minute. To build this config, run:: | 
| 29 |  | 
| 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:: |  | 
| 32 | 31 | 
| 33   make | 32   make | 
| 34 | 33 | 
| 35 To rebuild all the pages always, add ``SPHINXOPTS=-a``, e.g.:: | 34 The ``chromesite_rst`` target will only build the ReST docs. This is usually | 
|  | 35 much faster. The default target is ``chromesite``. To build this config, run:: | 
| 36 | 36 | 
| 37   make SPHINXOPTS=-a | 37   make chromesite_rst | 
| 38 |  | 
| 39 To emit docs suitable for pushing to production use:: |  | 
| 40 |  | 
| 41   make devsite-prod |  | 
| 42 |  | 
| 43 Note that "production use" (and the staging target) are closely tied to the |  | 
| 44 Google documentation infrastructure, so it will be of very limited use outside |  | 
| 45 Google. Links to related documents here can be google.com specific. Production |  | 
| 46 mode contains devsite-specific templating and non-HTML constructs. The |  | 
| 47 ``devsite-staging`` target is exactly the same except that the html pages are |  | 
| 48 all rooted under a folder called $USER, which allows each user to stage his own |  | 
| 49 copy of the docs. |  | 
| 50 |  | 
| 51 When building in production mode you can specify the name of the subfolder in |  | 
| 52 which the docs are rooted by specifying ``SPHINXOPTS=-Ddevsite_foldername=``. |  | 
| 53 For example:: |  | 
| 54 |  | 
| 55   make devsite-prod SPHINXOPTS=-Ddevsite_foldername=pepper_32 |  | 
| 56 |  | 
| 57 See https://sites.google.com/a/google.com/nativeclient/documents/how-to-update-d
    eveloper-documentation#TOC-Staging-ReStructuredText-output-on-devsite |  | 
| 58 for more information on staging. |  | 
| 59 | 38 | 
| 60 Local HTTP server to view the docs | 39 Local HTTP server to view the docs | 
| 61 ---------------------------------- | 40 ---------------------------------- | 
| 62 | 41 | 
| 63 To view the HTML locally, build the docs with production mode turned off, and | 42 To view the HTML locally, build the docs with production mode turned off, and | 
| 64 run:: | 43 run:: | 
| 65 | 44 | 
| 66   make serve | 45   make serve | 
| 67 | 46 | 
| 68 This will start a webserver on the local machine, and allows the pages | 47 This will start a webserver on the local machine, and allows the pages | 
| 69 to be viewed by in a browser by navigating to:: | 48 to be viewed by in a browser by navigating to:: | 
| 70 | 49 | 
| 71   http://localhost:8009/ | 50   http://localhost:8000/native-client | 
| 72 | 51 | 
| 73 Serving through a server and not just file:/// because this way the <link> | 52 Serving through a server and not just file:/// because this way the <link> | 
| 74 relative paths to CSS actually work. | 53 relative paths to CSS actually work. | 
| 75 | 54 | 
| 76 Checking outgoing links for integrity | 55 Checking outgoing links for integrity | 
| 77 ------------------------------------- | 56 ------------------------------------- | 
| 78 | 57 | 
| 79 We use the Sphinx-provided link checker (configured in conf.py and with some | 58 We use the Sphinx-provided link checker (configured in conf.py and with some | 
| 80 monkey-patching in the extension) to check the outgoing links from the | 59 monkey-patching in the extension) to check the outgoing links from the | 
| 81 documentation. To run the link checker:: | 60 documentation. To run the link checker:: | 
| 82 | 61 | 
| 83   make linkcheck | 62   make linkcheck | 
| 84 | 63 | 
| 85 And look for "broken" in the output file. | 64 And look for "broken" in the output file. | 
| OLD | NEW | 
|---|