Skip to content

Commit

Permalink
Add docs template.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Burbulla committed Nov 18, 2023
1 parent a4d5c96 commit 538ea48
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 0 deletions.
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 = source
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)
20 changes: 20 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## Steps to build documentation

1. Build and install package from source.
```bash
cd ./continuity/
pip install -e .
pip install sphinx sphinx_book_theme sphinx_copybutton
```

2. Generate documentation from your docstrings.
```bash
cd docs/
sphinx-apidoc -f -o ./source ../src/continuity
```
3. Build the documentation
```bash
make clean && make html
```
4. You can now view your documentation under `docs/build/html/index.html`.
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
myst-nb==0.13.2
Sphinx==4.1.2
sphinx-book-theme==0.3.2
sphinx-copybutton>=0.5.0
73 changes: 73 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys

# sys.path.insert(0, os.path.abspath('.'))
from pathlib import Path

# Add parent dir to known paths
p = Path(__file__).parents[2]
sys.path.insert(0, os.path.abspath(p))

# -- Project information -----------------------------------------------------

project = "Continuity"
copyright = "Samuel Burbulla 2023"
author = "Samuel Burbulla"

# The full version, including alpha/beta/rc tags
release = "0.1"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx_copybutton",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_book_theme"

html_title = "Continuity"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
10 changes: 10 additions & 0 deletions docs/source/continuity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Continuity
==========

Overview
--------

.. automodule:: continuity
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Installation
============

.. code-block::
git clone https://github.com/aai-institute/Continuity.git
cd Continuity
pip install -e .
16 changes: 16 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Continuity
==========

Mapping continuous functions with neural networks.

.. toctree::
:maxdepth: 2
:caption: Getting started

getting_started/installation

.. toctree::
:maxdepth: 1
:caption: Documentation

modules
7 changes: 7 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Modules
=======

.. toctree::
:maxdepth: 4

continuity

0 comments on commit 538ea48

Please sign in to comment.