|
1 | 1 | """Document configuration.""" |
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 | # |
4 | | -# PyModbus documentation build configuration file, created by |
5 | | -# sphinx-quickstart on Wed Dec 20 12:31:10 2017. |
| 4 | +# PyModbus documentation build configuration file, |
6 | 5 | # |
7 | 6 | # This file is execfile()d with the current directory set to its |
8 | 7 | # containing dir. |
9 | 8 | # |
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 | 9 | # pylint: skip-file |
21 | 10 | import os |
22 | 11 | import sys |
23 | 12 |
|
24 | 13 | from recommonmark.transform import AutoStructify |
| 14 | +from recommonmark.parser import CommonMarkParser |
25 | 15 |
|
26 | 16 | from pymodbus import __version__ |
27 | 17 |
|
28 | 18 | parent_dir = os.path.abspath(os.pardir) |
29 | | -# examples = os.path.join(parent_dir, "examples") |
30 | | -example_contrib = os.path.join(parent_dir, "examples/contrib") |
31 | | -example_common = os.path.join(parent_dir, "examples/common") |
32 | | -# example_gui = os.path.join(parent_dir, "examples/gui") |
| 19 | +sys.path.insert(0, parent_dir) |
| 20 | +sys.path.append(os.path.join(parent_dir, "examples")) |
| 21 | +github_doc_root = "https://github.com/pymodbus-dev/pymodbus/tree/master/doc/" |
33 | 22 |
|
34 | | -sys.path.insert(0, os.path.abspath(os.pardir)) |
35 | | -sys.path.append(example_common) |
36 | | -sys.path.append(example_contrib) |
37 | | -# sys.path.append(example_gui) |
38 | | -# sys.path.extend([examples, example_common, example_contrib, example_gui]) |
39 | | -# sys.path.insert(0, os.path.abspath("../")) |
40 | | - |
41 | | -github_doc_root = "https://github.com/pymodbus-dev/pymodbus/tree/master/doc/" # pylint: disable=invalid-name |
42 | 23 | # -- General configuration ------------------------------------------------ |
43 | | - |
44 | | -# If your documentation needs a minimal Sphinx version, state it here. |
45 | | -# |
46 | | -# needs_sphinx = "1.0" |
47 | | - |
48 | | -# Add any Sphinx extension module names here, as strings. They can be |
49 | | -# extensions coming with Sphinx (named "sphinx.ext.*") or your custom |
50 | | -# ones. |
51 | | - |
52 | | -extensions = ["sphinx.ext.autodoc", "m2r2"] |
53 | | - |
54 | | -# Add any paths that contain templates here, relative to this directory. |
55 | | -templates_path = ["_templates"] |
56 | | - |
57 | | -# The suffix(es) of source filenames. |
58 | | -# You can specify multiple suffix as a list of string: |
59 | | -# |
60 | | -# source_parsers = { |
61 | | -# ".md": CommonMarkParser, |
62 | | -# } |
63 | | - |
64 | | -source_suffix = [".rst", ".md"] |
65 | | - |
66 | | -# The master toctree document. |
67 | | -master_doc = "index" # pylint: disable=invalid-name |
68 | | - |
69 | | -# General information about the project. |
70 | | -project = "PyModbus" # pylint: disable=invalid-name |
71 | | -copyright = "See license" # pylint: disable=redefined-builtin,invalid-name |
72 | | -author = "Open Source volunteers" # pylint: disable=invalid-name |
73 | | - |
74 | | -# The version info for the project you"re documenting, acts as replacement for |
75 | | -# |version| and |release|, also used in various other places throughout the |
76 | | -# built documents. |
77 | | -# |
78 | | -# The short X.Y version. |
| 24 | +extensions = [ |
| 25 | + 'sphinx.ext.autodoc', |
| 26 | + 'sphinx_rtd_theme', |
| 27 | + 'sphinx.ext.autosectionlabel' |
| 28 | +] |
| 29 | +source_suffix = ['.rst'] |
| 30 | +master_doc = 'index' |
| 31 | +project = 'PyModbus' |
| 32 | +copyright = "See license" |
| 33 | +author = "Open Source volunteers" |
79 | 34 | version = __version__ |
80 | | -# The full version, including alpha/beta/rc tags. |
81 | 35 | release = __version__ |
82 | | - |
83 | | -# The language for content autogenerated by Sphinx. Refer to documentation |
84 | | -# for a list of supported languages. |
85 | | -# |
86 | | -# This is also used if you do content translation via gettext catalogs. |
87 | | -# Usually you set "language" from the command line for these cases. |
88 | 36 | language = "en" |
89 | | - |
90 | | -# List of patterns, relative to source directory, that match files and |
91 | | -# directories to ignore when looking for source files. |
92 | | -# This patterns also effect to html_static_path and html_extra_path |
93 | 37 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
94 | | - |
95 | | -# The name of the Pygments (syntax highlighting) style to use. |
96 | | -pygments_style = "sphinx" # pylint: disable=invalid-name |
97 | | - |
98 | | -# If true, `todo` and `todoList` produce output, else they produce nothing. |
99 | | -todo_include_todos = False # pylint: disable=invalid-name |
| 38 | +pygments_style = "sphinx" |
| 39 | +todo_include_todos = False |
100 | 40 |
|
101 | 41 |
|
102 | 42 | # -- Options for HTML output ---------------------------------------------- |
103 | | - |
104 | | -# The theme to use for HTML and HTML Help pages. See the documentation for |
105 | | -# a list of builtin themes. |
106 | | -# |
107 | | -html_theme = "sphinx_rtd_theme" # pylint: disable=invalid-name |
108 | | - |
109 | | -# Theme options are theme-specific and customize the look and feel of a theme |
110 | | -# further. For a list of options available for each theme, see the |
111 | | -# documentation. |
112 | | -# |
113 | | -# html_theme_options = {} |
114 | | - |
115 | | -# Add any paths that contain custom static files (such as style sheets) here, |
116 | | -# relative to this directory. They are copied after the builtin static files, |
117 | | -# so a file named "default.css" will overwrite the builtin "default.css". |
118 | | -# html_static_path = ["_static"] |
| 43 | +html_theme = 'sphinx_rtd_theme' |
119 | 44 | html_static_path = [] |
120 | | - |
121 | | -# Custom sidebar templates, must be a dictionary that maps document names |
122 | | -# to template names. |
123 | | -# |
124 | | -# This is required for the alabaster theme |
125 | | -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars |
126 | 45 | html_sidebars = { |
127 | 46 | "**": [ |
128 | 47 | "relations.html", # needs "show_related": True theme option to display |
|
131 | 50 | } |
132 | 51 |
|
133 | 52 |
|
134 | | -# -- Options for HTMLHelp output ------------------------------------------ |
135 | | - |
136 | | -# Output file base name for HTML help builder. |
137 | | -htmlhelp_basename = "PyModbusdoc" # pylint: disable=invalid-name |
138 | | - |
139 | | - |
140 | | -# -- Options for LaTeX output --------------------------------------------- |
141 | | - |
142 | | -latex_elements = { |
143 | | - # The paper size ("letterpaper" or "a4paper"). |
144 | | - # |
145 | | - # "papersize": "letterpaper", |
146 | | - # The font size ("10pt", "11pt" or "12pt"). |
147 | | - # |
148 | | - # "pointsize": "10pt", |
149 | | - # Additional stuff for the LaTeX preamble. |
150 | | - # |
151 | | - # "preamble": "", |
152 | | - # Latex figure (float) alignment |
153 | | - # |
154 | | - # "figure_align": "htbp", |
155 | | -} |
156 | | - |
157 | | -# Grouping the document tree into LaTeX files. List of tuples |
158 | | -# (source start file, target name, title, |
159 | | -# author, documentclass [howto, manual, or own class]). |
160 | | -latex_documents = [ |
161 | | - ( |
162 | | - master_doc, |
163 | | - "PyModbus.tex", |
164 | | - "PyModbus Documentation", |
165 | | - "Sanjay", |
166 | | - "manual", |
167 | | - ), |
168 | | -] |
169 | | - |
170 | | - |
171 | | -# -- Options for manual page output --------------------------------------- |
172 | | - |
173 | | -# One entry per manual page. List of tuples |
174 | | -# (source start file, name, description, authors, manual section). |
175 | | -man_pages = [(master_doc, "pymodbus", "PyModbus Documentation", [author], 1)] |
176 | | - |
177 | | - |
178 | | -# -- Options for Texinfo output ------------------------------------------- |
179 | | - |
180 | | -# Grouping the document tree into Texinfo files. List of tuples |
181 | | -# (source start file, target name, title, author, |
182 | | -# dir menu entry, description, category) |
183 | | -texinfo_documents = [ |
184 | | - ( |
185 | | - master_doc, |
186 | | - "PyModbus", |
187 | | - "PyModbus Documentation", |
188 | | - author, |
189 | | - "PyModbus", |
190 | | - "One line description of project.", |
191 | | - "Miscellaneous", |
192 | | - ), |
193 | | -] |
194 | | - |
195 | | - |
196 | 53 | def setup(app): |
197 | 54 | """Do setup.""" |
198 | 55 | app.add_config_value( |
|
0 commit comments