blob: 5134bb395ee47cb34c3564f18c23ddae7329d253 [file] [log] [blame]
John DeNisco06dcd452018-07-26 12:45:10 -04001.. _buildingrst:
2
John DeNisco758dc462018-08-13 17:00:06 -04003**************************
4Creating VPP Documents
5**************************
John DeNisco06dcd452018-07-26 12:45:10 -04006
7These instructions show how the VPP documentation sources are built.
8
John DeNisco758dc462018-08-13 17:00:06 -04009The VPP Documents are written using `reStructuredText <http://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_ (rst),
10or markdown (md). These files are then built using the Sphinx build system `Sphinx <http://www.sphinx-doc.org/en/master/>`_.
John DeNisco06dcd452018-07-26 12:45:10 -040011
John DeNisco758dc462018-08-13 17:00:06 -040012Get the VPP sources
13=====================
John DeNisco06dcd452018-07-26 12:45:10 -040014
John DeNisco758dc462018-08-13 17:00:06 -040015Start with a clone of the vpp repository.
John DeNisco06dcd452018-07-26 12:45:10 -040016
17.. code-block:: console
18
19 $ git clone https://gerrit.fd.io/r/vpp
20 $ cd vpp
21
22
John DeNisco758dc462018-08-13 17:00:06 -040023Create a Virtual Environment using virtualenv
24===============================================
John DeNisco06dcd452018-07-26 12:45:10 -040025
John DeNisco758dc462018-08-13 17:00:06 -040026For more information on how to use the Python virtual environment check out
27`Installing packages using pip and virtualenv`_.
28
29.. _`Installing packages using pip and virtualenv`: https://packaging.python.org/guides/installing-using-pip-and-virtualenv/
30
javierfernandezvalles7d84c162018-08-09 08:54:55 -070031In the vpp root directory on your system, run:
John DeNisco06dcd452018-07-26 12:45:10 -040032
33.. code-block:: console
34
35 $ python -m pip install --user virtualenv
36 $ python -m virtualenv env
37 $ source env/bin/activate
38 $ pip install -r docs/etc/requirements.txt
39 $ cd docs
40
41Which installs all the required applications into it's own, isolated, virtual environment, so as to not
42interfere with other builds that may use different versions of software.
43
44Build the html files
John DeNisco758dc462018-08-13 17:00:06 -040045======================
John DeNisco06dcd452018-07-26 12:45:10 -040046
47Be sure you are in your vpp-docs/docs directory, since that is where Sphinx will look for your **conf.py**
48file, and build the **.rst** files into an **index.html** file:
49
50.. code-block:: console
51
52 $ make html
53
54View the results
John DeNisco758dc462018-08-13 17:00:06 -040055=================
John DeNisco06dcd452018-07-26 12:45:10 -040056
57| If there are no errors during the build process, you should now have an **index.html** file in your
58| **vpp/docs/_build/html** directory, which you can then view in your browser.
59
60.. figure:: /_images/htmlBuild.png
61 :alt: Figure: My directory containing the index.html file
62 :scale: 35%
63 :align: center
64
65Whenever you make changes to your **.rst** files that you want to see, repeat this build process.
66
67.. note::
68
69 To exit from the virtual environment execute:
70
71.. code-block:: console
72
73 $ deactivate
74
John DeNisco758dc462018-08-13 17:00:06 -040075Getting your documents reviewed and merged
76==========================================
John DeNisco06dcd452018-07-26 12:45:10 -040077
John DeNisco758dc462018-08-13 17:00:06 -040078VPP documents are reviewed and merged like and other source code. Refer to :ref:`gitreview`
79to get your changes reviewed and merged.