From 47b3b6105f09e0edbb7de8b82aa55b27db3f17a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Sun, 23 Oct 2022 12:07:23 +0100 Subject: [PATCH 1/6] remove envs displays --- docs/environments/atari/list.html | 298 -------------------------- docs/environments/butterfly/list.html | 46 ---- docs/environments/classic/list.html | 130 ----------- docs/environments/mpe/list.html | 118 ---------- docs/environments/sisl/list.html | 46 ---- 5 files changed, 638 deletions(-) delete mode 100644 docs/environments/atari/list.html delete mode 100644 docs/environments/butterfly/list.html delete mode 100644 docs/environments/classic/list.html delete mode 100644 docs/environments/mpe/list.html delete mode 100644 docs/environments/sisl/list.html diff --git a/docs/environments/atari/list.html b/docs/environments/atari/list.html deleted file mode 100644 index 8c4a6098a..000000000 --- a/docs/environments/atari/list.html +++ /dev/null @@ -1,298 +0,0 @@ - - - - -
- - -
-
- -
-
- Basketball Pong -
-
-
- - - -
-
- -
-
- Boxing -
-
-
- - - -
-
- -
-
- Combat Plane -
-
-
- - - -
-
- -
-
- Combat Tank -
-
-
- - - -
-
- -
-
- Double Dunk -
-
-
- - - -
-
- -
-
- Entombed Competitive -
-
-
- - - -
-
- -
-
- Entombed Cooperative -
-
-
- - - -
-
- -
-
- Flag Capture -
-
-
- - - -
-
- -
-
- Foozpong -
-
-
- - - -
-
- -
-
- Ice Hockey -
-
-
- - - -
-
- -
-
- Joust -
-
-
- - - -
-
- -
-
- Mario Bros -
-
-
- - - -
-
- -
-
- Maze Craze -
-
-
- - - -
-
- -
-
- Othello -
-
-
- - - -
-
- -
-
- Pong -
-
-
- - - -
-
- -
-
- Quadrapong -
-
-
- - - -
-
- -
-
- Space Invaders -
-
-
- - - -
-
- -
-
- Space War -
-
-
- - - -
-
- -
-
- Surround -
-
-
- - - -
-
- -
-
- Tennis -
-
-
- - - -
-
- -
-
- Video Checkers -
-
-
- - - -
-
- -
-
- Volleyball Pong -
-
-
- - - -
-
- -
-
- Warlords -
-
-
- - - -
-
- -
-
- Wizard Of Wor -
-
-
- -
- - - - \ No newline at end of file diff --git a/docs/environments/butterfly/list.html b/docs/environments/butterfly/list.html deleted file mode 100644 index 9de484a8c..000000000 --- a/docs/environments/butterfly/list.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- - -
-
- -
-
- Cooperative Pong -
-
-
- - - -
-
- -
-
- Knights Archers Zombies -
-
-
- - - -
-
- -
-
- Pistonball -
-
-
- -
- - - - \ No newline at end of file diff --git a/docs/environments/classic/list.html b/docs/environments/classic/list.html deleted file mode 100644 index 7e370ae24..000000000 --- a/docs/environments/classic/list.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - -
- - -
-
- -
-
- Chess -
-
-
- - - -
-
- -
-
- Connect Four -
-
-
- - - -
-
- -
-
- Gin Rummy -
-
-
- - - -
-
- -
-
- Go -
-
-
- - - -
-
- -
-
- Hanabi -
-
-
- - - -
-
- -
-
- Leduc Holdem -
-
-
- - - -
-
- -
-
- Rps -
-
-
- - - -
-
- -
-
- Texas Holdem No Limit -
-
-
- - - -
-
- -
-
- Texas Holdem -
-
-
- - - -
-
- -
-
- Tictactoe -
-
-
- -
- - - - \ No newline at end of file diff --git a/docs/environments/mpe/list.html b/docs/environments/mpe/list.html deleted file mode 100644 index 6f83271bc..000000000 --- a/docs/environments/mpe/list.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - -
- - -
-
- -
-
- Simple Adversary -
-
-
- - - -
-
- -
-
- Simple Crypto -
-
-
- - - -
-
- -
-
- Simple Push -
-
-
- - - -
-
- -
-
- Simple Reference -
-
-
- - - -
-
- -
-
- Simple Speaker Listener -
-
-
- - - -
-
- -
-
- Simple Spread -
-
-
- - - -
-
- -
-
- Simple Tag -
-
-
- - - -
-
- -
-
- Simple World Comm -
-
-
- - - -
-
- -
-
- Simple -
-
-
- -
- - - - \ No newline at end of file diff --git a/docs/environments/sisl/list.html b/docs/environments/sisl/list.html deleted file mode 100644 index a25c2d1e2..000000000 --- a/docs/environments/sisl/list.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- - -
-
- -
-
- Multiwalker -
-
-
- - - -
-
- -
-
- Pursuit -
-
-
- - - -
-
- -
-
- Waterworld -
-
-
- -
- - - - \ No newline at end of file From 5f37aaea1aba86415372755cdc0a8bb1b4d9f396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Sun, 23 Oct 2022 12:09:00 +0100 Subject: [PATCH 2/6] ignore envs displays --- docs/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/.gitignore b/docs/.gitignore index 060262f6f..645e1ccd5 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1 +1,2 @@ -environments/**/*.md \ No newline at end of file +environments/**/*.md +environments/**/list.html \ No newline at end of file From 861a0a5665f15bf30e3019338f3dc5c22a3b2ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Sun, 23 Oct 2022 12:32:07 +0100 Subject: [PATCH 3/6] remove edit to autogenerated files, add contribute to the docs --- docs/README.md | 38 +++++++++++++++++++++++++++++++++++ docs/_scripts/gen_envs_mds.py | 2 +- docs/index.md | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 docs/README.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..57eb24f6a --- /dev/null +++ b/docs/README.md @@ -0,0 +1,38 @@ +# PettingZoo docs + +This folder contains the documentation for [PettingZoo](https://github.com/Farama-Foundation/PettingZoo). + +## Instructions for editing content + +Our documentation is written in Markdown (more precisely, MyST - Markedly Structured Text) and built using [Sphinx](https://www.sphinx-doc.org/en/master/). +All content present in the documentation website can be found in this directory except for the environments. + +### Editing an environment page + +Environemnts' documentation can be found at the top of the file python file where the environment is declared, for example, the documentation for the chess environment can be at [/pettingzoo/classic/chess/chess.py](https://github.com/Farama-Foundation/PettingZoo/blob/master/pettingzoo/classic/chess/chess.py) + +To generate the environments pages you need to execute the `_scripts/gen_envs_mds.py` script. + +## Build the Documentation + +Install the required packages and PettingZoo: + +``` +pip install -e . +cd docs/ +pip install -r requirements.txt +``` + +To build the documentation once: + +``` +cd docs +make dirhtml _build +``` + +To rebuild the documentation automatically every time a change is made: + +``` +cd docs +sphinx-autobuild -b dirhtml . _build +``` diff --git a/docs/_scripts/gen_envs_mds.py b/docs/_scripts/gen_envs_mds.py index 1debc704f..6d9623ad6 100644 --- a/docs/_scripts/gen_envs_mds.py +++ b/docs/_scripts/gen_envs_mds.py @@ -7,7 +7,7 @@ def add_frontmatter(text, frontmatter_options): - frontmatter_text = "---" + frontmatter_text = "---\nautogenerated:" for key, value in frontmatter_options.items(): frontmatter_text += f"\n{key}: {value}" frontmatter_text += "\n---\n\n" diff --git a/docs/index.md b/docs/index.md index 10a3452a8..5f3a74aba 100644 --- a/docs/index.md +++ b/docs/index.md @@ -48,7 +48,7 @@ tutorials/cleanrl/implementing_PPO :caption: Development Github -Donate +Contribute to the Docs ``` From 01f9acc405451b068f92829b94f0c188bb144670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Sun, 23 Oct 2022 12:34:16 +0100 Subject: [PATCH 4/6] add gen_envs_display to build-docs workflow --- .github/workflows/build-docs.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 77ebc6b55..8a12176d8 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -8,23 +8,26 @@ jobs: docs: name: Generate Website runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.9' - name: Install dependencies run: pip install -r docs/requirements.txt - + - name: Install PettingZoo run: pip install . - + - name: Generate environment docs run: python docs/_scripts/gen_envs_mds.py - + + - name: Generate environments display + run: python docs/_scripts/gen_envs_display.py + - name: Build run: sphinx-build -b dirhtml -v docs _build From 87252db651f7e51db1fe9bc03b6546ffff63a54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Sun, 23 Oct 2022 12:39:50 +0100 Subject: [PATCH 5/6] fix relative path --- docs/_scripts/gen_envs_display.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/_scripts/gen_envs_display.py b/docs/_scripts/gen_envs_display.py index 404d18e01..16146a81a 100644 --- a/docs/_scripts/gen_envs_display.py +++ b/docs/_scripts/gen_envs_display.py @@ -1,3 +1,4 @@ +import os import sys all_envs = { @@ -111,8 +112,8 @@ def generate_page(env_type_id, env_list, limit=-1, base_path=""): for key in all_envs.keys(): env_list = all_envs[key] - envs_path = f"../environments/{key}" + envs_path = os.path.join(os.path.dirname(__file__), "..", "environments", key) page = generate_page(key, env_list) - fp = open(f"{envs_path}/list.html", "w+", encoding="utf-8") + fp = open(os.path.join(envs_path, "list.html"), "w+", encoding="utf-8") fp.write(page) fp.close() From 206c8f8ad99991ab92c53a67a05d53e230fcd80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Goul=C3=A3o?= Date: Sun, 23 Oct 2022 12:47:11 +0100 Subject: [PATCH 6/6] update copyright --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 741baad0d..1bc8ccea0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ import pettingzoo project = "PettingZoo" -copyright = "2022" +copyright = "2022 Farama Foundation" author = "Farama Foundation" # The full version, including alpha/beta/rc tags