|
1 |
| -.. _creating-documentation: |
| 1 | +:orphan: |
2 | 2 |
|
| 3 | +Creating documentation |
3 | 4 | ======================
|
4 |
| -Creating Documentation |
5 |
| -====================== |
6 |
| - |
7 |
| -This section covers the basics of how to create documentation using `Sphinx`_ and |
8 |
| -host the documentation for free in `Read The Docs`_. |
9 |
| - |
10 |
| -.. _Sphinx: https://www.sphinx-doc.org |
11 |
| -.. _Read The Docs: https://readthedocs.org/ |
12 |
| - |
13 |
| -Installing Sphinx |
14 |
| ------------------ |
15 |
| -Use ``pip`` to install Sphinx: |
16 |
| - |
17 |
| -.. tab:: Unix/macOS |
18 |
| - |
19 |
| - .. code-block:: bash |
20 |
| -
|
21 |
| - python3 -m pip install --upgrade sphinx |
22 |
| -
|
23 |
| -.. tab:: Windows |
24 |
| - |
25 |
| - .. code-block:: bat |
26 |
| -
|
27 |
| - py -m pip install --upgrade sphinx |
28 |
| -
|
29 |
| -For other installation methods, see this :doc:`installation guide <sphinx:usage/installation>` by Sphinx. |
30 |
| - |
31 |
| - |
32 |
| -Getting Started With Sphinx |
33 |
| ---------------------------- |
34 |
| - |
35 |
| -Create a ``docs`` directory inside your project to hold your documentation: |
36 |
| - |
37 |
| -.. code-block:: bash |
38 |
| -
|
39 |
| - cd /path/to/project |
40 |
| - mkdir docs |
41 |
| -
|
42 |
| -Run ``sphinx-quickstart`` inside the ``docs`` directory: |
43 |
| - |
44 |
| -.. code-block:: bash |
45 |
| -
|
46 |
| - cd docs |
47 |
| - sphinx-quickstart |
48 |
| -
|
49 |
| -This sets up a source directory, walks you through some basic configurations, and creates an ``index.rst`` file as well as a ``conf.py`` file. |
50 |
| - |
51 |
| -You can add some information about your project in ``index.rst``, then build them: |
52 |
| - |
53 |
| -.. code-block:: bash |
54 |
| -
|
55 |
| - make html |
56 |
| -
|
57 |
| -For more details on the build process, see this `guide`_ by Read The Docs. |
58 |
| - |
59 |
| -.. _guide: https://docs.readthedocs.io/en/latest/intro/import-guide.html |
60 |
| - |
61 |
| -Other Sources |
62 |
| -------------- |
63 |
| - |
64 |
| -For a more detailed guide on how to use Sphinx and reStructuredText, please see this `documentation tutorial`_ on Hitchhiker's Guide to Python. |
65 | 5 |
|
66 |
| -.. _documentation tutorial: https://docs.python-guide.org/writing/documentation/ |
| 6 | +This tutorial has been removed since it is not related to packaging and was unmaintained. |
| 7 | +Please see the `Sphinx tutorial <https://www.sphinx-doc.org/en/master/tutorial>`_ instead. |
0 commit comments