Skip to content

Commit 38139bb

Browse files
switch docs to mdbooks doc format (#218)
Move from mkdocs to mdbooks. Code heavily claude assisted.
1 parent 7ca82c2 commit 38139bb

32 files changed

Lines changed: 311 additions & 241 deletions

.github/workflows/docs.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
name: Deploy MkDocs
1+
name: Deploy Docs
2+
23
on:
34
push:
45
branches: [main]
6+
paths: [docs/**]
57
workflow_dispatch:
68

79
permissions:
8-
contents: write # allow pushing to gh-pages
10+
contents: write
911

1012
jobs:
1113
build:
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v5
16-
with: { python-version: "3.x" }
17-
- name: Install MkDocs deps
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install -r docs/requirements.txt
21-
- name: Build site
22-
run: mkdocs build --strict
23-
- name: Publish to GitHub Pages
24-
uses: peaceiris/actions-gh-pages@v3
17+
18+
- name: Setup mdBook
19+
uses: peaceiris/actions-mdbook@v2
20+
with:
21+
mdbook-version: 'latest'
22+
23+
- name: Build book
24+
run: mdbook build docs
25+
26+
- name: Deploy to GitHub Pages
27+
uses: peaceiris/actions-gh-pages@v4
2528
with:
2629
github_token: ${{ secrets.GITHUB_TOKEN }}
27-
publish_dir: ./site
28-
publish_branch: gh-pages
30+
publish_dir: ./docs/book

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,4 @@ artifacts/
188188
# Local drive renders
189189
pufferlib/resources/drive/output*.gif
190190
emsdk/
191+
docs/book/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ puffer eval puffer_drive --eval.human-replay-eval True --load-model-path <your-t
181181

182182
**Docs**
183183

184-
A browsable documentation site now lives under `docs/` and is configured with MkDocs Material. To preview locally:
184+
A browsable documentation site now lives under `docs/` and is configured with mkbooks. To preview locally:
185185
```
186-
uv pip install -r docs/requirements.txt # or pip install -r docs/requirements.txt
187-
mkdocs serve
186+
brew install mdbook
187+
mdbook serve --open docs
188188
```
189189
Open the served URL to see a local version of the docs.
190190

docs/book.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[book]
2+
title = "PufferDrive"
3+
description = "High-throughput autonomous driving simulator built on PufferLib."
4+
authors = ["Emerge-Lab"]
5+
language = "en"
6+
src = "src"
7+
8+
[build]
9+
build-dir = "book"
10+
11+
[output.html]
12+
default-theme = "light"
13+
preferred-dark-theme = "navy"
14+
git-repository-url = "https://github.com/Emerge-Lab/PufferDrive"
15+
site-url = "/PufferDrive/"
16+
additional-css = ["theme/extra.css"]
17+
additional-js = ["theme/mathjax.js"]
18+
mathjax-support = true
19+
20+
[output.html.fold]
21+
enable = true
22+
level = 1
23+
24+
[output.html.search]
25+
enable = true
26+
limit-results = 30

docs/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/index.md renamed to docs/src/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# PufferDrive
22

3+
<p align="center">
4+
<a href="https://github.com/Emerge-Lab/PufferDrive/stargazers"><img src="https://img.shields.io/github/stars/Emerge-Lab/PufferDrive?style=social" alt="GitHub stars"></a>
5+
<a href="https://github.com/Emerge-Lab/PufferDrive/network/members"><img src="https://img.shields.io/github/forks/Emerge-Lab/PufferDrive?style=social" alt="GitHub forks"></a>
6+
<a href="https://github.com/Emerge-Lab/PufferDrive"><img src="https://img.shields.io/github/watchers/Emerge-Lab/PufferDrive?style=social" alt="GitHub watchers"></a>
7+
</p>
8+
39
<div class="hero">
410
<img src="images/pufferdrive.gif" alt="PufferDrive logo">
511
<div>
612
<p>PufferDrive is a high-throughput autonomous driving simulator built on <a href="https://puffer.ai">PufferLib</a>. Train and evaluate multi-agent driving policies with fast vectorized stepping, streamlined data conversion, and ready-made benchmarks.</p>
713
<div class="cta">
8-
<a class="primary" href="getting-started/">Start here: install & build</a>
14+
<a class="primary" href="getting-started.html">Start here: install & build</a>
915
<a href="#workflow">See the workflow</a>
1016
</div>
1117
</div>
1218
</div>
1319

1420
## Try it in your browser
1521

16-
<iframe src="assets/game.html" title="PufferDrive Demo" width="1280" height="720" style="border: none; display: block; margin: 2rem auto;"></iframe>
22+
<div class="video-embed">
23+
<iframe src="assets/game.html" title="PufferDrive Demo" style="border: none;"></iframe>
24+
</div>
1725

1826
<p style="text-align: center; color: #888; margin-top: 1rem;">
1927
Hold <strong>Left Shift</strong> and use arrow keys or <strong>WASD</strong> to control the vehicle. Hold <strong>space</strong> for first-person view and <strong>ctrl</strong> to see what your agent is seeing :)
@@ -40,19 +48,19 @@
4048
<div class="badge">Step 1</div>
4149
<h3>Install & Build</h3>
4250
<p>Set up the environment, install dependencies, and compile the native extensions.</p>
43-
<a href="getting-started/">Open guide</a>
51+
<a href="getting-started.html">Open guide</a>
4452
</div>
4553
<div class="step-card">
4654
<div class="badge">Step 2</div>
4755
<h3>Prepare Data</h3>
4856
<p>Download WOMD/GPUDrive datasets from Hugging Face and convert to map binaries.</p>
49-
<a href="data/">Open guide</a>
57+
<a href="data.html">Open guide</a>
5058
</div>
5159
<div class="step-card">
5260
<div class="badge">Step 3</div>
5361
<h3>Train & Evaluate</h3>
5462
<p>Train agents and evaluate them with WOSAC and human-replay benchmarks.</p>
55-
<a href="evaluation/">Open guide</a>
63+
<a href="evaluation.html">Open guide</a>
5664
</div>
5765
</div>
5866

docs/src/SUMMARY.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Summary
2+
3+
[Getting started](README.md)
4+
5+
# Documentation
6+
7+
- [Getting Started](getting-started.md)
8+
- [Training Agents](train.md)
9+
- [Interact with Agents](interact-with-agents.md)
10+
- [Simulator](simulator.md)
11+
- [Interactive Scenario Editor](scene-editor.md)
12+
- [Visualizer](visualizer.md)
13+
14+
# Data
15+
16+
- [Data Sources &amp; Preparation](data.md)
17+
18+
# Benchmarks
19+
20+
- [Evaluation Overview](evaluation.md)
21+
- [WOSAC](wosac.md)
22+
23+
# Blog
24+
25+
- [PufferDrive 2.0](pufferdrive-2.0.md)

0 commit comments

Comments
 (0)