blob: 474257d35d02533ef5f03feb46c1165c6f84f0f9 [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
jdenisco65e410b2019-05-28 13:58:33 +000023Install the Necessary Packages
24===============================
25
26Before building the docs there are some packages that are needed. To install
27these packages on ubuntu execute the following.
28
29.. code-block:: console
30
31 $ sudo apt-get install python3-all python3-setuptools python3-pip
32
33
John DeNisco758dc462018-08-13 17:00:06 -040034Create a Virtual Environment using virtualenv
35===============================================
John DeNisco06dcd452018-07-26 12:45:10 -040036
John DeNisco758dc462018-08-13 17:00:06 -040037For more information on how to use the Python virtual environment check out
38`Installing packages using pip and virtualenv`_.
39
40.. _`Installing packages using pip and virtualenv`: https://packaging.python.org/guides/installing-using-pip-and-virtualenv/
41
javierfernandezvalles7d84c162018-08-09 08:54:55 -070042In the vpp root directory on your system, run:
John DeNisco06dcd452018-07-26 12:45:10 -040043
44.. code-block:: console
45
jdenisco3138d722018-09-24 14:59:33 -040046 $ make docs-venv
John DeNisco06dcd452018-07-26 12:45:10 -040047
48Which installs all the required applications into it's own, isolated, virtual environment, so as to not
49interfere with other builds that may use different versions of software.
50
51Build the html files
John DeNisco758dc462018-08-13 17:00:06 -040052======================
John DeNisco06dcd452018-07-26 12:45:10 -040053
jdenisco3138d722018-09-24 14:59:33 -040054Build the html **index.html** file:
John DeNisco06dcd452018-07-26 12:45:10 -040055
56.. code-block:: console
57
jdenisco3138d722018-09-24 14:59:33 -040058 $ make docs
59
60Clean the environment
61======================
62
63Delete all the generated files with the following:
64
65.. code-block:: console
66
67 $ make docs-clean
John DeNisco06dcd452018-07-26 12:45:10 -040068
69View the results
John DeNisco758dc462018-08-13 17:00:06 -040070=================
John DeNisco06dcd452018-07-26 12:45:10 -040071
72| If there are no errors during the build process, you should now have an **index.html** file in your
73| **vpp/docs/_build/html** directory, which you can then view in your browser.
74
75.. figure:: /_images/htmlBuild.png
76 :alt: Figure: My directory containing the index.html file
77 :scale: 35%
78 :align: center
79
80Whenever you make changes to your **.rst** files that you want to see, repeat this build process.
81
82.. note::
83
84 To exit from the virtual environment execute:
85
86.. code-block:: console
87
88 $ deactivate
89
John DeNisco758dc462018-08-13 17:00:06 -040090Getting your documents reviewed and merged
91==========================================
John DeNisco06dcd452018-07-26 12:45:10 -040092
John DeNisco758dc462018-08-13 17:00:06 -040093VPP documents are reviewed and merged like and other source code. Refer to :ref:`gitreview`
94to get your changes reviewed and merged.