Skip to content

Commit 7f14ed0

Browse files
committed
First pass at docs restructure
1 parent 7534530 commit 7f14ed0

File tree

15 files changed

+898
-676
lines changed

15 files changed

+898
-676
lines changed

CONTRIBUTING.rst

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Contributing
2+
============
3+
4+
Contributions and issues are most welcome! All issues and pull requests are
5+
handled through github on the `dls_controls repository`_. Also, please check for
6+
any existing issues before filing a new one. If you have a great idea but it
7+
involves big changes, please file a ticket before making a pull request! We
8+
want to make sure you don't spend your time coding something that might not fit
9+
the scope of the project.
10+
11+
.. _dls_controls repository: https://github.com/dls-controls/pythonIoc/issues
12+
13+
Running the tests
14+
-----------------
15+
16+
To get the source source code and run the unit tests, run::
17+
18+
$ git clone git://github.com/dls-controls/pythonIoc.git
19+
$ cd pythonIoc
20+
$ pipenv install --dev
21+
$ pipenv run tests
22+
23+
While 100% code coverage does not make a library bug-free, it significantly
24+
reduces the number of easily caught bugs! Please make sure coverage remains the
25+
same or is improved by a pull request!
26+
27+
Code Styling
28+
------------
29+
30+
The code in this repository conforms to standards set by the following tools:
31+
32+
- flake8_ for style checks
33+
34+
.. _flake8: http://flake8.pycqa.org/en/latest/
35+
36+
These tests will be run on code when running ``pipenv run tests`` and also
37+
automatically at check in. Please read the tool documentation for details
38+
on how to fix the errors it reports.
39+
40+
Documentation
41+
-------------
42+
43+
Documentation is contained in the ``docs`` directory and extracted from
44+
docstrings of the API.
45+
46+
Docs follow the underlining convention::
47+
48+
Headling 1 (page title)
49+
=======================
50+
51+
Heading 2
52+
---------
53+
54+
Heading 3
55+
~~~~~~~~~
56+
57+
58+
You can build the docs from the project directory by running::
59+
60+
$ pipenv run docs
61+
$ firefox build/html/index.html
62+
63+
64+
Release Checklist
65+
-----------------
66+
67+
Before a new release, please go through the following checklist:
68+
69+
- Choose a new PEP440 compliant release number
70+
- Git tag the version with a message summarizing the changes
71+
- Push to github and the actions will make a release on pypi
72+
- Push to internal gitlab and do a dls-release.py of the tag

docs/_static/theme_overrides.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1+
/* override table width restrictions */
2+
@media screen and (min-width: 639px) {
3+
.wy-table-responsive table td {
4+
/* !important prevents the common CSS stylesheets from
5+
overriding this as on RTD they are loaded after this stylesheet */
6+
white-space: normal !important;
7+
}
8+
}
9+
10+
/* override table padding */
11+
.rst-content table.docutils th, .rst-content table.docutils td {
12+
padding: 4px 6px;
13+
}
14+
115
/* allow us to stop margin after list so we can add to it */
216
.no-margin-after-ul ul {
317
margin-bottom: 0 !important;
418
}
19+
20+
/* Add two-column option */
21+
@media only screen and (min-width: 1000px),
22+
only screen and (min-width: 500px) and (max-width: 768px){
23+
.columns {
24+
padding-left: 5px;
25+
padding-right: 5px;
26+
float: left;
27+
width: 50%;
28+
}
29+
}
30+
31+
.endcolumns {
32+
clear: both
33+
}

docs/conf.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
import softioc # noqa
2323

2424
# General information about the project.
25-
project = u'Python Soft IOC'
26-
copyright = u'2011, Michael Abbott'
25+
project = u'pythonIoc'
26+
copyright = u'2008, Diamond Light Source'
27+
author = 'Michael Abbott'
2728

2829
# The full version, including alpha/beta/rc tags.
2930
release = softioc.__version__
@@ -40,6 +41,10 @@
4041
# Add any Sphinx extension module names here, as strings. They can be extensions
4142
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4243
extensions = [
44+
# Use this for generating API docs
45+
'sphinx.ext.autodoc',
46+
# This can parse google style docstrings
47+
'sphinx.ext.napoleon',
4348
# For linking to external sphinx documentation
4449
'sphinx.ext.intersphinx',
4550
# Add links to source code in API docs
@@ -48,8 +53,6 @@
4853
'sphinx_multiversion',
4954
]
5055

51-
viewcode_import = True
52-
5356
# If true, Sphinx will warn about all references where the target cannot
5457
# be found.
5558
nitpicky = True
@@ -60,6 +63,20 @@
6063
# ('envvar', 'LD_LIBRARY_PATH').
6164
nitpick_ignore = [('py:func', 'int')]
6265

66+
# Both the class’ and the __init__ method’s docstring are concatenated and
67+
# inserted into the main body of the autoclass directive
68+
autoclass_content = 'both'
69+
70+
# Order the members by the order they appear in the source code
71+
autodoc_member_order = 'bysource'
72+
73+
# Don't inherit docstrings from baseclasses
74+
autodoc_inherit_docstrings = False
75+
76+
# The name of a reST role (builtin or Sphinx extension) to use as the default
77+
# role, that is, for text marked up `like this`
78+
default_role = 'any'
79+
6380
# Add any paths that contain templates here, relative to this directory.
6481
templates_path = ['_templates']
6582

docs/explanations/use-cases.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Use Cases
2+
=========
3+
4+
Write about what it is good for
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Use `asyncio` in an IOC
2+
=======================
3+
4+
Write about the differences creating an IOC using `AsyncioDispatcher`

docs/index.rst

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,74 @@
1-
.. _index:
2-
31
.. include:: ../README.rst
42
:end-before: when included in index.rst
53

4+
How the documentation is structured
5+
-----------------------------------
6+
7+
.. rst-class:: columns
8+
9+
:ref:`tutorials`
10+
~~~~~~~~~~~~~~~~
11+
12+
Tutorials for installation, library and commandline usage. New users start here.
13+
14+
.. rst-class:: columns
15+
16+
:ref:`how-to`
17+
~~~~~~~~~~~~~
18+
19+
Practical step-by-step guides for the more experienced user.
20+
21+
.. rst-class:: columns
22+
23+
:ref:`explanations`
24+
~~~~~~~~~~~~~~~~~~~
25+
26+
Explanation of how the library works and why it works that way.
27+
28+
.. rst-class:: columns
29+
30+
:ref:`reference`
31+
~~~~~~~~~~~~~~~~
32+
33+
Technical reference material, for classes, methods, APIs, commands, and contributing to the project.
34+
35+
.. rst-class:: endcolumns
36+
37+
About the documentation
38+
~~~~~~~~~~~~~~~~~~~~~~~
39+
40+
`Why is the documentation structured this way? <https://documentation.divio.com>`_
41+
42+
.. toctree::
43+
:caption: Tutorials
44+
:name: tutorials
45+
:maxdepth: 1
46+
47+
tutorials/installation
48+
tutorials/creating-an-ioc
49+
50+
.. toctree::
51+
:caption: How-to Guides
52+
:name: how-to
53+
:maxdepth: 1
54+
55+
how-to/use-asyncio-in-an-ioc
56+
57+
.. toctree::
58+
:caption: Explanations
59+
:name: explanations
60+
:maxdepth: 1
61+
62+
explanations/use-cases
63+
664
.. rst-class:: no-margin-after-ul
765

8-
.. toctree::
9-
:numbered:
10-
:maxdepth: 2
66+
.. toctree::
67+
:caption: Reference
68+
:name: reference
69+
:maxdepth: 1
1170

12-
pythonsoftioc
13-
records
14-
softioc
71+
reference/api
72+
reference/contributing
1573

1674
* :ref:`genindex`
17-
* :ref:`modindex`
18-
* :ref:`search`
19-
* `Selected source code <_modules/index.html>`_

docs/records.rst

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)