aboutsummaryrefslogtreecommitdiffstats
path: root/docs/gettingstarted/writingdocs/buildingrst.rst
blob: 474257d35d02533ef5f03feb46c1165c6f84f0f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.. _buildingrst:

**************************
Creating VPP Documents
**************************

These instructions show how the VPP documentation sources are built.

The VPP Documents are written using `reStructuredText <http://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_ (rst),
or markdown (md). These files are then built using the Sphinx build system `Sphinx <http://www.sphinx-doc.org/en/master/>`_.

Get the VPP sources
=====================

Start with a clone of the vpp repository.

.. code-block:: console

   $ git clone https://gerrit.fd.io/r/vpp
   $ cd vpp


Install the Necessary Packages
===============================

Before building the docs there are some packages that are needed. To install
these packages on ubuntu execute the following.

.. code-block:: console

   $ sudo apt-get install python3-all python3-setuptools python3-pip

 
Create a Virtual Environment using virtualenv
===============================================
 
For more information on how to use the Python virtual environment check out
`Installing packages using pip and virtualenv`_.

.. _`Installing packages using pip and virtualenv`: https://packaging.python.org/guides/installing-using-pip-and-virtualenv/

In the vpp root directory on your system, run: 

.. code-block:: console

   $ make docs-venv

Which installs all the required applications into it's own, isolated, virtual environment, so as to not
interfere with other builds that may use different versions of software.

Build the html files
======================

Build the html **index.html** file: 

.. code-block:: console

   $ make docs

Clean the environment
======================

Delete all the generated files with the following:

.. code-block:: console

   $ make docs-clean

View the results
=================

| If there are no errors during the build process, you should now have an **index.html** file in your
| **vpp/docs/_build/html** directory, which you can then view in your browser.

.. figure:: /_images/htmlBuild.png
   :alt: Figure: My directory containing the index.html file
   :scale: 35%
   :align: center

Whenever you make changes to your **.rst** files that you want to see, repeat this build process.

.. note::

   To exit from the virtual environment execute:

.. code-block:: console

   $ deactivate

Getting your documents reviewed and merged
==========================================

VPP documents are reviewed and merged like and other source code. Refer to :ref:`gitreview`
to get your changes reviewed and merged.