Skip to content

Commit d1bbe97

Browse files
committed
Doc of simulator.
1 parent 151d3df commit d1bbe97

23 files changed

+1039
-497
lines changed

doc/Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33

44
# You can set these variables from the command line.
55
SPHINXOPTS = -W --keep-going
6-
SPHINXBUILD = sphinx-build
7-
SPHINXPROJ = PyModbus
8-
SOURCEDIR = .
9-
BUILDDIR = _build
106

117
# Put it first so that "make" without argument is like "make help".
128
help:
13-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
9+
sphinx-build -M help "." "_build" -W --keep-going
1410

1511
.PHONY: help Makefile
1612

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).
1913
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
sphinx-build -M $@ "." "_build" -W --keep-going

doc/conf.py

Lines changed: 18 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,47 @@
11
"""Document configuration."""
22
# -*- coding: utf-8 -*-
33
#
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,
65
#
76
# This file is execfile()d with the current directory set to its
87
# containing dir.
98
#
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-
#
209
# pylint: skip-file
2110
import os
2211
import sys
2312

2413
from recommonmark.transform import AutoStructify
14+
from recommonmark.parser import CommonMarkParser
2515

2616
from pymodbus import __version__
2717

2818
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/"
3322

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
4223
# -- 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"
7934
version = __version__
80-
# The full version, including alpha/beta/rc tags.
8135
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.
8836
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
9337
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
10040

10141

10242
# -- 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'
11944
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
12645
html_sidebars = {
12746
"**": [
12847
"relations.html", # needs "show_related": True theme option to display
@@ -131,68 +50,6 @@
13150
}
13251

13352

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-
19653
def setup(app):
19754
"""Do setup."""
19855
app.add_config_value(

doc/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ Welcome to PyModbus's documentation!
77
====================================
88

99
.. toctree::
10-
:maxdepth: 2
10+
:maxdepth: 6
1111
:caption: Contents:
1212

1313
readme.rst
1414
changelog.rst
15+
source/library/modules.rst
16+
source/library/simulator/simulator
1517
source/library/REPL
1618
source/example/modules.rst
17-
source/library/modules.rst
1819

1920

2021
Indices and tables

doc/source/example/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ The examples are divived in 3 (4) parts:
2828
commit using CI.
2929

3030

31-
Examples.
32-
---------
31+
Examples version 3.x
32+
--------------------
3333

3434
.. toctree::
3535
:maxdepth: 4

0 commit comments

Comments
 (0)