gecko-dev/tools/moztreedocs/docs/adding-documentation.rst
Ethan Glasser-Camp 7cd2a98da0 Bug 1606026: Move existing documentation into new locations r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D58338

--HG--
rename : tools/docs/docs/contribute/mozilla_source_code_directory_structure.rst => docs/contributing/directory_structure.rst
rename : tools/docs/docs/contribute/how_to_contribute_firefox.rst => docs/contributing/how_to_contribute_firefox.rst
rename : tools/docs/docs/adding-documentation.rst => tools/moztreedocs/docs/adding-documentation.rst
rename : tools/docs/docs/index.rst => tools/moztreedocs/docs/index.rst
rename : tools/docs/docs/mdn-import.rst => tools/moztreedocs/docs/mdn-import.rst
extra : moz-landing-system : lando
2020-01-06 16:38:34 +00:00

31 lines
1.4 KiB
ReStructuredText

Adding Documentation
--------------------
To add new documentation, define the ``SPHINX_TREES`` and
``SPHINX_PYTHON_PACKAGE_DIRS`` variables in ``moz.build`` files in
the tree and documentation will automatically get picked up.
Say you have a directory ``featureX`` you would like to write some
documentation for. Here are the steps to create Sphinx documentation
for it:
1. Create a directory for the docs. This is typically ``docs``. e.g.
``featureX/docs``.
2. Create an ``index.rst`` file in this directory. The ``index.rst`` file
is the root documentation for that section. See ``build/docs/index.rst``
for an example file.
3. In a ``moz.build`` file (typically the one in the parent directory of
the ``docs`` directory), define ``SPHINX_TREES`` to hook up the plumbing.
e.g. ``SPHINX_TREES['featureX'] = 'docs'``. This says *the ``docs``
directory under the current directory should be installed into the
Sphinx documentation tree under ``/featureX``*.
4. If you have Python packages you would like to generate Python API
documentation for, you can use ``SPHINX_PYTHON_PACKAGE_DIRS`` to
declare directories containing Python packages. e.g.
``SPHINX_PYTHON_PACKAGE_DIRS += ['mozpackage']``.
5. In ``docs/config.yml``, defines in which category the doc
should go.
6. Verify the rst syntax using `./mach lint -l rst`_
.. _./mach lint -l rst: /tools/lint/linters/rstlinter.html