Skip to content

Commit 48e0d65

Browse files
Merge pull request #864 from adamtheturtle/sphinx
Add empty sphinx documentation
2 parents 4089157 + 437f400 commit 48e0d65

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
SHELL := /bin/bash -euxo pipefail
22

3+
# Treat Sphinx warnings as errors
4+
SPHINXOPTS := -W
5+
36
.PHONY: lint
47
lint:
58
check-manifest .
@@ -41,3 +44,13 @@ fix-lint:
4144
--exclude src/vws/_version.py \
4245
.
4346
isort --recursive --apply
47+
48+
.PHONY: docs
49+
docs:
50+
make -C docs clean html SPHINXOPTS=$(SPHINXOPTS)
51+
52+
.PHONY: open-docs
53+
open-docs:
54+
xdg-open docs/build/html/index.html >/dev/null 2>&1 || \
55+
open docs/build/html/index.html >/dev/null 2>&1 || \
56+
echo "Requires 'xdg-open' or 'open' but neither is available."

docs/source/conf.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Configuration for Sphinx.
5+
"""
6+
7+
# pylint: disable=invalid-name
8+
9+
import os
10+
import sys
11+
12+
import vws
13+
14+
sys.path.insert(0, os.path.abspath('.'))
15+
16+
extensions = [
17+
'sphinx.ext.autodoc',
18+
'sphinx.ext.intersphinx',
19+
'sphinx.ext.napoleon',
20+
]
21+
22+
templates_path = ['_templates']
23+
source_suffix = '.rst'
24+
master_doc = 'index'
25+
26+
project = 'VWS Python'
27+
copyright = '2018, Adam Dangoor' # pylint: disable=redefined-builtin
28+
author = 'Adam Dangoor'
29+
30+
# The version info for the project you're documenting, acts as replacement for
31+
# |version| and |release|, also used in various other places throughout the
32+
# built documents.
33+
version = vws.__version__
34+
release = version.split('+')[0]
35+
36+
language = None
37+
38+
# The name of the syntax highlighting style to use.
39+
pygments_style = 'sphinx'
40+
html_theme = 'alabaster'
41+
42+
# Custom sidebar templates, must be a dictionary that maps document names
43+
# to template names.
44+
#
45+
# This is required for the alabaster theme
46+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
47+
html_sidebars = {
48+
'**': [
49+
'relations.html', # needs 'show_related': True theme option to display
50+
'searchbox.html',
51+
],
52+
}
53+
54+
# Output file base name for HTML help builder.
55+
htmlhelp_basename = 'VWSPYTHONdoc'
56+
autoclass_content = 'init'
57+
intersphinx_mapping = {
58+
'python': ('https://docs.python.org/3.7', None),
59+
'docker': ('http://docker-py.readthedocs.io/en/stable', None),
60+
}
61+
nitpicky = True
62+
warning_is_error = True
63+
nitpick_ignore = [
64+
('py:exc', 'RetryError'),
65+
# See https://bugs.python.org/issue31024 for why Sphinx cannot find this.
66+
('py:class', 'typing.Tuple'),
67+
('py:class', 'typing.Optional'),
68+
('py:class', '_io.BytesIO'),
69+
('py:class', 'docker.types.services.Mount'),
70+
]
71+
72+
html_show_copyright = False
73+
html_show_sphinx = False
74+
html_show_sourcelink = False
75+
76+
html_theme_options = {
77+
'show_powered_by': 'false',
78+
}
79+
80+
html_sidebars = {
81+
'**': [
82+
'about.html',
83+
'navigation.html',
84+
'searchbox.html',
85+
],
86+
}
87+
88+
# Don't check anchors because many websites use #! for AJAX magic
89+
# http://sphinx-doc.org/config.html#confval-linkcheck_anchors
90+
linkcheck_anchors = False
91+
# Retry link checking to avoid transient network errors.
92+
linkcheck_retries = 5
93+
linkcheck_ignore = [
94+
# Requires login.
95+
r'https://developer.vuforia.com/targetmanager',
96+
]
97+
98+
spelling_word_list_filename = '../../spelling_private_dict.txt'
99+
100+
autodoc_member_order = 'bysource'

0 commit comments

Comments
 (0)