Skip to content

Commit 46708a6

Browse files
elainechantheacodes
authored andcommitted
Add guide for creating documentation (#568)
* Adds page with tutorial on creating documentation using Sphinx and Read The Docs. * Fixes syntax for fixed-width items. * Changes code blocks to bash style. * Adds link to Hitchhikers Guide to Python.
1 parent 79c2b55 commit 46708a6

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. _creating-documentation:
2+
3+
======================
4+
Creating Documentation
5+
======================
6+
7+
This section covers the basics of how to create documentation using `Sphinx`_ and host the documentation for free in `Read The Docs`_.
8+
9+
.. _Sphinx: http://sphinx-doc.org/
10+
.. _Read The Docs: https://readthedocs.org/
11+
12+
Installing Sphinx
13+
-----------------
14+
Use ``pip`` to install Sphinx:
15+
16+
.. code-block:: bash
17+
18+
pip install -U sphinx
19+
20+
For other installation methods, see this `installation guide`_ by Sphinx.
21+
22+
.. _installation guide: http://www.sphinx-doc.org/en/master/usage/installation.html
23+
24+
Getting Started With Sphinx
25+
---------------------------
26+
27+
Create a ``doc`` directory inside your project to hold your documentation:
28+
29+
.. code-block:: bash
30+
31+
cd /path/to/project
32+
mkdir docs
33+
34+
Run ``spinx-quickstart`` inside the ``docs`` directory:
35+
36+
.. code-block:: bash
37+
38+
cd docs
39+
sphinx-quickstart
40+
41+
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.
42+
43+
You can add some information about your project in ``index.rst``, then build them:
44+
45+
.. code-block:: bash
46+
47+
make html
48+
49+
For more details on the build process, see this `guide`_ by Read The Docs.
50+
51+
.. _guide: https://docs.readthedocs.io/en/latest/intro/import-guide.html
52+
53+
Other Sources
54+
-------------
55+
56+
For a more detailed guide on how to use Sphinx and reStructuredText, please see this `documentation tutorial`_ on Hitchhiker's Guide to Python.
57+
58+
.. _documentation tutorial: https://docs.python-guide.org/writing/documentation/
59+
60+
61+
62+

‎source/tutorials/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ topics, see :doc:`/guides/index`.
1111
installing-packages
1212
managing-dependencies
1313
packaging-projects
14+
creating-documentation

0 commit comments

Comments
 (0)