Skip to content

Commit ea67717

Browse files
committed
[Docs] Added the guideline for documentation
1 parent 4da1051 commit ea67717

File tree

1 file changed

+227
-0
lines changed

1 file changed

+227
-0
lines changed
+227
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
#####################################
2+
Documentation Contribution Guidelines
3+
#####################################
4+
5+
Introduction
6+
------------
7+
8+
This is a guideline for the Arduino ESP32 project documentation. The idea for this guideline is to show how to start collaborating on the project.
9+
10+
The guideline works to give you the directions and to keep the documentation more concise, helping users to better understand the structure.
11+
12+
About Documentation
13+
-------------------
14+
15+
We all know how important documentation is. This project is no different.
16+
17+
This documentation was created in a collaborative and open way, letting everyone contribute, from a small typo fix to a new chapter writing. We try to motivate our community by giving all the support needed through this guide.
18+
19+
The documentation is in **English only**. Future translations can be added since we finish the essential content in English first.
20+
21+
How to Collaborate
22+
------------------
23+
24+
Everyone with some knowledge to share is welcome to collaborate.
25+
26+
One thing you need to consider is the fact that your contribution must be concise and assertive since it will be used by people developing projects. The information is very important for everyone, be sure you are not making the developer's life harder!
27+
28+
Documentation Guide
29+
-------------------
30+
31+
This documentation is based on the `Sphinx`_ with `reStructuredText`_ and hosted by `ReadTheDocs`_.
32+
33+
If you want to get started with `Sphinx`_, see the official documentation:
34+
35+
* `Documentation Index <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
36+
* `Basics <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_
37+
* `Directives <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html>`_
38+
39+
First Steps
40+
***********
41+
42+
Before starting your collaboration, you need to get the documentation source code from the Arduino-ESP32 project.
43+
44+
* **Step 1** - Fork the `Arduino-ESP32`_ to your GitHub account.
45+
* **Step 2** - Check out the recently created fork.
46+
* **Step 3** - Create a new branch for the changes/addition to the docs.
47+
* **Step 4** - Write!
48+
49+
Requirements
50+
************
51+
52+
To properly work with the documentation, you need to install some packages in your system.
53+
54+
.. code-block::
55+
56+
pip install -U Sphinx
57+
pip install -r requirements.txt
58+
59+
The requirements file is under the ``docs`` folder.
60+
61+
Using Visual Studio Code
62+
************************
63+
64+
If you are using the Visual Studio Code, you can install some extensions to help you while writing documentation.
65+
66+
`reStructuredText Pack <https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext-pack>`_
67+
68+
We also recommend you install to grammar check extension to help you to review English grammar.
69+
70+
`Grammarly <https://marketplace.visualstudio.com/items?itemName=znck.grammarly>`_
71+
72+
Building
73+
********
74+
75+
To build the documentation and generate the HTLM files, you can use the following command inside the ``docs`` folder. After a successful build, you can check the files inside the `build/html` folder.
76+
77+
.. code-block::
78+
79+
make html
80+
81+
This step is essential to ensure that there are no syntax errors and also to see the final result.
82+
83+
If everything is ok, you will see some output logs similar to this one:
84+
85+
.. code-block::
86+
87+
Running Sphinx v2.3.1
88+
loading pickled environment... done
89+
building [mo]: targets for 0 po files that are out of date
90+
building [html]: targets for 35 source files that are out of date
91+
updating environment: [extensions changed ('sphinx_tabs.tabs')] 41 added, 3 changed, 0 removed
92+
reading sources... [100%] tutorials/tutorials
93+
looking for now-outdated files... none found
94+
pickling environment... done
95+
checking consistency... done
96+
preparing documents... done
97+
writing output... [100%] tutorials/tutorials
98+
generating indices... genindexdone
99+
writing additional pages... searchdone
100+
copying images... [100%] tutorials/../_static/tutorials/peripherals/tutorial_peripheral_diagram.png
101+
copying static files... ... done
102+
copying extra files... done
103+
dumping search index in English (code: en)... done
104+
dumping object inventory... done
105+
build succeeded.
106+
107+
The HTML pages are in build/html.
108+
109+
Sections
110+
--------
111+
112+
The Arduino ESP32 is structured in some sections to make it easier to maintain. Here is a brief description of this structure.
113+
114+
API
115+
***
116+
117+
In this section, you will include all the documentation about drivers, libraries and any other related to the core.
118+
119+
Boards
120+
******
121+
122+
Here is the place to add any special guide on the development boards, pin layout, schematics, and any other relevant content.
123+
124+
Common
125+
******
126+
127+
In this folder, you can add all common information used in several different places. This helps to maintain the documentation easily maintainable.
128+
129+
130+
Guides
131+
******
132+
133+
This is the place to add the guides for common applications, IDEs configuration, and any other information that can be used as a guideline.
134+
135+
Tutorials
136+
*********
137+
138+
If you want to add a specific tutorial related to the Arduino for ESP32, this is the place. The intention is not to create a blog or a demo area, but this can be used to add some complex description or to add some more information about APIs.
139+
140+
Images and Assets
141+
*****************
142+
143+
All the files used on the documentation must be stored in the ``_static`` folder. Be sure that the content used is not with any copyright restriction.
144+
145+
Documentation Rules
146+
-------------------
147+
148+
Here are some guidelines to help you. We also recommend copying a sample file from the same category you are creating.
149+
150+
This will help you to follow the structure as well as to get inspired.
151+
152+
Basic Structure
153+
***************
154+
155+
To help you create a new section from scratch, we recommend you include this structure in your content if it applies.
156+
157+
* Brief description of the document.
158+
* Description of the peripheral, driver, protocol, including all different modes and configurations.
159+
* Description of each public function, macros, and structs.
160+
* If it's relevant for the user or if it's used in the example must be included in the description.
161+
* How to use.
162+
* Example code from the examples folder or code snippet.
163+
164+
Heading Levels
165+
**************
166+
167+
The heading levels used on this documentation are:
168+
169+
* **H1**: - (Dash)
170+
* **H2**: * (Asterisk)
171+
* **H3**: ^ (Circumflex)
172+
* **H4**: # (Sharp)
173+
174+
Code Block
175+
**********
176+
177+
To add a code block, you can use the following structure:
178+
179+
.. code-block::
180+
181+
.. code-block:: arduino
182+
bool begin(); //Code example
183+
184+
Links
185+
*****
186+
187+
To include links to external content, you can use two ways. The first
188+
189+
.. code-block::
190+
191+
`Arduino Wire Library`_
192+
193+
_Arduino Wire Library: https://www.arduino.cc/en/reference/wire
194+
195+
or
196+
197+
.. code-block::
198+
199+
`Arduino Wire Library <https://www.arduino.cc/en/reference/wire>`_
200+
201+
Images
202+
******
203+
204+
To include images in the docs, first, add all the files into the ``_static`` folder with a filename that makes sense for the topic.
205+
206+
After that, you can use the following structure to include the image in the docs.
207+
208+
.. code-block::
209+
210+
.. figure:: ../_static/arduino_i2c_master.png
211+
:align: center
212+
:width: 720
213+
:figclass: align-center
214+
215+
You can adjust the ``width`` according to the image size.
216+
217+
Be sure the file size does not exceed 600kB.
218+
219+
Support
220+
*******
221+
222+
If you need support on the documentation, you can ask a question as a discussion `here <https://github.com/espressif/arduino-esp32/discussions>`_.
223+
224+
.. _Arduino-ESP32: https://github.com/espressif/arduino-esp32
225+
.. _Sphinx: https://www.sphinx-doc.org/en/master/
226+
.. _ReadTheDocs: https://readthedocs.org/
227+
.. _reStructuredText: https://docutils.sourceforge.io/rst.html

0 commit comments

Comments
 (0)