Skip to content

Commit

Permalink
docs: Generate docs using sphinx-autoapi
Browse files Browse the repository at this point in the history
  • Loading branch information
navasvarela committed Nov 12, 2024
1 parent 7c622cc commit a308d62
Show file tree
Hide file tree
Showing 23 changed files with 377 additions and 201 deletions.
8 changes: 0 additions & 8 deletions docs/_source/nada_dsl.audit.abstract.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/_source/nada_dsl.audit.report.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/_source/nada_dsl.audit.strict.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_source/nada_dsl.circuit_io.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_source/nada_dsl.compile.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_source/nada_dsl.compiler_frontend.rst

This file was deleted.

21 changes: 0 additions & 21 deletions docs/_source/nada_dsl.nada_types.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_source/nada_dsl.operations.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/_source/nada_dsl.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_source/nada_dsl.source_ref.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_templates/module.rst_t

This file was deleted.

36 changes: 0 additions & 36 deletions docs/_templates/package.rst_t

This file was deleted.

8 changes: 0 additions & 8 deletions docs/_templates/toc.rst_t

This file was deleted.

84 changes: 45 additions & 39 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,78 +12,85 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

sys.path.insert(0, os.path.abspath(".."))


# -- Project information -----------------------------------------------------

# The name and version are retrieved from ``pyproject.toml`` in the root
# directory.
import toml
with open('../pyproject.toml') as pyproject_file:

with open("../pyproject.toml") as pyproject_file:
pyproject_data = toml.load(pyproject_file)
project = pyproject_data['project']['name']
version = pyproject_data['project']['version']
project = pyproject_data["project"]["name"]
version = pyproject_data["project"]["version"]
release = version

# The copyright year and holder information is retrieved from the
# ``LICENSE`` file.
try:
import re
with open('../LICENSE', 'r') as license_file:
license_string = license_file.read().split('Copyright (c) ')[1]

with open("../LICENSE", "r") as license_file:
license_string = license_file.read().split("Copyright (c) ")[1]
year = license_string[:4]
author = license_string[5:].split('\n')[0]
copyright = year + ', ' + re.sub(r"\.$", "", author) # Period already in HTML.
author = license_string[5:].split("\n")[0]
copyright = year + ", " + re.sub(r"\.$", "", author) # Period already in HTML.
except:
year = ''
author = ''
copyright = ''
year = ""
author = ""
copyright = ""

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode'
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"autoapi.extension",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# Options to configure autodoc extension behavior.
autodoc_member_order = 'bysource'
autodoc_member_order = "bysource"
autodoc_default_options = {
'special-members': True,
'exclude-members': ','.join([
'__init__',
'__weakref__',
'__module__',
'__hash__',
'__dict__',
'__annotations__',
'__dataclass_params__',
'__dataclass_fields__',
'__match_args__',
'__repr__',

])
"special-members": True,
"exclude-members": ",".join(
[
"__init__",
"__weakref__",
"__module__",
"__hash__",
"__dict__",
"__annotations__",
"__dataclass_params__",
"__dataclass_fields__",
"__match_args__",
"__repr__",
]
),
}
autodoc_preserve_defaults = True

autoapi_dirs = ["../nada_dsl"]

# Allow references/links to definitions found in the Python documentation.
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
"python": ("https://docs.python.org/3", None),
}

# Do not display fully qualified names.
Expand All @@ -95,12 +102,11 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options for Read the Docs.
html_theme_options = {
'display_version': True,
'collapse_navigation': True,
'navigation_depth': 1,
'titles_only': True
"collapse_navigation": True,
"navigation_depth": 4,
"titles_only": True,
}
11 changes: 11 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
.. include:: ../README.rst
.. include:: toc.rst

.. toctree::
:maxdepth: 3
:caption: Contents:

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nada_dsl
========

.. toctree::
:maxdepth: 4

nada_dsl
45 changes: 45 additions & 0 deletions docs/nada_dsl.audit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
nada\_dsl.audit package
=======================

Submodules
----------

nada\_dsl.audit.abstract module
-------------------------------

.. automodule:: nada_dsl.audit.abstract
:members:
:undoc-members:
:show-inheritance:

nada\_dsl.audit.common module
-----------------------------

.. automodule:: nada_dsl.audit.common
:members:
:undoc-members:
:show-inheritance:

nada\_dsl.audit.report module
-----------------------------

.. automodule:: nada_dsl.audit.report
:members:
:undoc-members:
:show-inheritance:

nada\_dsl.audit.strict module
-----------------------------

.. automodule:: nada_dsl.audit.strict
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: nada_dsl.audit
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/nada_dsl.future.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
nada\_dsl.future package
========================

Submodules
----------

nada\_dsl.future.operations module
----------------------------------

.. automodule:: nada_dsl.future.operations
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: nada_dsl.future
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit a308d62

Please sign in to comment.