Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruilong Li committed Sep 24, 2023
1 parent f25b84d commit a5d0b1c
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docs
on:
push:
branches: [main, compile]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install dependencies
run: |
pip install -r docs/requirements.txt
pip install torch==2.0.0 --index-url https://download.pytorch.org/whl/cpu
BUILD_NO_CUDA=1 pip install .
- name: Sphinx build
# fail on warnings: "-W --keep-going"
run: |
sphinx-build docs/source _build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
# cname: ...
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)
7 changes: 7 additions & 0 deletions docs/source/apis/proj.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Projection
===================================

.. currentmodule:: diff_rast

.. autoclass:: ProjectGaussians
:members:
7 changes: 7 additions & 0 deletions docs/source/apis/rasterize.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Rasterization
===================================

.. currentmodule:: diff_rast

.. autoclass:: RasterizeGaussians
:members:
42 changes: 42 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
__version__ = None
exec(open("../../diff_rast/version.py", "r").read())

# -- Project information

project = "diff_rast"
copyright = "2023, Vickie"
author = "Vickie"

release = __version__

# -- General configuration

extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.duration",
"sphinx.ext.doctest",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
}
intersphinx_disabled_domains = ["std"]

templates_path = ["_templates"]

# -- Options for HTML output
html_theme = "furo"

# Ignore >>> when copying code
copybutton_prompt_text = r">>> |\.\.\. "
copybutton_prompt_is_regexp = True

# -- Options for EPUB output
epub_show_urls = "footnote"

# typehints
autodoc_typehints = "description"
13 changes: 13 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DiffRast Documentation
===================================


Links:
-------------

.. toctree::
:glob:
:maxdepth: 1
:caption: Python API

apis/*
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def get_extensions():
download_url=f"{URL}/archive/{__version__}.tar.gz",
python_requires=">=3.7",
install_requires=[
"jaxtyping",
"rich>=12",
"torch",
"typing_extensions; python_version<'3.8'",
Expand Down

0 comments on commit a5d0b1c

Please sign in to comment.