X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=docs%2Fhow-to-use-docs%2Finclude-documentation.rst;h=1430b946de7e5a3e871232c2f1a1bb21d2e281b5;hb=28d11becf99d8ea879c118a0126846b5accb25ab;hp=f1f299e63583bb20379d6ae03c0fb96d1d21b8d8;hpb=04221a673fb2774d237c1732dca8a19ce119f205;p=opnfvdocs.git diff --git a/docs/how-to-use-docs/include-documentation.rst b/docs/how-to-use-docs/include-documentation.rst index f1f299e63..1430b946d 100644 --- a/docs/how-to-use-docs/include-documentation.rst +++ b/docs/how-to-use-docs/include-documentation.rst @@ -1,14 +1,14 @@ - -============================================= +.. _include-documentation: +============================ Including your Documentation -============================================= +============================ .. contents:: :depth: 3 :local: In your project repository ----------------------------- +-------------------------- Add your documentation to your repository in the folder structure and according to the templates listed above. The documentation templates you @@ -34,7 +34,7 @@ the documentation to the project repository. git review In OPNFVDocs Composite Documentation --------------------------------------- +------------------------------------ In toctree +++++++++++ @@ -70,7 +70,7 @@ it, example: As Hyperlink -+++++++++++++ +++++++++++++ It's pretty common to want to reference another location in the OPNFV documentation and it's pretty easy to do with @@ -125,3 +125,104 @@ the opnfvdocs team for review and integration. Be sure to add the project leader of the opnfvdocs project as a reviewer of the change you just pushed in gerrit. + +'doc8' Validation +----------------- +It is recommended that all rst content is validated by `doc8 `_ standards. +To validate your rst files using doc8, install doc8. + +.. code-block:: bash + + sudo pip install doc8 + +doc8 can now be used to check the rst files. Execute as, + +.. code-block:: bash + + doc8 --ignore D000,D001 + + +Testing: Build Documentation Locally +------------------------------------ + +Composite OPNFVDOCS documentation ++++++++++++++++++++++++++++++++++ +To build whole documentation under opnfvdocs/, follow these steps: + +Install virtual environment. + +.. code-block:: bash + + sudo pip install virtualenv + cd /local/repo/path/to/project + +Download the OPNFVDOCS repository. + +.. code-block:: bash + + git clone https://gerrit.opnfv.org/gerrit/opnfvdocs + +Change directory to opnfvdocs & install requirements. + +.. code-block:: bash + + cd opnfvdocs + sudo pip install -r etc/requirements.txt + +Update submodules, build documentation using tox & then open using any browser. + +.. code-block:: bash + + cd opnfvdocs + git submodule update --init + tox -edocs + firefox docs/_build/html/index.html + +.. note:: Make sure to run `tox -edocs` and not just `tox`. + +Individual project documentation +++++++++++++++++++++++++++++++++ +To test how the documentation renders in HTML, follow these steps: + +Install virtual environment. + +.. code-block:: bash + + sudo pip install virtualenv + cd /local/repo/path/to/project + +Download the opnfvdocs repository. + +.. code-block:: bash + + git clone https://gerrit.opnfv.org/gerrit/opnfvdocs + +Change directory to opnfvdocs & install requirements. + +.. code-block:: bash + + cd opnfvdocs + sudo pip install -r etc/requirements.txt + +Move the conf.py file to your project folder where RST files have been kept: + +.. code-block:: bash + + mv opnfvdocs/docs/conf.py / + +Move the static files to your project folder: + +.. code-block:: bash + + mv opnfvdocs/_static/ / + +Build the documentation from within your project folder: + +.. code-block:: bash + + sphinx-build -b html + +Your documentation shall be built as HTML inside the +specified output folder directory. + +.. note:: Be sure to remove the `conf.py`, the static/ files and the output folder from the `/docs/`. This is for testing only. Only commit the rst files and related content.