Skip to content

Commit 9324aed

Browse files
committed
Adding doc building via readthedocs
1 parent 8ef50de commit 9324aed

File tree

11 files changed

+380
-0
lines changed

11 files changed

+380
-0
lines changed

.bumpversion.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ replace = __version__ = '{new_version}'
1010

1111
[bumpversion:file:.bumpversion.cfg]
1212
search = current_version = {current_version}
13+
14+
[bumpversion:file:docs/conf.py]
15+
search = release = '{current_version}'
16+
replace = release = '{new_version}'

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
# Optionally set requirements required to build your docs
13+
python:
14+
install:
15+
- requirements: docs/requirements.txt
16+
- requirements: requirements-test.txt

CONTRIBUTING.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Contributing to pygml
2+
3+
We welcome contributions to pygml, in the form of issues, bug fixes, documentation or suggestions for enhancements. This document sets out our guidelines and best practices for such contributions.
4+
5+
It's based on the [Contributing to pygeoapi](https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md) guide which is based on the [Contributing to Open Source Projects
6+
Guide](https://contribution-guide-org.readthedocs.io/).
7+
8+
pygml has the following modes of contribution:
9+
10+
- GitHub Commit Access
11+
- GitHub Pull Requests
12+
13+
## Code of Conduct
14+
15+
Contributors to this project are expected to act respectfully toward others in accordance with the [OSGeo Code of Conduct](https://www.osgeo.org/code_of_conduct).
16+
17+
## Submitting Bugs
18+
19+
### Due Diligence
20+
21+
Before submitting a bug, please do the following:
22+
23+
* Perform __basic troubleshooting__ steps:
24+
25+
* __Make sure you're on the latest version.__ If you're not on the most
26+
recent version, your problem may have been solved already! Upgrading is
27+
always the best first step.
28+
* [__Search the issue
29+
tracker__](https://github.com/geopython/pygml/issues)
30+
to make sure it's not a known issue.
31+
32+
### What to put in your bug report
33+
34+
Make sure your report gets the attention it deserves: bug reports with missing information may be ignored or punted back to you, delaying a fix. The below constitutes a bare minimum; more info is almost always better:
35+
36+
* __What version of Python are you using?__ For example, are you using Python 2.7, Python 3.7, PyPy 2.0?
37+
* __What operating system are you using?__ Windows (7, 8, 10, 32-bit, 64-bit), Mac OS X, (10.7.4, 10.9.0), GNU/Linux (which distribution, which version?) Again, more detail is better.
38+
* __Which version or versions of the software are you using?__ Ideally, you've followed the advice above and are on the latest version, but please confirm this.
39+
* __How can the we recreate your problem?__ Imagine that we have never used pygml before and have downloaded it for the first time. Exactly what steps do we need to take to reproduce your problem?
40+
41+
## Contributions and Licensing
42+
43+
### Contributor License Agreement
44+
45+
Your contribution will be under our [license](https://github.com/geopython/pygml/blob/main/LICENSE) as per [GitHub's terms of service](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license).
46+
47+
### GitHub Commit Access
48+
49+
* Proposals to provide developers with GitHub commit access shall be raised on the pygml [discussions page](https://github.com/geopython/pygml/discussions). Committers shall be added by the project admin.
50+
* Removal of commit access shall be handled in the same manner.
51+
52+
### GitHub Pull Requests
53+
54+
* Pull requests may include copyright in the source code header by the contributor if the contribution is significant or the contributor wants to claim copyright on their contribution.
55+
* All contributors shall be listed at https://github.com/geopython/pygml/graphs/contributors
56+
* Unclaimed copyright, by default, is assigned to the main copyright holders as specified in https://github.com/geopython/pygml/blob/main/LICENSE
57+
58+
### Version Control Branching
59+
60+
* Always __make a new branch__ for your work, no matter how small. This makes it easy for others to take just that one set of changes from your repository, in case you have multiple unrelated changes floating around.
61+
62+
* __Don't submit unrelated changes in the same branch/pull request!__ If it is not possible to review your changes quickly and easily, we may reject your request.
63+
64+
* __Base your new branch off of the appropriate branch__ on the main repository:
65+
66+
* In general the released version of pygml is based on the ``main`` (default) branch whereas development work is done under other non-default branches. Unless you are sure that your issue affects a non-default branch, __base your branch off the ``main`` one__.
67+
68+
* Note that depending on how long it takes for the dev team to merge your
69+
patch, the copy of ``main`` you worked off of may get out of date!
70+
* If you find yourself 'bumping' a pull request that's been sidelined for a while, __make sure you rebase or merge to latest ``main``__ to ensure a speedier resolution.
71+
72+
### Documentation
73+
74+
* documentation is managed in `docs/`, in reStructuredText format
75+
* [Sphinx](https://www.sphinx-doc.org) is used to generate the documentation
76+
* See the [reStructuredText Primer](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html) on rST markup and syntax
77+
78+
79+
### Code Formatting
80+
81+
* __Please follow the coding conventions and style used in the pygml repository.__
82+
* pygml follows the [PEP-8](http://www.python.org/dev/peps/pep-0008/) guidelines
83+
* 80 characters
84+
* spaces, not tabs
85+
* pygml, instead of PyGML, pyGml, etc.
86+
87+
## Suggesting Enhancements
88+
89+
We welcome suggestions for enhancements, but reserve the right to reject them if they do not follow future plans for pygml.

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api

docs/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
import os
16+
import sys
17+
sys.path.insert(0, os.path.abspath('..'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = 'pygml'
23+
copyright = '2021, Fabian Schindler'
24+
author = 'Fabian Schindler'
25+
26+
# The short X.Y version
27+
version = ''
28+
# The full version, including alpha/beta/rc tags
29+
release = '0.1.0'
30+
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
# If your documentation needs a minimal Sphinx version, state it here.
35+
#
36+
# needs_sphinx = '1.0'
37+
38+
# Add any Sphinx extension module names here, as strings. They can be
39+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40+
# ones.
41+
extensions = [
42+
'sphinx.ext.autodoc',
43+
'sphinx.ext.intersphinx',
44+
'sphinxcontrib.apidoc',
45+
'm2r2',
46+
]
47+
48+
# Add any paths that contain templates here, relative to this directory.
49+
templates_path = ['_templates']
50+
51+
# The suffix(es) of source filenames.
52+
# You can specify multiple suffix as a list of string:
53+
#
54+
# source_suffix = ['.rst', '.md']
55+
source_suffix = '.rst'
56+
57+
# The master toctree document.
58+
master_doc = 'index'
59+
60+
# The language for content autogenerated by Sphinx. Refer to documentation
61+
# for a list of supported languages.
62+
#
63+
# This is also used if you do content translation via gettext catalogs.
64+
# Usually you set "language" from the command line for these cases.
65+
language = None
66+
67+
# List of patterns, relative to source directory, that match files and
68+
# directories to ignore when looking for source files.
69+
# This pattern also affects html_static_path and html_extra_path.
70+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
71+
72+
# The name of the Pygments (syntax highlighting) style to use.
73+
pygments_style = None
74+
75+
76+
# -- Options for HTML output -------------------------------------------------
77+
78+
# The theme to use for HTML and HTML Help pages. See the documentation for
79+
# a list of builtin themes.
80+
#
81+
html_theme = 'alabaster'
82+
83+
# Theme options are theme-specific and customize the look and feel of a theme
84+
# further. For a list of options available for each theme, see the
85+
# documentation.
86+
#
87+
# html_theme_options = {}
88+
89+
# Add any paths that contain custom static files (such as style sheets) here,
90+
# relative to this directory. They are copied after the builtin static files,
91+
# so a file named "default.css" will overwrite the builtin "default.css".
92+
html_static_path = ['_static']
93+
94+
# Custom sidebar templates, must be a dictionary that maps document names
95+
# to template names.
96+
#
97+
# The default sidebars (for documents that don't match any pattern) are
98+
# defined by theme itself. Builtin themes are using these templates by
99+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
100+
# 'searchbox.html']``.
101+
#
102+
# html_sidebars = {}
103+
104+
105+
# -- Options for HTMLHelp output ---------------------------------------------
106+
107+
# Output file base name for HTML help builder.
108+
htmlhelp_basename = 'pygmldoc'
109+
110+
111+
# -- Options for LaTeX output ------------------------------------------------
112+
113+
latex_elements = {
114+
# The paper size ('letterpaper' or 'a4paper').
115+
#
116+
# 'papersize': 'letterpaper',
117+
118+
# The font size ('10pt', '11pt' or '12pt').
119+
#
120+
# 'pointsize': '10pt',
121+
122+
# Additional stuff for the LaTeX preamble.
123+
#
124+
# 'preamble': '',
125+
126+
# Latex figure (float) alignment
127+
#
128+
# 'figure_align': 'htbp',
129+
}
130+
131+
# Grouping the document tree into LaTeX files. List of tuples
132+
# (source start file, target name, title,
133+
# author, documentclass [howto, manual, or own class]).
134+
latex_documents = [
135+
(master_doc, 'pygml.tex', 'pygml Documentation',
136+
'Fabian Schindler', 'manual'),
137+
]
138+
139+
140+
# -- Options for manual page output ------------------------------------------
141+
142+
# One entry per manual page. List of tuples
143+
# (source start file, name, description, authors, manual section).
144+
man_pages = [
145+
(master_doc, 'pygml', 'pygml Documentation',
146+
[author], 1)
147+
]
148+
149+
150+
# -- Options for Texinfo output ----------------------------------------------
151+
152+
# Grouping the document tree into Texinfo files. List of tuples
153+
# (source start file, target name, title, author,
154+
# dir menu entry, description, category)
155+
texinfo_documents = [
156+
(master_doc, 'pygml', 'pygml Documentation',
157+
author, 'pygml', 'One line description of project.',
158+
'Miscellaneous'),
159+
]
160+
161+
162+
# -- Options for Epub output -------------------------------------------------
163+
164+
# Bibliographic Dublin Core info.
165+
epub_title = project
166+
167+
# The unique identifier of the text. This can be a ISBN number
168+
# or the project homepage.
169+
#
170+
# epub_identifier = ''
171+
172+
# A unique identification for the text.
173+
#
174+
# epub_uid = ''
175+
176+
# A list of files that should not be packed into the epub file.
177+
epub_exclude_files = ['search.html']
178+
179+
180+
# -- Extension configuration -------------------------------------------------
181+
182+
183+
intersphinx_mapping = {
184+
'python': ('https://python.readthedocs.org/en/latest/', None),
185+
}
186+
187+
# apidoc configs:
188+
apidoc_module_dir = '../pygml'
189+
apidoc_output_dir = 'api'
190+
# apidoc_excluded_paths = ['tests']
191+
# apidoc_separate_modules = True
192+
# apidoc_module_first = True

docs/contributing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. mdinclude:: ../CONTRIBUTING.md

docs/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. mdinclude:: ../README.md
2+
3+
.. toctree::
4+
:maxdepth: 2
5+
:caption: Contents:
6+
7+
license
8+
contributing
9+
api/modules
10+
11+
Indices and tables
12+
==================
13+
14+
* :ref:`genindex`
15+
* :ref:`modindex`
16+
* :ref:`search`

docs/license.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
License
2+
=======
3+
4+
.. include:: ../LICENSE
5+
:literal:

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)