Skip to content

Commit 8ff6555

Browse files
Feature/autogenerate api doc (#147)
* initial commit with generate-doc.sh script and generated documentation, added pdoc3 dependency * fixed import errors due to missing SECRETS_FOR_DYNACONF environment value, updated doc, force/overwrite if documentation exists * moved pdoc3 dependency from dependencies to dev-dependencies * removed generated doc * add api-documentation (pdoc3 target directory) to .gitignore * switch to sphinx which supports better typehints notation * remove module path prefix from methods name * add support for typehints * remove autogenerated files * ignore autogenerated files * fixed typo in .gitignore * added empty _static folder to avoid warning on build * initial commit with generate-doc.sh script and generated documentation, added pdoc3 dependency * fixed import errors due to missing SECRETS_FOR_DYNACONF environment value, updated doc, force/overwrite if documentation exists * moved pdoc3 dependency from dependencies to dev-dependencies * removed generated doc * switch to sphinx which supports better typehints notation * remove autogenerated files * remove gui browser documentation open, use /bin/sh instead of /bin/bash * remove windows/dos documentation generation make, drop windows/dos support Co-authored-by: Giacomo Leidi <[email protected]>
1 parent 529f838 commit 8ff6555

File tree

8 files changed

+671
-120
lines changed

8 files changed

+671
-120
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,9 @@ docker-image.tar.gz
184184

185185
# test run script
186186
test_run.sh
187+
188+
# directory where sphinx documents resides
189+
api_documentation/source/*
190+
!api_documentation/source/conf.py
191+
!api_documentation/source/index.rst
192+
!api_documentation/source/_static/

api_documentation/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 = build
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)

api_documentation/source/_static/.keepme

Whitespace-only changes.

api_documentation/source/conf.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = "mobilizon-reshare"
21+
copyright = "2022, -"
22+
author = "-"
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# Add any Sphinx extension module names here, as strings. They can be
28+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
29+
# ones.
30+
extensions = ["sphinxcontrib.napoleon", "sphinx_autodoc_typehints"]
31+
32+
# Add any paths that contain templates here, relative to this directory.
33+
templates_path = ["_templates"]
34+
35+
# List of patterns, relative to source directory, that match files and
36+
# directories to ignore when looking for source files.
37+
# This pattern also affects html_static_path and html_extra_path.
38+
exclude_patterns = []
39+
40+
41+
# -- Options for HTML output -------------------------------------------------
42+
43+
# The theme to use for HTML and HTML Help pages. See the documentation for
44+
# a list of builtin themes.
45+
#
46+
html_theme = "sphinx_material"
47+
48+
# Add any paths that contain custom static files (such as style sheets) here,
49+
# relative to this directory. They are copied after the builtin static files,
50+
# so a file named "default.css" will overwrite the builtin "default.css".
51+
html_static_path = ["_static"]
52+
53+
# disable full module path in methods list
54+
add_module_names = False

api_documentation/source/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. mobilizon-reshare documentation master file, created by
2+
sphinx-quickstart on Mon Feb 21 12:57:17 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to mobilizon-reshare's documentation!
7+
=============================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
Indices and tables
16+
==================
17+
18+
* :ref:`genindex`
19+
* :ref:`modindex`
20+
* :ref:`search`

0 commit comments

Comments
 (0)