mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-07-31 05:44:31 +00:00
Update docs (#552)
This commit is contained in:
4
.github/workflows/build-docs.yml
vendored
4
.github/workflows/build-docs.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
run: pip install .[box2d,mujoco]
|
||||
|
||||
- name: Build Envs Docs
|
||||
run: python docs/scripts/gen_mds.py && python docs/scripts/gen_envs_display.py
|
||||
run: python docs/_scripts/gen_mds.py && python docs/_scripts/gen_envs_display.py
|
||||
|
||||
- name: Build
|
||||
run: sphinx-build -b dirhtml -v docs _build
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
run: mv _build/404/index.html _build/404.html
|
||||
|
||||
- name: Update 404 links
|
||||
run: python docs/scripts/move_404.py _build/404.html
|
||||
run: python docs/_scripts/move_404.py _build/404.html
|
||||
|
||||
- name: Remove .doctrees
|
||||
run: rm -r _build/.doctrees
|
||||
|
4
.github/workflows/docs-manual-versioning.yml
vendored
4
.github/workflows/docs-manual-versioning.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
||||
run: pip install .[box2d,mujoco]
|
||||
|
||||
- name: Build Envs Docs
|
||||
run: python docs/scripts/gen_mds.py && python docs/scripts/gen_envs_display.py
|
||||
run: python docs/_scripts/gen_mds.py && python docs/_scripts/gen_envs_display.py
|
||||
|
||||
- name: Build
|
||||
run: sphinx-build -b dirhtml -v docs _build
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
run: mv _build/404/index.html _build/404.html
|
||||
|
||||
- name: Update 404 links
|
||||
run: python docs/scripts/move_404.py _build/404.html
|
||||
run: python docs/_scripts/move_404.py _build/404.html
|
||||
|
||||
- name: Remove .doctrees
|
||||
run: rm -r _build/.doctrees
|
||||
|
4
.github/workflows/docs-versioning.yml
vendored
4
.github/workflows/docs-versioning.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
run: pip install .[box2d,mujoco]
|
||||
|
||||
- name: Build Envs Docs
|
||||
run: python docs/scripts/gen_mds.py && python docs/scripts/gen_envs_display.py
|
||||
run: python docs/_scripts/gen_mds.py && python docs/_scripts/gen_envs_display.py
|
||||
|
||||
- name: Build
|
||||
run: sphinx-build -b dirhtml -v docs _build
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
run: mv _build/404/index.html _build/404.html
|
||||
|
||||
- name: Update 404 links
|
||||
run: python docs/scripts/move_404.py _build/404.html
|
||||
run: python docs/_scripts/move_404.py _build/404.html
|
||||
|
||||
- name: Remove .doctrees
|
||||
run: rm -r _build/.doctrees
|
||||
|
@@ -66,7 +66,7 @@ pip install -r requirements.txt
|
||||
Then run
|
||||
|
||||
```shell
|
||||
python scripts/gen_mds.py
|
||||
python _scripts/gen_mds.py
|
||||
make dirhtml
|
||||
```
|
||||
|
||||
|
@@ -10,7 +10,7 @@ If you are modifying an atari environment page, please follow the instructions b
|
||||
|
||||
If you are editing an Atari environment, directly edit the Markdown file in this repository.
|
||||
|
||||
Otherwise, fork Gymnasium and edit the docstring in the environment's Python file. Then, pip install your Gymnasium fork and run `docs/scripts/gen_mds.py` in this repo. This will automatically generate a Markdown documentation file for the environment.
|
||||
Otherwise, fork Gymnasium and edit the docstring in the environment's Python file. Then, pip install your Gymnasium fork and run `docs/_scripts/gen_mds.py` in this repo. This will automatically generate a Markdown documentation file for the environment.
|
||||
|
||||
### Adding a new environment
|
||||
|
||||
@@ -20,11 +20,11 @@ For Atari envs, add a Markdown file into `docs/environments/atari` then complete
|
||||
|
||||
#### Non-Atari env
|
||||
|
||||
Ensure the environment is in Gymnasium (or your fork). Ensure that the environment's Python file has a properly formatted markdown docstring. Install using `pip install -e .` and then run `docs/scripts/gen_mds.py`. This will automatically generate a md page for the environment. Then complete the [other steps](#other-steps).
|
||||
Ensure the environment is in Gymnasium (or your fork). Ensure that the environment's Python file has a properly formatted markdown docstring. Install using `pip install -e .` and then run `docs/_scripts/gen_mds.py`. This will automatically generate a md page for the environment. Then complete the [other steps](#other-steps).
|
||||
|
||||
#### Other steps
|
||||
|
||||
- Add the corresponding gif into the `docs/_static/videos/{ENV_TYPE}` folder, where `ENV_TYPE` is the category of your new environment (e.g. mujoco). Follow snake_case naming convention. Alternatively, run `docs/scripts/gen_gifs.py`.
|
||||
- Add the corresponding gif into the `docs/_static/videos/{ENV_TYPE}` folder, where `ENV_TYPE` is the category of your new environment (e.g. mujoco). Follow snake_case naming convention. Alternatively, run `docs/_scripts/gen_gifs.py`.
|
||||
- Edit `docs/environments/{ENV_TYPE}/index.md`, and add the name of the file corresponding to your new environment to the `toctree`.
|
||||
|
||||
## Build the Documentation
|
||||
|
@@ -24,7 +24,7 @@ import gymnasium
|
||||
|
||||
|
||||
project = "Gymnasium"
|
||||
copyright = "2022 Farama Foundation"
|
||||
copyright = "2023 Farama Foundation"
|
||||
author = "Farama Foundation"
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
|
@@ -4,15 +4,13 @@ firstpage:
|
||||
lastpage:
|
||||
---
|
||||
|
||||
<center>
|
||||
<div class="logo">
|
||||
<img src="_static/img/gymnasium-text.png" width="65%" alt="Gymnasium Logo">
|
||||
</div>
|
||||
</center>
|
||||
```{project-logo} _static/img/gymnasium-text.png
|
||||
:alt: Gymnasium Logo
|
||||
```
|
||||
|
||||
<div class="header-text">
|
||||
<h2>An API standard for reinforcement learning with a diverse collection of reference environments</h2>
|
||||
</div>
|
||||
```{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
|
||||
@@ -36,35 +34,6 @@ for _ in range(1000):
|
||||
env.close()
|
||||
```
|
||||
|
||||
<style>
|
||||
h2 {
|
||||
padding-top: 0;
|
||||
padding-bottom: 20px;
|
||||
font-size: 28px;
|
||||
margin: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
img{
|
||||
vertical-align:bottom;
|
||||
padding-bottom: 0;
|
||||
padding-top: 0
|
||||
}
|
||||
.logo{
|
||||
padding-left: 8%;
|
||||
padding-top: 10px
|
||||
}
|
||||
@media (min-width: 455px) {
|
||||
.header-text{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@media (max-width: 455px) {
|
||||
.header-text{
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
:caption: Introduction
|
||||
|
@@ -117,7 +117,7 @@ safe = true
|
||||
[tool.isort]
|
||||
atomic = true
|
||||
profile = "black"
|
||||
src_paths = ["gymnasium", "tests", "docs/scripts"]
|
||||
src_paths = ["gymnasium", "tests", "docs/_scripts"]
|
||||
extra_standard_library = ["typing_extensions"]
|
||||
indent = 4
|
||||
lines_after_imports = 2
|
||||
|
Reference in New Issue
Block a user