Skip to content

Commit

Permalink
feat!: modernize documentation setup
Browse files Browse the repository at this point in the history
This commit autodocuments Ion apps (removing the need for a script), and
fixes many of the formatting errors in the current docs.
It also updates the docs for the formatting/linting CI, which was
updated in tjcsl#1659
  • Loading branch information
JasonGrace2282 committed Aug 25, 2024
1 parent e5e51f2 commit 43dc061
Show file tree
Hide file tree
Showing 141 changed files with 819 additions and 4,098 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Pipfile
build
.coverage
dist/*.tar.gz
docs/source/reference

# General ignores
*.crt
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Documentation (in RestructuredText format) is available inside the "docs" folder

**Ion now requires Python 3.8+** Python 3.8.5 is currently used in both production and testing environments.

**How can I create a testing environment?** Read the section on `Setting up a Dev Environment <https://github.com/tjcsl/ion/blob/master/SETUP.md>`_ in the documentation.
**How can I create a testing environment?** Read the section on `Setting up a Dev Environment <https://tjcsl.github.io/ion/setup/setup.html>`_ in the documentation.

**How can I contribute to Ion? How can I report a bug? How can I report a security issue/vulnerability?**

Please read our `contributing guide <https://github.com/tjcsl/ion/blob/master/CONTRIBUTING.md>`_ for more information.
Please read our `contributing guide <https://tjcsl.github.io/ion/developing/contributing.html>`_ for more information.

Current Intranet maintainers: `alanzhu0 <https://github.com/alanzhu0>`_ and `NotFish232 <https://github.com/NotFish232>`_
24 changes: 24 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

cleanall: clean
@echo "Cleaning all references"
@rm source/reference/*

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
8 changes: 0 additions & 8 deletions docs/_ext/djangodocs.py

This file was deleted.

Empty file removed docs/_templates/relations.html
Empty file.
107 changes: 0 additions & 107 deletions docs/developing/styleguide.rst

This file was deleted.

4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
furo
myst-parser
sphinx-copybutton
sphinxcontrib-django
68 changes: 0 additions & 68 deletions docs/rtd-requirements.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ name | escape | underline}}

Qualified name: ``{{ fullname | escape }}``

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:show-inheritance:
:members:
:private-members:


{% block methods %}
{%- if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:nosignatures:
{% for item in methods if item != '__init__' and item[0] != '_' and item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endfor %}
{%- endif %}
{%- endblock %}

{% block attributes %}
{%- if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes if item[0] != '_' and item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endfor %}
{%- endif %}
{% endblock %}
52 changes: 52 additions & 0 deletions docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{ name | escape | underline }}

.. currentmodule:: {{ fullname }}

.. automodule:: {{ fullname }}

{% block classes %}
{% if classes %}
.. rubric:: Classes

.. autosummary::
:toctree: .
:nosignatures:
{% for class in classes %}
{{ class }}
{% endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

{% for item in functions %}
.. autofunction:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
File renamed without changes.
Loading

0 comments on commit 43dc061

Please sign in to comment.