Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mwclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WebU
shared
mwclient
Commits
bacb5344
Commit
bacb5344
authored
5 months ago
by
Marc Troelitzsch
Committed by
Adam Williamson
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
docs: expand "Updating/expanding the documentation" section
parent
65091759
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/source/development/index.rst
+64
-10
64 additions, 10 deletions
docs/source/development/index.rst
with
64 additions
and
10 deletions
docs/source/development/index.rst
+
64
−
10
View file @
bacb5344
...
...
@@ -85,21 +85,75 @@ If you would like to expand the test suite by adding more tests, please go ahead
Updating/expanding the documentation
------------------------------------
Documentation consists of both a manually compiled user guide
(under ``docs/user``) and a reference guide generated from the docstrings,
using Sphinx autodoc with the napoleon extension.
Documentation is built automatically on `ReadTheDocs <https://mwclient.readthedocs.io/>`_
after each commit.
To build the documentation locally for testing:
The documentation for this project consists of two main parts:
.. code:: bash
1. A manually compiled user guide (located in ``docs/user/``).
2. A reference guide automatically generated from docstrings using Sphinx
autodoc with the napoleon extension.
Builds
^^^^^^
Automatic Builds
""""""""""""""""
Documentation is automatically built on `ReadTheDocs <https://mwclient.readthedocs.io/>`_
after each commit. The configuration for this can be found in ``.readthedocs.yaml``.
Local Builds
""""""""""""
To build and test the documentation on your local machine:
1. Install the documentation dependencies:
.. code:: bash
$ pip install -e '.[docs]'
2. Build the documentation:
.. code:: bash
$ pip install -e '.[docs]'
$ cd docs
$ make html
$ cd docs
$ make html
The generated HTML documentation will be available in ``docs/build/html/``.
Open ``docs/build/html/index.html`` in your browser to view it.
If you make
changes to the documentation, you can rebuild it by running ``make html``
again and then refreshing the page in your browser. To rebuild after making
changes, run ``make html`` again and refresh your browser.
Writing Docstrings
^^^^^^^^^^^^^^^^^^
When writing docstrings, try to adhere to the
`Google style <https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html>`_.
For example:
.. code:: python
def my_function(foo: str) -> str:
"""This is a function that does something.
Args:
foo: A string to do something with.
Returns:
A string with the result.
"""
You can also use `Sphinx-specific directives <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html>`_
in your docstrings to provide additional information. Some useful directives
include:
- ``.. warning ::``: Highlight potential issues.
- ``.. note ::``: Provide additional information.
- ``.. seealso ::``: Link to related documentation.
- ``.. deprecated ::``: Mark a function as deprecated.
Making a pull request
---------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment