Skip to content

Commit

Permalink
add first version of sphinx docs
Browse files Browse the repository at this point in the history
* cli reference using sphinx-click
* modules docs using sphinx-autodoc
  * only document relevant modules (and leave out click stuff)
    * synadm.cli.APIHelper
    * synadm.api.*
  • Loading branch information
JOJ0 committed Apr 25, 2021
1 parent eb49bc7 commit 2313f75
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 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 = doc/source
BUILDDIR = doc/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)
71 changes: 71 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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('../synadm/../'))


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

project = 'synadm'
copyright = '2021, Johannes Tiefenbacher'
author = 'Johannes Tiefenbacher'

# The short X.Y version
version = '0.29'

# The full version, including alpha/beta/rc tags
release = '0.29'


# -- 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.napoleon',
'sphinx_click'
]

# 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_rtd_theme'

# 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']


# -- Extension configuration -------------------------------------------------
22 changes: 22 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. synadm documentation master file, created by
sphinx-quickstart on Thu Mar 4 09:29:20 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to synadm's documentation!
==================================

.. toctree::
:maxdepth: 2
:caption: Contents:

index_cli_reference
index_modules


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
14 changes: 14 additions & 0 deletions doc/source/index_cli_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Command Line Reference
======================

.. toctree::
:maxdepth: 1
:caption: Contents:

synadm.cli.root
synadm.cli.config
synadm.cli.user
synadm.cli.room
synadm.cli.media
synadm.cli.history
synadm.cli.group
9 changes: 9 additions & 0 deletions doc/source/index_modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Modules
=======

.. toctree::
:maxdepth: 2
:caption: Contents:

synadm.module.cli
synadm.module
6 changes: 6 additions & 0 deletions doc/source/synadm.cli.group.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Subcommand Group
================

.. click:: synadm.cli.group:group
:prog: synadm group
:nested: full
6 changes: 6 additions & 0 deletions doc/source/synadm.cli.history.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Subcommand History
==================

.. click:: synadm.cli.history:history
:prog: synadm history
:nested: full
6 changes: 6 additions & 0 deletions doc/source/synadm.cli.media.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Subcommand Media
================

.. click:: synadm.cli.media:media
:prog: synadm media
:nested: full
6 changes: 6 additions & 0 deletions doc/source/synadm.cli.room.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Subcommand Room
===============

.. click:: synadm.cli.room:room
:prog: synadm room
:nested: full
6 changes: 6 additions & 0 deletions doc/source/synadm.cli.root.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Main Command
============

.. click:: synadm.cli:root
:prog: synadm
:nested: short
6 changes: 6 additions & 0 deletions doc/source/synadm.cli.user.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Subcommand Config
=================

.. click:: synadm.cli.user:user
:prog: synadm user
:nested: full
7 changes: 7 additions & 0 deletions doc/source/synadm.module.cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Synadm CLI Module
=================

.. automodule:: synadm.cli
:members: APIHelper
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions doc/source/synadm.module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Synadm Module
=============

.. automodule:: synadm.api
:members:
:undoc-members:
:show-inheritance:

0 comments on commit 2313f75

Please sign in to comment.