How to Contribute#
Once you have completed a project at Naova, you will be asked to document it on this site. This page will guide you through the process.
Steps to Follow#
Run the following command to clone the repository:
git clone git@github.com:Naova/NaovaPrivateWiki.git
Next, enter the project directory:
cd NaovaPrivateWiki
To update your local repository with the latest state of the main branch, run:
git fetch origin
git checkout main
git reset --hard origin/main
Create a new branch with the following command:
git checkout -b your_project_name
Create a file named your_project_name.rst in the docs/source/projects/ folder.
At the beginning of the file, add the following lines:
.. _your_project_name:
Title
=====
Make sure to place an underscore before your project name and ensure that the equal signs under the title are the same length.
Add your project to index.rst in the “Projects” section.
Document your project in the .rst file. Once done, to build and open the documentation locally, enter:
Note
We have only tested this on Ubuntu 22.04 LTS.
rm -rf docs/_build && ./naova.sh
Note
TO TEST
naova.bat
Make sure your local Git credentials are up to date, or run:
git config --global user.email "email@example.com"
git config --global user.name "username"
This is the user and email that will appear in the GitHub history.
Run the following command to select the changes you want to add:
git add -p
Commit your changes with the following command:
git commit -m "Change description"
Push your branch to origin with the following command:
git push -u origin your_project_name
Go to https://github.com/Naova/NaovaPrivateWiki and open a new pull request.
In the base dropdown, select main, as you want to submit a PR to this branch.
In the compare dropdown, select your branch (your_project_name).
Review your changes and click Create pull request.
Wait for all automated tests to pass.
The PR will be approved or rejected after review by the team.
New Modifications#
To continue with a new modification, return to step 3. To return to your PR and make new modifications:
Run the following command to stash your current changes:
git stash
Run the following command to return to your contribution branch:
git checkout your_project_name
Repeat steps 10 and 11.
Push your changes again with the following command:
git push origin your_project_name
The pull request will be automatically updated.
Good to Know About Writing in RST#
The reStructuredText (RST) language is used for technical documentation and is widely adopted by Sphinx. Here are the main useful features for writing your documents effectively.
Inserting Links#
There are several ways to add links in RST:
Simple link embedded in text
See the official `Sphinx <https://www.sphinx-doc.org/>`_ documentation.
Named link (reusable in multiple places in the document)
.. _sphinx-docs: https://www.sphinx-doc.org/ Check out the `Sphinx documentation <sphinx-docs_>`_.
Text Formatting#
Bold :
**Bold text**→ Bold textItalic :
*Italic text*→ Italic textMonospace text:`code`→ codeBullet list
- Element 1 - Element 2
Numbered list
1. First element 2. Second element
Creating Subsections#
RST allows you to organize a document into sections and subsections using different punctuation marks
Main Title
==========
Section
-------
Subsection
^^^^^^^^^^
Sub-subsection
""""""""""""""
Inserting Images#
To add an image
.. image:: source/_static/project_name/nao_robot.png
:alt: Nao Robot
:width: 300px
:align: center
This will display `source/_static/project_name/nao_robot.png` with a width of **300px** and centered.
Inserting Videos#
Videos can be embedded as links or via raw HTML if necessary:
Link to a YouTube video
See the demonstration on YouTube: `RoboCup Video <https://www.youtube.com/watch?v=xvFZjo5PgG0>`_.
HTML to directly embed a video (requires html in Sphinx)
.. raw:: html <iframe width="560" height="315" src="https://www.youtube.com/embed/xvFZjo5PgG0" frameborder="0" allowfullscreen></iframe>
References to Other Pages#
It is possible to create links to other sections or pages of the documentation.
Link to a section on the same page
See the section :ref:`Inserting Images <insertion-images>`.
For this to work, the section must be marked with a label
.. _insertion-images: Inserting Images ----------------
Link to another documentation page
See also :ref:`other_page`
where other_page.rst is a file in the same project.
Link to a bibliographic reference (with sphinxcontrib-bibtex)
See the article :cite:`k1-kali2021walking`
The citation must be defined in a .bib file included in the documentation.