Tutorials galleries (#258)

This commit is contained in:
Manuel Goulão
2023-01-11 14:00:51 -06:00
committed by GitHub
parent 35fe9b0f13
commit 4e6dc3e420
14 changed files with 54 additions and 53 deletions

View File

@@ -16,9 +16,10 @@
# -- Project information -----------------------------------------------------
import os
import re
from typing import Any, Dict
from furo import gen_tutorials
import sphinx_gallery.gen_rst
import gymnasium
@@ -43,6 +44,7 @@ extensions = [
"sphinx.ext.githubpages",
"myst_parser",
"furo.gen_tutorials",
"sphinx_gallery.gen_gallery",
"sphinx_github_changelog",
]
@@ -52,7 +54,7 @@ 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 = ["tutorials/demo.rst"]
exclude_patterns = ["tutorials/README.rst"]
# Napoleon settings
napoleon_use_ivar = True
@@ -95,10 +97,29 @@ html_css_files = []
# -- Generate Tutorials -------------------------------------------------
gen_tutorials.generate(
os.path.dirname(__file__),
os.path.join(os.path.dirname(__file__), "tutorials"),
)
sphinx_gallery.gen_rst.EXAMPLE_HEADER = """
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "{0}"
.. LINE NUMBERS ARE GIVEN BELOW.
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_{1}:
"""
sphinx_gallery_conf = {
"ignore_pattern": r"__init__\.py",
"examples_dirs": "./tutorials",
"gallery_dirs": "./tutorials",
"show_signature": False,
"show_memory": False,
"min_reported_time": float("inf"),
"filename_pattern": f"{re.escape(os.sep)}run_",
"default_thumb_file": "_static/img/gymnasium-github.png",
}
# -- Generate Changelog -------------------------------------------------