Skip to content

Commit

Permalink
add sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Callidon committed Jan 3, 2020
1 parent 02df491 commit b9f1737
Show file tree
Hide file tree
Showing 14 changed files with 650 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Manipulate [OTTR Reasonable Ontology Templates](http://ottr.xyz/) in Python.
* [Nesting templates](http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#3_Nesting_templates)
* [Type checking](http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#4_Types)
* [Non blank](http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#5_NonBlank), [Optional](http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#6_Optionals_and_None) and [default values](http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#7_Default_values) for template parameters.
* *RDF and RDFS templates* from the [OTTR template library]([http://tpl.ottr.xyz/]) are loaded by default.
* *RDF and RDFS templates* from the [OTTR template library](http://tpl.ottr.xyz/) are loaded by default.

:wrench: **In development:**
* [Expansion modes](http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#8_Expansion_modes)
Expand Down
26 changes: 26 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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 = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Generate the package API first
apidoc:
@rm -f source/ottr.*
sphinx-apidoc -o ./source/ ../ottr
@rm -f source/modules.rst

.PHONY: help Makefile apidoc

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile apidoc
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
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=source
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
57 changes: 57 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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('.'))


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

project = 'ottr'
copyright = '2020, Thomas Minier'
author = 'Thomas Minier'

# The full version, including alpha/beta/rc tags
release = '0.1.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 = ['sphinx.ext.autodoc', 'sphinx.ext.githubpages']

# Add any paths that contain templates here, relative to this directory.
templates_path = []

# 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 = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- 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']
46 changes: 46 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Welcome to ottr's documentation!
================================

This library allows you to manipulate
`OTTR Reasonable Ontology Templates <http://ottr.xyz/>`_ in Python.

Reasonable Ontology Templates (OTTR) is a language for representing ontology modelling patterns,
and is designed to support interaction with OWL or RDF knowledge bases at a higher level of abstraction, using modelling patterns rather than OWL axioms or RDF triples. This includes:

* building knowledge bases by instantiating templates;
* communicating (presenting, transferring and visualising) the knowledge base as a set of template instances at different levels of abstraction; and
* securing and improving the quality and sustainability of the knowledge base via structural and semantic analysis of the templates used to construct the knowledge base.

You can learn more about OTTR on the `official website <http://ottr.xyz/>`_.

Supported features
------------------

* `Definition and execution of templates <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#2_Templates_and_Instances>`_ in the `stOTTR syntax <http://spec.ottr.xyz/stOTTR/0.1/>`_.
* `Nesting templates <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#3_Nesting_templates>`_.
* `Type checking <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#4_Types>`_.
* `Non blank <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#5_NonBlank>`_, `Optional <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#6_Optionals_and_None>`_ and `default values <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#7_Default_values>`_ for template parameters.
* *RDF and RDFS templates* from the `OTTR template library <http://tpl.ottr.xyz/>`_ are loaded by default.

In development
--------------

* `Expansion modes <http://spec.ottr.xyz/pOTTR/0.1/01-basics.html#8_Expansion_modes>`_.
* Support for `OWL templates <http://tpl.ottr.xyz/owl/>`_ from the template library.

Contents
--------
.. toctree::
:maxdepth: 2

quickstart
ottr



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

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

Submodules
----------

ottr.base.argument module
-------------------------

.. automodule:: ottr.base.argument
:members:
:undoc-members:
:show-inheritance:

ottr.base.base\_templates module
--------------------------------

.. automodule:: ottr.base.base_templates
:members:
:undoc-members:
:show-inheritance:

ottr.base.expansion module
--------------------------

.. automodule:: ottr.base.expansion
:members:
:undoc-members:
:show-inheritance:

ottr.base.template module
-------------------------

.. automodule:: ottr.base.template
:members:
:undoc-members:
:show-inheritance:

ottr.base.utils module
----------------------

.. automodule:: ottr.base.utils
:members:
:undoc-members:
:show-inheritance:


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

.. automodule:: ottr.base
:members:
:undoc-members:
:show-inheritance:
17 changes: 17 additions & 0 deletions docs/source/ottr.parsers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ottr.parsers package
====================

Subpackages
-----------

.. toctree::

ottr.parsers.stottr

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

.. automodule:: ottr.parsers
:members:
:undoc-members:
:show-inheritance:
30 changes: 30 additions & 0 deletions docs/source/ottr.parsers.stottr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ottr.parsers.stottr package
===========================

Submodules
----------

ottr.parsers.stottr.lexer module
--------------------------------

.. automodule:: ottr.parsers.stottr.lexer
:members:
:undoc-members:
:show-inheritance:

ottr.parsers.stottr.parser module
---------------------------------

.. automodule:: ottr.parsers.stottr.parser
:members:
:undoc-members:
:show-inheritance:


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

.. automodule:: ottr.parsers.stottr
:members:
:undoc-members:
:show-inheritance:
31 changes: 31 additions & 0 deletions docs/source/ottr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ottr package
============

Subpackages
-----------

.. toctree::

ottr.base
ottr.parsers
ottr.tpl

Submodules
----------

ottr.generator module
---------------------

.. automodule:: ottr.generator
:members:
:undoc-members:
:show-inheritance:


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

.. automodule:: ottr
:members:
:undoc-members:
:show-inheritance:
30 changes: 30 additions & 0 deletions docs/source/ottr.tpl.owl.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ottr.tpl.owl package
====================

Submodules
----------

ottr.tpl.owl.axiom module
-------------------------

.. automodule:: ottr.tpl.owl.axiom
:members:
:undoc-members:
:show-inheritance:

ottr.tpl.owl.utils module
-------------------------

.. automodule:: ottr.tpl.owl.utils
:members:
:undoc-members:
:show-inheritance:


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

.. automodule:: ottr.tpl.owl
:members:
:undoc-members:
:show-inheritance:
37 changes: 37 additions & 0 deletions docs/source/ottr.tpl.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ottr.tpl package
================

Subpackages
-----------

.. toctree::

ottr.tpl.owl

Submodules
----------

ottr.tpl.rdf module
-------------------

.. automodule:: ottr.tpl.rdf
:members:
:undoc-members:
:show-inheritance:

ottr.tpl.rdfs module
--------------------

.. automodule:: ottr.tpl.rdfs
:members:
:undoc-members:
:show-inheritance:


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

.. automodule:: ottr.tpl
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit b9f1737

Please sign in to comment.