Skip to content

Commit 309243a

Browse files
authored
Add apidoc back to flatland book. (#7)
* Add apidoc back to flatland book. * Add check upon pr to main.
1 parent 0a98680 commit 309243a

File tree

4 files changed

+54
-16
lines changed

4 files changed

+54
-16
lines changed

.github/workflows/checks.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Checks
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
7+
concurrency:
8+
group: ${{ github.head_ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.10"
20+
- name: Build
21+
run: |
22+
pip install -U "jupyter-book>=0.11.2" sphinxcontrib-apidoc flatland-rl
23+
FLATLAND_MODULE_PATH=$(python -c 'import os; import importlib; print(os.path.dirname(importlib.import_module("flatland").__file__))')
24+
FLATLAND_MODULE_VERSION=$(python -c "import flatland; print(flatland.__version__)")
25+
sphinx-apidoc --force -a -e -o apidocs ${FLATLAND_MODULE_PATH} -H "Flatland ${FLATLAND_MODULE_VERSION} API Reference" --tocfile 'index'
26+
jupyter-book build .

.github/workflows/main.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ jobs:
2020
python-version: "3.10"
2121
- name: Build
2222
run: |
23-
pip install -U "jupyter-book>=0.11.2"
24-
jupyter-book build .
23+
pip install -U "jupyter-book>=0.11.2" sphinxcontrib-apidoc flatland-rl
24+
FLATLAND_MODULE_PATH=$(python -c 'import os; import importlib; print(os.path.dirname(importlib.import_module("flatland").__file__))')
25+
FLATLAND_MODULE_VERSION=$(python -c "import flatland; print(flatland.__version__)")
26+
sphinx-apidoc --force -a -e -o apidocs ${FLATLAND_MODULE_PATH} -H "Flatland ${FLATLAND_MODULE_VERSION} API Reference" --tocfile 'index'
27+
jupyter-book build .
2528
# https://github.com/actions/upload-pages-artifact
2629
- name: Upload GitHub Pages artifact
2730
uses: actions/[email protected]

README.md

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
# Contribute to Flatland Book
22

3-
This repository is an aggregation of all the documentation, exploratory research, baselines, un-explored ideas, future research directions for the [Flatland-RL](https://github.com/flatland-association/flatland-rl/) project.
3+
[Flatland Book](https://flatland-association.github.io/flatland-book/) is an aggregation of all the documentation, exploratory research, baselines, un-explored
4+
ideas, future research directions for
5+
the [Flatland-RL](https://github.com/flatland-association/flatland-rl/) project.
46

57
# Installation
68

7-
```
9+
```shell
810
git clone https://github.com/flatland-association/flatland-book.git
911

10-
pip install -U "jupyter-book>=0.11.2"
12+
pip install -U "jupyter-book>=0.11.2" sphinxcontrib-apidoc flatland-rl
1113

14+
FLATLAND_MODULE_PATH=$(python -c 'import os; import importlib; print(os.path.dirname(importlib.import_module("flatland").__file__))')
15+
FLATLAND_MODULE_VERSION=$(python -c "import flatland; print(flatland.__version__)")
16+
sphinx-apidoc --force -a -e -o apidocs ${FLATLAND_MODULE_PATH} -H "Flatland ${FLATLAND_MODULE_VERSION} API Reference" --tocfile 'index'
1217
jupyter-book build .
1318
```
1419

15-
Changes to the ToC will require full re-build:
20+
Changes to the ToC will require full re-build by running
1621

17-
```
18-
clear; jupyter-book clean .; jupyter-book build .
22+
```shell
23+
jupyter-book clean .
1924
```
2025

2126
# Author(s)
2227

23-
- Sharada Mohanty
24-
- Florian Laurent
25-
- Nimish Santhosh
28+
- Sharada Mohanty
29+
- Florian Laurent
30+
- Nimish Santhosh
31+
- Erik Nygren
32+
- Adrian Egli
33+
- Manuel Schneider
34+
- Christian Eichenberger

_toc.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ parts:
3030
- file: environment/pettingzoo
3131
- file: environment/Agent-Close-Following
3232
- file: environment/graph_demo
33-
# - file: _sources/flatland/docs/10_interface_toc.rst
3433

35-
# - caption: Environment Documentation
36-
# chapters:
37-
# - file: _sources/flatland/docs/index
34+
## APIDOC
35+
- caption: APIDOC
36+
chapters:
37+
- file: apidocs/index
3838

3939
## TUTORIALS
40-
- caption: Turorials
40+
- caption: Tutorials
4141
chapters:
4242
- file: tutorials/or
4343
# sections:

0 commit comments

Comments
 (0)