forked from GazzolaLab/MiV-OS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
262 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Documentation | ||
|
||
We use [`Sphinx`](https://www.sphinx-doc.org/en/master/) and [`ReadtheDocs`](https://readthedocs.org/) to organize our [documentation page](). | ||
|
||
In addition, we utilize the following extensions to enhance the documentation :coffee: | ||
- `numpydoc`: We favor [numpy documentation style](https://numpydoc.readthedocs.io/en/latest/format.html) for API documentation. | ||
- `myst_parser`: We like to write documentation and guidelines in `markdown` format. | ||
|
||
## Build documentation | ||
|
||
The `sphinx` is already initialized in `docs` directory. In order to build the documentation, you will need additional packages listed in `docs/requirements.txt`. | ||
|
||
```bash | ||
pip install sphinx sphinx_rtd_theme myst-parser numpydoc | ||
cd docs | ||
make clean | ||
make html | ||
``` | ||
|
||
Once the documentation building is done, open `docs/_build/html/index.html` to view. | ||
|
||
Use `make help` for other options. | ||
|
||
## User Guide | ||
|
||
User guidelines and tutorials are written in `.rst` or `.md` format. | ||
These files will be managed in `docs` directory. | ||
|
||
## API documentation | ||
|
||
The docstring for function or modules are automatically parsed using `sphinx`+`numpydoc`. | ||
Any inline function description, such as | ||
|
||
```py | ||
""" This is the form of a docstring. | ||
... description | ||
Attributes | ||
---------- | ||
x : type | ||
x description | ||
y : type | ||
y description | ||
""" | ||
``` | ||
|
||
will be parsed and displayed in API documentation. See `numpydoc` for more details. | ||
|
||
## ReadtheDocs | ||
|
||
`ReadtheDocs` runs `sphinx` internally and maintain the documentation website. We will always activate the `stable` and `latest` version, and few past-documentations will also be available for the support. | ||
|
||
@nmnaughton and @skim449 has access to the `ReadtheDocs` account. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# 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 | ||
|
||
# import sphinx_rtd_theme | ||
|
||
sys.path.insert(0, os.path.abspath("../")) | ||
|
||
from miv.version import VERSION | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = "Mind-in-Vitro MiV-OS" | ||
copyright = "2022, GazzolaLab" | ||
author = "Gazzola Lab" | ||
|
||
# The full version, including alpha/beta/rc tags | ||
release = VERSION | ||
|
||
# -- 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.autosectionlabel", | ||
"sphinx_autodoc_typehints", | ||
#'sphinx.ext.napoleon', | ||
"sphinx.ext.viewcode", | ||
"sphinx_rtd_theme", | ||
"sphinx.ext.mathjax", | ||
"numpydoc", | ||
"myst_parser", | ||
] | ||
|
||
myst_enable_extensions = [ | ||
"amsmath", | ||
"colon_fence", | ||
"deflist", | ||
"dollarmath", | ||
"fieldlist", | ||
"html_admonition", | ||
"html_image", | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
|
||
# 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 = [ | ||
"README.md", # File reserved to explain how documentationing works. | ||
] | ||
|
||
autodoc_default_flags = [ | ||
"members", | ||
"private-members", | ||
"special-members", | ||
"show-inheritance", | ||
] | ||
autosectionlabel_prefix_document = True | ||
|
||
source_parsers = {} | ||
source_suffix = [".rst", ".md"] | ||
|
||
master_doc = "index" | ||
# -- 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_theme_options = { | ||
"repository_url": "https://github.com/GazzolaLab/MiV-OS", | ||
"use_repository_button": True, | ||
} | ||
html_title = "MiV-OS" | ||
# html_logo = "" | ||
# pygments_style = "sphinx" | ||
|
||
# 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"] | ||
html_css_files = ["css/*", "css/logo.css"] | ||
|
||
# -- Options for numpydoc --------------------------------------------------- | ||
numpydoc_show_class_members = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
***************** | ||
Tutorial Examples | ||
***************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. MiV-OS documentation master file, created by | ||
sphinx-quickstart on Thu Mar 24 23:35:49 2022. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to MiV-OS's documentation! | ||
================================ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
guide/tutorials | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=. | ||
set BUILDDIR=_build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# File: docs/requirements.txt | ||
|
||
-r ../requirements.txt | ||
docutils | ||
myst-parser | ||
numpydoc | ||
readthedocs-sphinx-search==0.1.1 | ||
sphinx==4.4.0 | ||
sphinx-autodoc-typehints | ||
sphinx-book-theme | ||
sphinx_rtd_theme==1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters