Skip to content

Commit f5fc2f6

Browse files
Merge pull request #929 from stes/add-api-docs
Add API docs
2 parents 56ced5d + 9b9dc30 commit f5fc2f6

30 files changed

+311
-0
lines changed

.nojekyll

Whitespace-only changes.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ important DataJoint schema or records.
110110

111111
</details>
112112

113+
### API docs
114+
115+
The API documentation can be built using sphinx by running
116+
117+
``` bash
118+
pip install sphinx sphinx_rtd_theme
119+
(cd docs-api/sphinx && make html)
120+
```
121+
122+
Generated docs are written to `docs-api/docs/html/index.html`.
123+
More details in [docs-api/README.md](docs-api/README.md).
124+
113125
## Running Tests Locally
114126
<details>
115127
<summary>Click to expand details</summary>

docs-api/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/

docs-api/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Datajoint API docs
2+
3+
To generate the documentation, run
4+
5+
``` bash
6+
(cd sphinx && make html)
7+
```
8+
9+
Docs will be placed in the `docs/` folder.
10+
11+
## Editing the docs
12+
13+
All source files are in `sphinx/source`.
14+
Docs are currently structured as follows:
15+
16+
```
17+
sphinx/source/conf.py # Sphinx configuration file
18+
sphinx/source/index.rst # This is the docs front page
19+
sphinx/source/datajoint.*.rst # Docs for different modules
20+
```

docs-api/sphinx/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = ../docs
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs-api/sphinx/source/conf.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('../..'))
16+
17+
import datajoint
18+
19+
import sphinx_rtd_theme
20+
21+
22+
# -- Project information -----------------------------------------------------
23+
24+
project = 'DataJoint'
25+
copyright = '2021, datajoint.io'
26+
author = 'datajoint.io'
27+
28+
# The full version, including alpha/beta/rc tags
29+
release = datajoint.__version__
30+
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
# Add any Sphinx extension module names here, as strings. They can be
35+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
36+
# ones.
37+
extensions = [
38+
'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc'
39+
]
40+
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ['_templates']
43+
44+
# List of patterns, relative to source directory, that match files and
45+
# directories to ignore when looking for source files.
46+
# This pattern also affects html_static_path and html_extra_path.
47+
exclude_patterns = []
48+
49+
50+
# -- Options for HTML output -------------------------------------------------
51+
52+
# The theme to use for HTML and HTML Help pages. See the documentation for
53+
# a list of builtin themes.
54+
#
55+
html_theme = 'sphinx_rtd_theme'
56+
57+
# Add any paths that contain custom static files (such as style sheets) here,
58+
# relative to this directory. They are copied after the builtin static files,
59+
# so a file named "default.css" will overwrite the builtin "default.css".
60+
html_static_path = []
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
datajoint.admin module
2+
======================
3+
4+
.. automodule:: datajoint.admin
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
datajoint.attribute\_adapter module
2+
===================================
3+
4+
.. automodule:: datajoint.attribute_adapter
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
datajoint.autopopulate module
2+
=============================
3+
4+
.. automodule:: datajoint.autopopulate
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
datajoint.blob module
2+
=====================
3+
4+
.. automodule:: datajoint.blob
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)