|
12 | 12 | # All configuration values have a default; values that are commented out
|
13 | 13 | # serve to show the default.
|
14 | 14 |
|
15 |
| -import sys |
| 15 | +import datetime |
16 | 16 | import os
|
17 |
| -import shlex |
| 17 | +import re |
| 18 | +import sys |
18 | 19 |
|
19 | 20 | # If extensions (or modules to document with autodoc) are in another directory,
|
20 | 21 | # add these directories to sys.path here. If the directory is relative to the
|
21 | 22 | # documentation root, use os.path.abspath to make it absolute, like shown here.
|
22 | 23 | #sys.path.insert(0, os.path.abspath('.'))
|
23 |
| -sys.path.append(os.path.abspath('ext/sphinx_rtd_theme')) |
24 | 24 | sys.path.append(os.path.abspath('../../pythonforandroid'))
|
25 | 25 |
|
26 |
| -import sphinx_rtd_theme |
27 |
| - |
28 | 26 | # -- General configuration ------------------------------------------------
|
29 | 27 |
|
30 | 28 | # If your documentation needs a minimal Sphinx version, state it here.
|
|
54 | 52 | master_doc = 'index'
|
55 | 53 |
|
56 | 54 | # General information about the project.
|
57 |
| -project = u'python-for-android' |
58 |
| -copyright = u'2015, Alexander Taylor' |
59 |
| -author = u'Alexander Taylor' |
| 55 | +project = 'python-for-android' |
| 56 | + |
| 57 | +_today = datetime.datetime.now() |
| 58 | + |
| 59 | +author = 'Kivy Team and other contributors' |
| 60 | + |
| 61 | +copyright = f'{_today.year}, {author}' |
60 | 62 |
|
61 | 63 | # The version info for the project you're documenting, acts as replacement for
|
62 | 64 | # |version| and |release|, also used in various other places throughout the
|
63 | 65 | # built documents.
|
64 | 66 | #
|
| 67 | + |
| 68 | +# Lookup the version from the pyjnius module, without installing it |
| 69 | +# since readthedocs.org may have issue to install it. |
| 70 | +# Read the version from the __init__.py file, without importing it. |
| 71 | +def get_version(): |
| 72 | + with open( |
| 73 | + os.path.join(os.path.abspath("../.."), "pythonforandroid", "__init__.py") |
| 74 | + ) as fp: |
| 75 | + for line in fp: |
| 76 | + m = re.search(r'^\s*__version__\s*=\s*([\'"])([^\'"]+)\1\s*$', line) |
| 77 | + if m: |
| 78 | + return m.group(2) |
| 79 | + |
65 | 80 | # The short X.Y version.
|
66 |
| -version = '0.1' |
| 81 | +version = get_version() |
67 | 82 | # The full version, including alpha/beta/rc tags.
|
68 |
| -release = '0.1' |
| 83 | +release = get_version() |
69 | 84 |
|
70 | 85 | # The language for content autogenerated by Sphinx. Refer to documentation
|
71 | 86 | # for a list of supported languages.
|
|
82 | 97 |
|
83 | 98 | # List of patterns, relative to source directory, that match files and
|
84 | 99 | # directories to ignore when looking for source files.
|
85 |
| -exclude_patterns = ['ext/*', ] |
| 100 | +exclude_patterns = [] |
86 | 101 |
|
87 | 102 | # The reST default role (used for this markup: `text`) to use for all
|
88 | 103 | # documents.
|
|
116 | 131 |
|
117 | 132 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
118 | 133 | # a list of builtin themes.
|
119 |
| -html_theme = 'sphinx_rtd_theme' |
| 134 | +html_theme = 'furo' |
120 | 135 |
|
121 | 136 | # Theme options are theme-specific and customize the look and feel of a theme
|
122 | 137 | # further. For a list of options available for each theme, see the
|
123 | 138 | # documentation.
|
124 | 139 | #html_theme_options = {}
|
125 | 140 |
|
126 | 141 | # Add any paths that contain custom themes here, relative to this directory.
|
127 |
| -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
| 142 | +# html_theme_path = [] |
128 | 143 |
|
129 | 144 | # The name for this set of Sphinx documents. If None, it defaults to
|
130 | 145 | # "<project> v<release> documentation".
|
|
230 | 245 | # (source start file, target name, title,
|
231 | 246 | # author, documentclass [howto, manual, or own class]).
|
232 | 247 | latex_documents = [
|
233 |
| - (master_doc, 'python-for-android.tex', u'python-for-android Documentation', |
234 |
| - u'Alexander Taylor', 'manual'), |
| 248 | + (master_doc, 'python-for-android.tex', 'python-for-android Documentation', |
| 249 | + author, 'manual'), |
235 | 250 | ]
|
236 | 251 |
|
237 | 252 | # The name of an image file (relative to this directory) to place at the top of
|
|
0 commit comments