Skip to content

Commit

Permalink
Merge 2464ae1 into 6a0b8db
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacgsmith authored Sep 13, 2021
2 parents 6a0b8db + 2464ae1 commit 9dababa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
17 changes: 16 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,21 @@ def to_html_ext(path):
return os.path.splitext(path)[0] + ".html"


def generate_tutorials_page(app):
notebooks = ""

for root, dirs, fnames in os.walk("io/"):
for fname in fnames:
if fname.endswith(".ipynb") and "checkpoint" not in fname:
notebooks += f"\n* :doc:`{root}/{fname[:-6]}`"

title = "Tutorials\n*********\n"
description = "The following pages contain the TARDIS tutorials:"

with open("tutorials.rst", mode="wt", encoding="utf-8") as f:
f.write(f"{title}\n{description}\n{notebooks}")


def autodoc_skip_member(app, what, name, obj, skip, options):
"""Exclude specific functions/methods from the documentation"""
exclusions = ("yaml_constructors", "yaml_implicit_resolvers")
Expand Down Expand Up @@ -355,8 +370,8 @@ def create_redirect_files(app, docname):
with open(old_html_fpath, "w") as f:
f.write(new_content)


def setup(app):
app.connect("builder-inited", generate_tutorials_page)
app.connect("autodoc-skip-member", autodoc_skip_member)
app.connect("build-finished", create_redirect_files)

Expand Down
11 changes: 2 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Mission Statement

installation
quickstart/quickstart

tutorials
API <api/modules>


.. toctree::
Expand Down Expand Up @@ -104,14 +105,6 @@ Mission Statement
CHANGELOG.md
roadmap

.. toctree::
:maxdepth: 2
:caption: API
:hidden:

api/modules



.. toctree::
:caption: References
Expand Down

0 comments on commit 9dababa

Please sign in to comment.