Skip to content

Commit

Permalink
Add documentation about sphinx. (#66)
Browse files Browse the repository at this point in the history
Add documentation about sphinx.

---------

Signed-off-by: Jelmer de Wolde <[email protected]>
  • Loading branch information
Jelmerdw authored Jan 2, 2025
1 parent bfd7ef5 commit f81dc31
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions docs/content/writing_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
SPDX-FileCopyrightText: Alliander N. V.
SPDX-License-Identifier: Apache-2.0
-->

# Writing Documentation

## File Structure

This documentation is generated using [Sphinx](https://www.sphinx-doc.org). The source files are located in `rcdt_robotics/docs`. If changes are made in this directory and merged to the main branch, a GitHub workflow automatically generates HTML from the source file and deploys these at the documentation [page](https://alliander-opensource.github.io/rcdt_robotics/).

Although *.rst* (reStructuredText) is the default format for Sphinx documentation, we only use *index.rst* to define the structure of our documentation. All other documentation files are *.md* (Markdown) because of the simpler syntax.

The *README.md* file is the "home" page of our documentation page and our GitHub repository. All other documentation can be found in the `content` directory.

## Adding Documentation

Documentation can be added by creating a new *.md* file in the content directory. After creating the file, it also needs to be added to *index.rst*. To check your changes locally, you can use the *sphinx-autobuild* tool. First, make sure to run our Docker image and go to the *docs* folder:

```bash
cd /home/rcdt/rcdt_robotics/docs
```

Next, run the following command to start automatic building using Sphinx:

```bash
sphinx-autobuild . build/
```

You can now view a live version, by default at [http://127.0.0.1:8000](http://127.0.0.1:8000). Every time you change a file and save, the tool builds the new HTML files and refreshes the page.
7 changes: 4 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

Home <self>

docs/getting_started.md
docs/pyflow.md
docs/docker.md
content/getting_started.md
content/pyflow.md
content/docker.md
content/writing_documentation.md

CODE_OF_CONDUCT.md
CONTRIBUTING.md
Expand Down

0 comments on commit f81dc31

Please sign in to comment.