Add support for python doc files without rst gallery (#770)

Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
This commit is contained in:
Manuel Goulão
2023-11-11 12:52:15 +00:00
committed by GitHub
parent 40f5c7bd42
commit 8333df8666
3 changed files with 103 additions and 96 deletions

View File

@@ -16,6 +16,7 @@ import re
import sys
import sphinx_gallery.gen_rst
from furo.gen_tutorials import generate_tutorials
# Path setup for building from source tree
@@ -138,6 +139,12 @@ sphinx_gallery_conf = {
),
}
# All tutorials in the tutorials directory will be generated automatically
# by sphinx-gallery.
# However, we also want to generate some tutorials without the gallery
# and to a more specific location so we use this custom function.
generate_tutorials("introduction/*.py", "./introduction")
# -- Generate Changelog -------------------------------------------------
sphinx_github_changelog_token = os.environ.get("SPHINX_GITHUB_CHANGELOG_TOKEN")

View File

@@ -1,96 +1,96 @@
---
hide-toc: true
firstpage:
lastpage:
---
```{project-logo} _static/img/gymnasium-text.png
:alt: Gymnasium Logo
```
```{project-heading}
An API standard for reinforcement learning with a diverse collection of reference environments
```
```{figure} _static/videos/box2d/lunar_lander.gif
:alt: Lunar Lander
:width: 500
```
**Gymnasium is a maintained fork of OpenAIs Gym library.** The Gymnasium interface is simple, pythonic, and capable of representing general RL problems, and has a [compatibility wrapper](introduction/gym_compatibility) for old Gym environments:
```{code-block} python
import gymnasium as gym
# Initialise the environment
env = gym.make("LunarLander-v2", render_mode="human")
# Reset the environment to generate the first observation
observation, info = env.reset(seed=42)
for _ in range(1000):
# this is where you would insert your policy
action = env.action_space.sample()
# step (transition) through the environment with the action
# receiving the next observation, reward and if the episode has terminated or truncated
observation, reward, terminated, truncated, info = env.step(action)
# If the episode has ended then we can reset to start a new episode
if terminated or truncated:
observation, info = env.reset()
env.close()
```
```{toctree}
:hidden:
:caption: Introduction
introduction/basic_usage
introduction/gym_compatibility
introduction/migration-guide
```
```{toctree}
:hidden:
:caption: API
api/env
api/registry
api/spaces
api/wrappers
api/vector
api/utils
api/functional
```
```{toctree}
:hidden:
:caption: Environments
environments/classic_control
environments/box2d
environments/toy_text
environments/mujoco
environments/atari
environments/third_party_environments
```
```{toctree}
:hidden:
:glob:
:caption: Tutorials
tutorials/**/index
Comet Tutorial <https://www.comet.com/docs/v2/integrations/ml-frameworks/gymnasium/?utm_source=gymnasium&utm_medium=partner&utm_campaign=partner_gymnasium_2023&utm_content=docs_gymnasium>
```
```{toctree}
:hidden:
:caption: Development
Github <https://github.com/Farama-Foundation/Gymnasium>
gymnasium_release_notes/index
gym_release_notes/index
Contribute to the Docs <https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/README.md>
```
---
hide-toc: true
firstpage:
lastpage:
---
```{project-logo} _static/img/gymnasium-text.png
:alt: Gymnasium Logo
```
```{project-heading}
An API standard for reinforcement learning with a diverse collection of reference environments
```
```{figure} _static/videos/box2d/lunar_lander.gif
:alt: Lunar Lander
:width: 500
```
**Gymnasium is a maintained fork of OpenAIs Gym library.** The Gymnasium interface is simple, pythonic, and capable of representing general RL problems, and has a [compatibility wrapper](introduction/gym_compatibility) for old Gym environments:
```{code-block} python
import gymnasium as gym
# Initialise the environment
env = gym.make("LunarLander-v2", render_mode="human")
# Reset the environment to generate the first observation
observation, info = env.reset(seed=42)
for _ in range(1000):
# this is where you would insert your policy
action = env.action_space.sample()
# step (transition) through the environment with the action
# receiving the next observation, reward and if the episode has terminated or truncated
observation, reward, terminated, truncated, info = env.step(action)
# If the episode has ended then we can reset to start a new episode
if terminated or truncated:
observation, info = env.reset()
env.close()
```
```{toctree}
:hidden:
:caption: Introduction
introduction/basic_usage
introduction/gym_compatibility
introduction/migration-guide
```
```{toctree}
:hidden:
:caption: API
api/env
api/registry
api/spaces
api/wrappers
api/vector
api/utils
api/functional
```
```{toctree}
:hidden:
:caption: Environments
environments/classic_control
environments/box2d
environments/toy_text
environments/mujoco
environments/atari
environments/third_party_environments
```
```{toctree}
:hidden:
:glob:
:caption: Tutorials
tutorials/**/index
Comet Tutorial <https://www.comet.com/docs/v2/integrations/ml-frameworks/gymnasium/?utm_source=gymnasium&utm_medium=partner&utm_campaign=partner_gymnasium_2023&utm_content=docs_gymnasium>
```
```{toctree}
:hidden:
:caption: Development
Github <https://github.com/Farama-Foundation/Gymnasium>
gymnasium_release_notes/index
gym_release_notes/index
Contribute to the Docs <https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/README.md>
```

View File