From 2b1772fac907c6548d9a0ed2c67e8f41a769f171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Mon, 12 Jun 2023 11:20:44 +0100 Subject: [PATCH] Update docs (#552) --- .github/workflows/build-docs.yml | 4 +- .github/workflows/docs-manual-versioning.yml | 4 +- .github/workflows/docs-versioning.yml | 4 +- CONTRIBUTING.md | 2 +- docs/README.md | 6 +-- docs/{scripts => _scripts}/atari-docs.json | 0 docs/{scripts => _scripts}/gen_atari_table.py | 0 .../{scripts => _scripts}/gen_envs_display.py | 0 docs/{scripts => _scripts}/gen_gifs.py | 0 docs/{scripts => _scripts}/gen_mds.py | 0 docs/{scripts => _scripts}/move_404.py | 0 docs/{scripts => _scripts}/utils.py | 0 docs/conf.py | 2 +- docs/index.md | 43 +++---------------- pyproject.toml | 2 +- 15 files changed, 18 insertions(+), 49 deletions(-) rename docs/{scripts => _scripts}/atari-docs.json (100%) rename docs/{scripts => _scripts}/gen_atari_table.py (100%) rename docs/{scripts => _scripts}/gen_envs_display.py (100%) rename docs/{scripts => _scripts}/gen_gifs.py (100%) rename docs/{scripts => _scripts}/gen_mds.py (100%) rename docs/{scripts => _scripts}/move_404.py (100%) rename docs/{scripts => _scripts}/utils.py (100%) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 05272a9b9..48d8b5a4c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -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 diff --git a/.github/workflows/docs-manual-versioning.yml b/.github/workflows/docs-manual-versioning.yml index 3759810f8..ea8086945 100644 --- a/.github/workflows/docs-manual-versioning.yml +++ b/.github/workflows/docs-manual-versioning.yml @@ -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 diff --git a/.github/workflows/docs-versioning.yml b/.github/workflows/docs-versioning.yml index 5932b90ea..c8071645d 100644 --- a/.github/workflows/docs-versioning.yml +++ b/.github/workflows/docs-versioning.yml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfac7ad5e..048d85cb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ pip install -r requirements.txt Then run ```shell -python scripts/gen_mds.py +python _scripts/gen_mds.py make dirhtml ``` diff --git a/docs/README.md b/docs/README.md index bbe8141d4..8510bdbf9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 diff --git a/docs/scripts/atari-docs.json b/docs/_scripts/atari-docs.json similarity index 100% rename from docs/scripts/atari-docs.json rename to docs/_scripts/atari-docs.json diff --git a/docs/scripts/gen_atari_table.py b/docs/_scripts/gen_atari_table.py similarity index 100% rename from docs/scripts/gen_atari_table.py rename to docs/_scripts/gen_atari_table.py diff --git a/docs/scripts/gen_envs_display.py b/docs/_scripts/gen_envs_display.py similarity index 100% rename from docs/scripts/gen_envs_display.py rename to docs/_scripts/gen_envs_display.py diff --git a/docs/scripts/gen_gifs.py b/docs/_scripts/gen_gifs.py similarity index 100% rename from docs/scripts/gen_gifs.py rename to docs/_scripts/gen_gifs.py diff --git a/docs/scripts/gen_mds.py b/docs/_scripts/gen_mds.py similarity index 100% rename from docs/scripts/gen_mds.py rename to docs/_scripts/gen_mds.py diff --git a/docs/scripts/move_404.py b/docs/_scripts/move_404.py similarity index 100% rename from docs/scripts/move_404.py rename to docs/_scripts/move_404.py diff --git a/docs/scripts/utils.py b/docs/_scripts/utils.py similarity index 100% rename from docs/scripts/utils.py rename to docs/_scripts/utils.py diff --git a/docs/conf.py b/docs/conf.py index 5efbc51dd..e884e85f2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/docs/index.md b/docs/index.md index dc50822bc..a0a2d566f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,15 +4,13 @@ firstpage: lastpage: --- -
- -
+```{project-logo} _static/img/gymnasium-text.png +:alt: Gymnasium Logo +``` -
-

An API standard for reinforcement learning with a diverse collection of reference environments

-
+```{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() ``` - - ```{toctree} :hidden: :caption: Introduction diff --git a/pyproject.toml b/pyproject.toml index d9141f439..ce1d771bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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