Skip to content

Commit 0b8855f

Browse files
committed
documentation is being auto generated
2 parents ca13d24 + 729c347 commit 0b8855f

13 files changed

+486
-26
lines changed

.gitignore

+139-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,155 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# auto-generated Sphinx api docs
10+
/docs/generated
11+
12+
# Distribution / packaging
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
pip-wheel-metadata/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
local_settings.py
64+
db.sqlite3
65+
db.sqlite3-journal
66+
67+
# Flask stuff:
68+
instance/
69+
.webassets-cache
70+
71+
# Scrapy stuff:
72+
.scrapy
73+
74+
# Sphinx documentation
75+
docs/_build/
76+
77+
# PyBuilder
78+
target/
79+
80+
# Jupyter Notebook
181
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
101+
celerybeat-schedule
102+
celerybeat.pid
103+
104+
# SageMath parsed files
105+
*.sage.py
106+
107+
# Environments
108+
.env
109+
.venv
110+
env/
111+
venv/
112+
ENV/
113+
env.bak/
114+
venv.bak/
115+
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# pycharm
122+
.idea
123+
124+
# Rope project settings
125+
.ropeproject
126+
127+
# mkdocs documentation
128+
/site
129+
130+
# mypy
131+
.mypy_cache/
132+
.dmypy.json
133+
dmypy.json
134+
135+
# Pyre type checker
136+
.pyre/
137+
138+
# access-vis specific
2139
outputs
3140
wip_notebooks
4141
notes
5-
build
6-
__pycache__
7142
vid_old
8143
src/accessvis.egg-info
144+
src/accessvis/data
9145

10146
venv/
11147
ENV/
12148
.venv/
13149
.env
14150
.idea
15151

152+
*.png
16153
*.jpg
17154
*.jpeg
18155
*.mp4

.readthedocs.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ sphinx:
2727
# Optional but recommended, declare the Python requirements required
2828
# to build your documentation
2929
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
30-
# python:
31-
# install:
32-
# - requirements: docs/requirements.txt
30+
31+
python:
32+
install:
33+
- requirements: docs/requirements.txt
34+
- method: pip
35+
path: .

README.rst

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Example: Basic Sphinx project for Read the Docs
2+
===============================================
3+
4+
.. image:: https://readthedocs.org/projects/example-sphinx-basic/badge/?version=latest
5+
:target: https://example-sphinx-basic.readthedocs.io/en/latest/?badge=latest
6+
:alt: Documentation Status
7+
8+
.. This README.rst should work on Github and is also included in the Sphinx documentation project in docs/ - therefore, README.rst uses absolute links for most things so it renders properly on GitHub
9+
10+
This example shows a basic Sphinx project with Read the Docs. You're encouraged to view it to get inspiration and copy & paste from the files in the source code. If you are using Read the Docs for the first time, have a look at the official `Read the Docs Tutorial <https://docs.readthedocs.io/en/stable/tutorial/index.html>`__.
11+
12+
📚 `docs/ <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/docs/>`_
13+
A basic Sphinx project lives in ``docs/``. All the ``*.rst`` make up sections in the documentation.
14+
⚙️ `.readthedocs.yaml <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/.readthedocs.yaml>`_
15+
Read the Docs Build configuration is stored in ``.readthedocs.yaml``.
16+
⚙️ `docs/conf.py <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/docs/conf.py>`_
17+
Both the configuration and the folder layout follow Sphinx default conventions. You can change the `Sphinx configuration values <https://www.sphinx-doc.org/en/master/usage/configuration.html>`_ in this file
18+
📍 `docs/requirements.txt <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/docs/requirements.txt>`_ and `docs/requirements.in <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/docs/requirements.in>`_
19+
Python dependencies are `pinned <https://docs.readthedocs.io/en/latest/guides/reproducible-builds.html>`_ (uses `pip-tools <https://pip-tools.readthedocs.io/en/latest/>`_). Make sure to add your Python dependencies to ``requirements.txt`` or if you choose `pip-tools <https://pip-tools.readthedocs.io/en/latest/>`_, edit ``docs/requirements.in`` and remember to run ``pip-compile docs/requirements.in``.
20+
💡 `docs/api.rst <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/docs/api.rst>`_
21+
By adding our example Python module ``lumache`` in the reStructuredText directive ``:autosummary:``, Sphinx will automatically scan this module and generate API docs.
22+
💡 `docs/usage.rst <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/docs/usage.rst>`_
23+
Sphinx can automatically extract API documentation directly from Python modules, using for instance the ``:autofunction:`` directive.
24+
💡 `lumache.py <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/lumache.py>`_
25+
API docs are generated for this example Python module - they use *docstrings* directly in the documentation, notice how this shows up in the rendered documentation.
26+
🔢 Git tags versioning
27+
We use a basic versioning mechanism by adding a git tag for every release of the example project. All releases and their version numbers are visible on `example-sphinx-basic.readthedocs.io <https://example-sphinx-basic.readthedocs.io/en/latest/>`__.
28+
📜 `README.rst <https://github.com/readthedocs-examples/example-sphinx-basic/blob/main/README.rst>`_
29+
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).
30+
⁉️ Questions / comments
31+
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>`_.
32+
33+
34+
Example Project usage
35+
---------------------
36+
37+
This project has a standard Sphinx layout which is built by Read the Docs almost the same way that you would build it locally (on your own laptop!).
38+
39+
You can build and view this documentation project locally - we recommend that you activate `a local Python virtual environment first <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment>`_:
40+
41+
.. code-block:: console
42+
43+
# Install required Python dependencies (Sphinx etc.)
44+
pip install -r docs/requirements.txt
45+
46+
# Enter the Sphinx project
47+
cd docs/
48+
49+
# Run the raw sphinx-build command
50+
sphinx-build -M html . _build/
51+
52+
53+
You can also build the documentation locally with ``make``:
54+
55+
.. code-block:: console
56+
57+
# Enter the Sphinx project
58+
cd docs/
59+
60+
# Build with make
61+
make html
62+
63+
# Open with your preferred browser, pointing it to the documentation index page
64+
firefox _build/html/index.html
65+
66+
67+
Using the example in your own project
68+
-------------------------------------
69+
70+
If you are new to Read the Docs, you may want to refer to the `Read the Docs User documentation <https://docs.readthedocs.io/>`_.
71+
72+
If you are copying this code in order to get started with your documentation, you need to:
73+
74+
#. place your ``docs/`` folder alongside your Python project. If you are starting a new project, you can adapt the `pyproject.toml` example configuration.
75+
#. use your existing project repository or create a new repository on Github, GitLab, Bitbucket or another host supported by Read the Docs
76+
#. copy ``.readthedocs.yaml`` and the ``docs/`` folder into your project.
77+
#. customize all the files, replacing example contents.
78+
#. add your own Python project, replacing the ``pyproject.toml`` configuration and ``lumache.py`` module.
79+
#. rebuild the documenation locally to see that it works.
80+
#. *finally*, register your project on Read the Docs, see `Importing Your Documentation <https://docs.readthedocs.io/en/stable/intro/import-guide.html>`_.
81+
82+
83+
Read the Docs tutorial
84+
----------------------
85+
86+
To get started with Read the Docs, you may also refer to the `Read the Docs tutorial <https://docs.readthedocs.io/en/stable/tutorial/>`__.
87+
It provides a full walk-through of building an example project similar to the one in this repository.
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:members:
7+
:show-inheritance:
8+
:inherited-members:
9+
10+
{% block methods %}
11+
.. automethod:: __init__
12+
13+
{% if methods %}
14+
.. rubric:: {{ _('Methods') }}
15+
16+
.. autosummary::
17+
{% for item in methods %}
18+
~{{ name }}.{{ item }}
19+
{%- endfor %}
20+
{% endif %}
21+
{% endblock %}
22+
23+
{% block attributes %}
24+
{% if attributes %}
25+
.. rubric:: {{ _('Attributes') }}
26+
27+
.. autosummary::
28+
{% for item in attributes %}
29+
~{{ name }}.{{ item }}
30+
{%- endfor %}
31+
{% endif %}
32+
{% endblock %}
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. automodule:: {{ fullname }}
4+
5+
{% block attributes %}
6+
{% if attributes %}
7+
.. rubric:: Module Attributes
8+
9+
.. autosummary::
10+
:toctree:
11+
{% for item in attributes %}
12+
{{ item }}
13+
{%- endfor %}
14+
{% endif %}
15+
{% endblock %}
16+
17+
{% block functions %}
18+
{% if functions %}
19+
.. rubric:: {{ _('Functions') }}
20+
21+
.. autosummary::
22+
:toctree:
23+
{% for item in functions %}
24+
{{ item }}
25+
{%- endfor %}
26+
{% endif %}
27+
{% endblock %}
28+
29+
{% block classes %}
30+
{% if classes %}
31+
.. rubric:: {{ _('Classes') }}
32+
33+
.. autosummary::
34+
:toctree:
35+
:template: custom-class-template.rst
36+
{% for item in classes %}
37+
{{ item }}
38+
{%- endfor %}
39+
{% endif %}
40+
{% endblock %}
41+
42+
{% block exceptions %}
43+
{% if exceptions %}
44+
.. rubric:: {{ _('Exceptions') }}
45+
46+
.. autosummary::
47+
:toctree:
48+
{% for item in exceptions %}
49+
{{ item }}
50+
{%- endfor %}
51+
{% endif %}
52+
{% endblock %}
53+
54+
{% block modules %}
55+
{% if modules %}
56+
.. rubric:: Modules
57+
58+
.. autosummary::
59+
:toctree:
60+
:template: custom-module-template.rst
61+
:recursive:
62+
{% for item in modules %}
63+
{{ item }}
64+
{%- endfor %}
65+
{% endif %}
66+
{% endblock %}

docs/api.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
API
2+
===
3+
4+
.. autosummary::
5+
:toctree: generated
6+
:template: custom-module-template.rst
7+
:recursive:
8+
9+
accessvis
10+
accessvis.earth
11+
accessvis.utils
12+
13+
14+
15+

0 commit comments

Comments
 (0)