|
1 | | -# example-sphinx-basic |
2 | | -A basic Sphinx project |
| 1 | +Example: Basic Sphinx project for Read the Docs |
| 2 | +=============================================== |
| 3 | + |
| 4 | +This example shows the following basic integration with Read the Docs: |
| 5 | + |
| 6 | +* A basic Sphinx project lives in ``docs/`` 📚 |
| 7 | +* Read the Docs Build configuration is stored in ``.readthedocs.yaml`` ⚙️ |
| 8 | +* Python dependencies are `pinned <https://docs.readthedocs.io/en/latest/guides/reproducible-builds.html>`_ 📍 |
| 9 | +* Auto-generated API docs for a Python module called ``lumache`` 💡 |
| 10 | +* Sphinx documentation integrates Python docstrings directly from ``lumache`` 💡 |
| 11 | +* A basic versioning mechanism with git tags 🔢 |
| 12 | +* Contents of this ``README.rst`` are visible on Github and included on `the documentation index page <https://example-sphinx-basic.readthedocs.io/en/latest/>`_ (Don't Repeat Yourself) 📜 |
| 13 | +* If you have questions related to this example, feel free to can ask them as a Github issue `here <https://github.com/readthedocs-examples/example-sphinx-basic/issues>`_. ⁉️ |
| 14 | + |
| 15 | + |
| 16 | +Sphinx Example Project usage |
| 17 | +---------------------------- |
| 18 | + |
| 19 | +This project has a very normal Sphinx layout which is built by the Read the Docs platform almost the same way that you would build it locally (on your own laptop!). |
| 20 | + |
| 21 | +You can build and view this documentation project locally - you may want to activate `a local Python virtual environment firstly <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment>`_: |
| 22 | + |
| 23 | +.. code-block:: console |
| 24 | +
|
| 25 | + # Install required Python dependencies (Sphinx etc.) |
| 26 | + pip install -r docs/requirements.txt |
| 27 | +
|
| 28 | + # Enter the Sphinx project |
| 29 | + cd docs/ |
| 30 | + make html |
| 31 | +
|
| 32 | +
|
| 33 | +You can also build the documentation locally with ``make``: |
| 34 | + |
| 35 | +.. code-block:: console |
| 36 | +
|
| 37 | + # Enter the Sphinx project |
| 38 | + cd docs/ |
| 39 | + |
| 40 | + # Build with make |
| 41 | + make html |
| 42 | + |
| 43 | + # Open with your preferred browser |
| 44 | + firefox _build/html/index.html |
| 45 | +
|
| 46 | +
|
| 47 | +Using the example in your own project |
| 48 | +------------------------------------- |
| 49 | + |
| 50 | +If you are new to Read the Docs, you may want to refer to the `Read the Docs User documentation <https://docs.readthedocs.io/>`_. |
| 51 | + |
| 52 | +If you are copying this code in order to get started with your documentation, you need to: |
| 53 | + |
| 54 | +* Create a new repository on Github, GitLab, Bitbucket or another host supported by Read the Docs |
| 55 | +* Customize all ``docs/*.rst`` files |
| 56 | +* Add your own Python project, replacing the ``pyproject.toml`` configuration and ``lumache.py`` module. |
| 57 | +* Rebuild the documenation locally to see that it works. |
| 58 | +* Register your project on Read the Docs, see `Importing Your Documentation <https://docs.readthedocs.io/en/stable/intro/import-guide.html>`_. |
| 59 | + |
| 60 | + |
| 61 | +Read the Docs tutorial |
| 62 | +---------------------- |
| 63 | + |
| 64 | +To get started with Read the Docs, you may also refer to the `Read the Docs tutorial <https://docs.readthedocs.io/en/stable/tutorial/>`_ |
0 commit comments