mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-07-31 13:54:31 +00:00
Tutorials galleries (#258)
This commit is contained in:
33
docs/conf.py
33
docs/conf.py
@@ -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 -------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user