Skip to content

Commit 4ef224e

Browse files
authored
Merge pull request #68 from rosette-api/RCB-522_python-documentation
RCB-522 python documentation
2 parents 439341f + 1749ee1 commit 4ef224e

File tree

9 files changed

+302
-0
lines changed

9 files changed

+302
-0
lines changed

docs/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.
5+
SPHINXOPTS =
6+
SPHINXBUILD = python3 -msphinx
7+
SPHINXPROJ = PythonBinding
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)

docs/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Generating documentation with Sphinx
2+
3+
The best tutorial for generating documentation can be found [here](http://gisellezeno.com/tutorials/sphinx-for-python-documentation.html)
4+
5+
Files in the source directory are generally static and should not need to be updated. If another python module is created in `../rosette`, then the source may need to be regenerated using
6+
7+
`sphinx-apidoc -f -o source/ ../rosette/`
8+
9+
This will overwrite the *.rst files, which may then require some editing to provide the desired look. Edits to date:
10+
1. index.rst: Changed the `Welcome ...` title to `Python Binding`
11+
1. index.rst: Added minor summary, "This is the API documentation for the Rosette API Python Binding. For examples and usage, please refer to our `API Guide <http://developer.rosette.com/api-guide>`_."
12+
1. conf.py: removed blank line at end of file
13+
1. conf.py: added rosette logo
14+
1. conf.py: blank project (let logo handle it)
15+
1. conf.py: added version (auto updated by publish)
16+
1. conf.py: added author
17+
1. conf.py: enabled `sys.path.insert(0, os.path.abspath('../..'))`
18+
19+
To change the logo, edit conf.py, `html_logo`
20+
21+
To generate the html run `make html`. The output will be written to `build/html`. This is the step that is run by the `publish.sh` script when publishing the Python binding. Note that the version, which is noted in `conf.py` is not displayed anywhere, but is updated during the publish phase.
22+
23+
You can view the generated html locally, by navigating to `docs/build/html` and opening `index.html`

docs/source/_static/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
### Place static sphinx files here if needed

docs/source/_templates/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Place sphinx templates here (if desired)
2+
3+
Default is alabaster

docs/source/conf.py

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Python Binding documentation build configuration file, created by
5+
# sphinx-quickstart on Fri Jul 28 09:16:12 2017.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
#
20+
import os
21+
import sys
22+
sys.path.insert(0, os.path.abspath('../..'))
23+
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = ['sphinx.ext.autodoc']
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# The suffix(es) of source filenames.
40+
# You can specify multiple suffix as a list of string:
41+
#
42+
# source_suffix = ['.rst', '.md']
43+
source_suffix = '.rst'
44+
45+
# The master toctree document.
46+
master_doc = 'index'
47+
48+
# General information about the project.
49+
project = ''
50+
copyright = '2017, Basis Technology'
51+
author = 'Basis Technology'
52+
53+
# The version info for the project you're documenting, acts as replacement for
54+
# |version| and |release|, also used in various other places throughout the
55+
# built documents.
56+
#
57+
# The short X.Y version.
58+
version = '1.7.0'
59+
# The full version, including alpha/beta/rc tags.
60+
release = '1.7.0'
61+
62+
# The language for content autogenerated by Sphinx. Refer to documentation
63+
# for a list of supported languages.
64+
#
65+
# This is also used if you do content translation via gettext catalogs.
66+
# Usually you set "language" from the command line for these cases.
67+
language = None
68+
69+
# List of patterns, relative to source directory, that match files and
70+
# directories to ignore when looking for source files.
71+
# This patterns also effect to html_static_path and html_extra_path
72+
exclude_patterns = []
73+
74+
# The name of the Pygments (syntax highlighting) style to use.
75+
pygments_style = 'sphinx'
76+
77+
# If true, `todo` and `todoList` produce output, else they produce nothing.
78+
todo_include_todos = False
79+
80+
81+
# -- Options for HTML output ----------------------------------------------
82+
83+
# The theme to use for HTML and HTML Help pages. See the documentation for
84+
# a list of builtin themes.
85+
#
86+
html_theme = 'alabaster'
87+
88+
# Theme options are theme-specific and customize the look and feel of a theme
89+
# further. For a list of options available for each theme, see the
90+
# documentation.
91+
#
92+
# html_theme_options = {}
93+
94+
# Add any paths that contain custom static files (such as style sheets) here,
95+
# relative to this directory. They are copied after the builtin static files,
96+
# so a file named "default.css" will overwrite the builtin "default.css".
97+
html_static_path = ['_static']
98+
html_logo = 'rosette-logo.svg'
99+
100+
# Custom sidebar templates, must be a dictionary that maps document names
101+
# to template names.
102+
#
103+
# This is required for the alabaster theme
104+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
105+
html_sidebars = {
106+
'**': [
107+
'about.html',
108+
'relations.html', # needs 'show_related': True theme option to display
109+
'searchbox.html',
110+
'donate.html',
111+
]
112+
}
113+
114+
115+
# -- Options for HTMLHelp output ------------------------------------------
116+
117+
# Output file base name for HTML help builder.
118+
htmlhelp_basename = 'PythonBindingdoc'
119+
120+
121+
# -- Options for LaTeX output ---------------------------------------------
122+
123+
latex_elements = {
124+
# The paper size ('letterpaper' or 'a4paper').
125+
#
126+
# 'papersize': 'letterpaper',
127+
128+
# The font size ('10pt', '11pt' or '12pt').
129+
#
130+
# 'pointsize': '10pt',
131+
132+
# Additional stuff for the LaTeX preamble.
133+
#
134+
# 'preamble': '',
135+
136+
# Latex figure (float) alignment
137+
#
138+
# 'figure_align': 'htbp',
139+
}
140+
141+
# Grouping the document tree into LaTeX files. List of tuples
142+
# (source start file, target name, title,
143+
# author, documentclass [howto, manual, or own class]).
144+
latex_documents = [
145+
(master_doc, 'PythonBinding.tex', 'Python Binding Documentation',
146+
'Basis Technology', 'manual'),
147+
]
148+
149+
150+
# -- Options for manual page output ---------------------------------------
151+
152+
# One entry per manual page. List of tuples
153+
# (source start file, name, description, authors, manual section).
154+
man_pages = [
155+
(master_doc, 'pythonbinding', 'Python Binding Documentation',
156+
[author], 1)
157+
]
158+
159+
160+
# -- Options for Texinfo output -------------------------------------------
161+
162+
# Grouping the document tree into Texinfo files. List of tuples
163+
# (source start file, target name, title, author,
164+
# dir menu entry, description, category)
165+
texinfo_documents = [
166+
(master_doc, 'PythonBinding', 'Python Binding Documentation',
167+
author, 'PythonBinding', 'One line description of project.',
168+
'Miscellaneous'),
169+
]

docs/source/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. Python Binding documentation master file, created by
2+
sphinx-quickstart on Fri Jul 28 09:16:12 2017.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
7+
Python Binding
8+
==========================================
9+
This is the API documentation for the Rosette API Python Binding. For examples and usage, please refer to our `API Guide <http://developer.rosette.com/api-guide>`_.
10+
11+
.. toctree::
12+
:maxdepth: 2
13+
:caption: Contents:
14+
15+
16+
17+
Indices and tables
18+
==================
19+
20+
* :ref:`genindex`
21+
* :ref:`modindex`
22+
* :ref:`search`

docs/source/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rosette
2+
=======
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
rosette

docs/source/rosette-logo.svg

Lines changed: 35 additions & 0 deletions
Loading

docs/source/rosette.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
rosette package
2+
===============
3+
4+
Submodules
5+
----------
6+
7+
rosette\.api module
8+
-------------------
9+
10+
.. automodule:: rosette.api
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
16+
Module contents
17+
---------------
18+
19+
.. automodule:: rosette
20+
:members:
21+
:undoc-members:
22+
:show-inheritance:

0 commit comments

Comments
 (0)