Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue277 auto generate api documentation #280

Merged
merged 18 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__
.pytest_cache
*.pyc
data
docs/_build/
Pipfile.lock
projects.cfg
venv/
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ pytest-flask = "*"
"pytest-pep8" = "*"
swagger-tester = "*"
bumpversion = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
pipenv-to-requirements = "*"

[packages]
"e1839a8" = {editable = true, path = "."}
Expand Down
4 changes: 2 additions & 2 deletions autopep8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

if [ "$1" = "-i" ]; then
echo "Running autopep8 in in-place mode."
exec autopep8 -i -j0 -a -a -r annif tests *.py
exec autopep8 -i -j0 -a -a -r annif tests docs *.py
else
echo "Running autopep8 in diff mode. Use -i for in-place mode."
echo ""
exec autopep8 -d -a -a -r annif tests *.py
exec autopep8 -d -a -a -r annif tests docs *.py
fi
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
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)
65 changes: 65 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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:
# http://www.sphinx-doc.org/en/master/config

# -- 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 re
import sys
sys.path.insert(0, os.path.abspath('..'))


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

project = 'annif'
copyright = '2017, University Of Helsinki (The National Library Of Finland)'
author = 'Osma Suominen'

# Get version number from GitHub tag
release = re.sub(
'^v',
'',
os.popen('git describe --tags --abbrev=0').read().strip()
)
# The short X.Y version.
version = release


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

master_doc = 'index'

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

# 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 = ['_build', 'Thumbs.db', '.DS_Store']


# -- 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']
26 changes: 26 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. annif documentation master file, created by
sphinx-quickstart on Tue May 14 14:24:19 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to Annif's API documentation!
=====================================

See `installation instructions <https://github.com/NatLibFi/Annif/blob/master/README.md>`_ and `Wiki pages <https://github.com/NatLibFi/Annif/wiki>`_ in GitHub, and also http://annif.org/.

You are reading documentation for version |version|.


.. toctree::
:maxdepth: 3
:caption: Annif API Reference:

source/annif


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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
43 changes: 43 additions & 0 deletions docs/source/annif.analyzer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
annif.analyzer package
======================

annif.analyzer.analyzer module
------------------------------

.. automodule:: annif.analyzer.analyzer
:members:
:undoc-members:
:show-inheritance:

annif.analyzer.simple module
----------------------------

.. automodule:: annif.analyzer.simple
:members:
:undoc-members:
:show-inheritance:

annif.analyzer.snowball module
------------------------------

.. automodule:: annif.analyzer.snowball
:members:
:undoc-members:
:show-inheritance:

annif.analyzer.voikko module
----------------------------

.. automodule:: annif.analyzer.voikko
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: annif.analyzer
:members:
:undoc-members:
:show-inheritance:
83 changes: 83 additions & 0 deletions docs/source/annif.backend.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
annif.backend package
=====================

annif.backend.backend module
----------------------------

.. automodule:: annif.backend.backend
:members:
:undoc-members:
:show-inheritance:

annif.backend.dummy module
--------------------------

.. automodule:: annif.backend.dummy
:members:
:undoc-members:
:show-inheritance:

annif.backend.ensemble module
-----------------------------

.. automodule:: annif.backend.ensemble
:members:
:undoc-members:
:show-inheritance:

annif.backend.fasttext module
-----------------------------

.. automodule:: annif.backend.fasttext
:members:
:undoc-members:
:show-inheritance:

annif.backend.http module
-------------------------

.. automodule:: annif.backend.http
:members:
:undoc-members:
:show-inheritance:

annif.backend.mixins module
---------------------------

.. automodule:: annif.backend.mixins
:members:
:undoc-members:
:show-inheritance:

annif.backend.pav module
------------------------

.. automodule:: annif.backend.pav
:members:
:undoc-members:
:show-inheritance:

annif.backend.tfidf module
--------------------------

.. automodule:: annif.backend.tfidf
:members:
:undoc-members:
:show-inheritance:

annif.backend.vw\_multi module
------------------------------

.. automodule:: annif.backend.vw_multi
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: annif.backend
:members:
:undoc-members:
:show-inheritance:
60 changes: 60 additions & 0 deletions docs/source/annif.corpus.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
annif.corpus package
====================


annif.corpus.combine module
---------------------------

.. automodule:: annif.corpus.combine
:members:
:undoc-members:
:show-inheritance:

annif.corpus.convert module
---------------------------

.. automodule:: annif.corpus.convert
:members:
:undoc-members:
:show-inheritance:

annif.corpus.document module
----------------------------

.. automodule:: annif.corpus.document
:members:
:undoc-members:
:show-inheritance:

annif.corpus.skos module
------------------------

.. automodule:: annif.corpus.skos
:members:
:undoc-members:
:show-inheritance:

annif.corpus.subject module
---------------------------

.. automodule:: annif.corpus.subject
:members:
:undoc-members:
:show-inheritance:

annif.corpus.types module
-------------------------

.. automodule:: annif.corpus.types
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: annif.corpus
:members:
:undoc-members:
:show-inheritance:
Loading