Skip to content

Commit

Permalink
Add Metaworld documentation website (#438)
Browse files Browse the repository at this point in the history
Co-authored-by: Reggie <[email protected]>
  • Loading branch information
mgoulao and reginald-mclean authored Aug 9, 2023
1 parent 15f269b commit d155d00
Show file tree
Hide file tree
Showing 17 changed files with 818 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Deploy Docs
on:
push:
branches: [master]

permissions:
contents: write

jobs:
docs:
name: Generate Website
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install docs dependencies
run: pip install -r docs/requirements.txt

- name: Install Metaworld
run: pip install .

- name: Build
run: sphinx-build -b dirhtml -v docs _build

- name: Move 404
run: mv _build/404/index.html _build/404.html

- name: Update 404 links
run: python docs/_scripts/move_404.py _build/404.html

- name: Remove .doctrees
run: rm -r _build/.doctrees

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
__pycache__
.vscode/
build/
_build/
7 changes: 7 additions & 0 deletions docs/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
hide-toc: true
---

# 404 - Page Not Found

## The requested page could not be found.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Metaworld documentation

This directory contains the documentation for Metaworld.

For more information about how to contribute to the documentation go to our [CONTRIBUTING.md](https://github.com/Farama-Foundation/Celshast/blob/main/CONTRIBUTING.md)
14 changes: 14 additions & 0 deletions docs/_scripts/move_404.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys

if __name__ == "__main__":
if len(sys.argv) < 2:
print("Provide a path")
filePath = sys.argv[1]

with open(filePath, "r+") as fp:
content = fp.read()
content = content.replace('href="../', 'href="/').replace('src="../', 'src="/')
fp.seek(0)
fp.truncate()

fp.write(content)
Binary file added docs/_static/img/PROJECT-github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 changes: 115 additions & 0 deletions docs/_static/img/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions docs/_static/img/metaworld_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d155d00

Please sign in to comment.