Skip to content

Commit

Permalink
Merge pull request #536 from DDMAL/sphinx-docs
Browse files Browse the repository at this point in the history
Added: Sphinx docs
  • Loading branch information
deepio authored Oct 11, 2020
2 parents d6eeb69 + 510f82b commit 9552bcf
Show file tree
Hide file tree
Showing 36 changed files with 1,552 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ rodan/static/
*.log

env/
docs/_build
docs/*
*.egg-info/
.mypy_cache/
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if: "(branch = master AND type IN (pull_request, cron)) OR (branch = develop)"
if: "(branch = master AND type IN (pull_request, cron)) OR (branch = develop) OR (banch = develop AND type IN (pull_request, cron))"
language: python
virtualenv:
system_site_packages: true
Expand Down Expand Up @@ -30,6 +30,8 @@ before_install:
- export DJANGO_SECRET_KEY=local
- export DJANGO_ALLOWED_HOSTS=*
- export DJANGO_MEDIA_ROOT=./data/
- export DJANGO_ACCESS_LOG=./rodan.log
- export DJANGO_DEBUG_LOG=./database.log
- export CELERY_JOB_QUEUE=None
- export POSTGRES_HOST=localhost
- export POSTGRES_PORT=5432
Expand Down
20 changes: 20 additions & 0 deletions docs/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 = .
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)
19 changes: 19 additions & 0 deletions docs/api/inputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Input

.. warning::
This documentation is incomplete, please contribute to make it better!

## Resource Input

.. automodule:: rodan.views.input
:members:

## Input Port

.. automodule:: rodan.views.inputport
:members:

## Input Port Type

.. automodule:: rodan.views.inputporttype
:members:
19 changes: 19 additions & 0 deletions docs/api/jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Jobs

.. warning::
This documentation is incomplete, please contribute to make it better!

## Individual Jobs

.. automodule:: rodan.views.job
:members:

## Run Jobs

.. automodule:: rodan.views.runjob
:members:

## Connecting Jobs

.. automodule:: rodan.views.connection
:members:
19 changes: 19 additions & 0 deletions docs/api/outputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Outputs

.. warning::
This documentation is incomplete, please contribute to make it better!

## Resource Output

.. automodule:: rodan.views.output
:members:

## Output Port

.. automodule:: rodan.views.outputport
:members:

## Output Port Type

.. automodule:: rodan.views.outputporttype
:members:
23 changes: 23 additions & 0 deletions docs/api/projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Projects

.. warning::
This documentation is incomplete, please contribute to make it better!

## Projects API

.. automodule:: rodan.views.project
:members:

## User

.. automodule:: rodan.views.user
:members:

.. automodule:: rodan.views.userpreference
:members:

## Authentication

.. automodule:: rodan.views.auth
:members:
:inherited-members:
24 changes: 24 additions & 0 deletions docs/api/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Resources

.. warning::
This documentation is incomplete, please contribute to make it better!

## Individual Resource

.. automodule:: rodan.views.resource
:members:

## Resource Label

.. automodule:: rodan.views.resourcelabel
:members:

## Resource Type

.. automodule:: rodan.views.resourcetype
:members:

## Resource List

.. automodule:: rodan.views.resourcelist
:members:
29 changes: 29 additions & 0 deletions docs/api/workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Workflows

.. warning::
This documentation is incomplete, please contribute to make it better!

## Individual Workflow

.. automodule:: rodan.views.workflow
:members:

## Workflow Job

.. automodule:: rodan.views.workflowjob
:members:

## Workflow Job Coordinate Set

.. automodule:: rodan.views.workflowjobcoordinateset
:members:

## Workflow Job Group

.. automodule:: rodan.views.workflowjobgroup
:members:

## Workflow Job Group Coordinate Set

.. automodule:: rodan.views.workflowjobgroupcoordinateset
:members:
71 changes: 71 additions & 0 deletions docs/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('.'))
# sys.path.append(os.path.abspath('../..'))
# sys.path.append(os.path.abspath('..'))

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rodan.settings')

# Rodan Initialization
os.environ["CELERY_JOB_QUEUE"] = "Docs"
os.environ["DJANGO_ALLOWED_HOSTS"] = "*"
os.environ["DJANGO_SECRET_KEY"] = "*"
os.environ["DJANGO_ACCESS_LOG"] = "*"
os.environ["DJANGO_DEBUG_LOG"] = "*"

# Setup Django
import django
django.setup()


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

project = 'Rodan'
copyright = '2020, Distributed Digital Music Archives & Libraries Lab'
author = 'Andrew Hankinson'

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


# -- 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 = ['m2r', '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']
autosectionlabel_prefix_document = True
autoclass_content = "both"
source_suffix = ['.rst', '.md']

# -- 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 = 'alabaster'

# 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']
5 changes: 5 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Docker

The entire project is available as docker images from docker hub.

Please login to docker and pull the images instead of trying to install Rodan from scratch.
28 changes: 28 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. rodan documentation master file, created by
sphinx-quickstart on Wed Jul 22 13:07:49 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

.. mdinclude:: ../README.md

.. toctree::
:maxdepth: 2
:caption: Administration:

management
docker

.. toctree::
:maxdepth: 2
:caption: API Views
:glob:

api/*

.. toctree::
:maxdepth: 2
:caption: Django Models
:glob:

models/*

35 changes: 35 additions & 0 deletions docs/make.bat
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.http://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
11 changes: 11 additions & 0 deletions docs/management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Database Management
These are commands which help you manage the database.
For up-to-date information, use the `--help` flag on these commands

## Custom Commands

.. autoclass:: rodan.management.commands.alter_rodan_job.Command
:members:

.. autoclass:: rodan.management.commands.alter_resource_type.Command
:members:
3 changes: 3 additions & 0 deletions docs/models/connections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Connections
.. automodule:: rodan.models.connection
:members:
9 changes: 9 additions & 0 deletions docs/models/inputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Inputs
.. automodule:: rodan.models.input
:members:

.. automodule:: rodan.models.inputport
:members:

.. automodule:: rodan.models.inputporttype
:members:
6 changes: 6 additions & 0 deletions docs/models/jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Jobs
.. automodule:: rodan.models.job
:members:

.. automodule:: rodan.models.runjob
:members:
9 changes: 9 additions & 0 deletions docs/models/outputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Outputs
.. automodule:: rodan.models.output
:members:

.. automodule:: rodan.models.outputport
:members:

.. automodule:: rodan.models.outputporttype
:members:
3 changes: 3 additions & 0 deletions docs/models/projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Projects
.. automodule:: rodan.models.project
:members:
12 changes: 12 additions & 0 deletions docs/models/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Resources
.. automodule:: rodan.models.resource
:members:

.. automodule:: rodan.models.resourcetype
:members:

.. automodule:: rodan.models.resourcelabel
:members:

.. automodule:: rodan.models.resourcelist
:members:
Loading

0 comments on commit 9552bcf

Please sign in to comment.