Skip to content

Commit 8c01b60

Browse files
committed
Merge branch 'doc/add_chinese_updates_in_contribute_folder' into 'master'
Doc/add chinese updates in contribute folder See merge request espressif/esp-idf!9455
2 parents 992fd03 + 214c3a5 commit 8c01b60

File tree

4 files changed

+420
-44
lines changed

4 files changed

+420
-44
lines changed

docs/en/contribute/add-ons-reference.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Documentation Add-ons and Extensions Reference
33

44
This documentation is created using `Sphinx <http://www.sphinx-doc.org/>`_ application that renders text source files in `reStructuredText <https://en.wikipedia.org/wiki/ReStructuredText>`_ (``.rst``) format located in :idf:`docs` directory. For some more details on that process, please refer to section :doc:`documenting-code`.
55

6-
Besides Sphinx there are several other applications that help to provide nicely formatted and easy to navigate documentation. These applications are listed in section :ref:`setup-for-building-documentation` with the installed version numbers provided in file :idf_file:`docs/requirements.txt`.
6+
Besides Sphinx, there are several other applications that help to provide nicely formatted and easy to navigate documentation. These applications are listed in section :ref:`setup-for-building-documentation` with the installed version numbers provided in file :idf_file:`docs/requirements.txt`.
77

88
We build ESP-IDF documentation for two languages (English, Simplified Chinese) and for multiple chips. Therefore we don't run ``sphinx`` directly, there is a wrapper Python program ``build_docs.py`` that runs Sphinx.
99

10-
On top of that we have created a couple of custom add-ons and extensions to help integrate documentation with underlining `ESP-IDF`_ repository and further improve navigation as well as maintenance of documentation.
10+
On top of that, we have created a couple of custom add-ons and extensions to help integrate documentation with underlining `ESP-IDF`_ repository and further improve navigation as well as maintenance of documentation.
1111

1212
The purpose of this section is to provide a quick reference to the add-ons and the extensions.
1313

@@ -17,9 +17,9 @@ Documentation Folder Structure
1717

1818
* The ESP-IDF repository contains a dedicated documentation folder :idf:`docs` in the root.
1919
* The ``docs`` folder contains localized documentation in :idf:`docs/en` (English) and :idf:`docs/zh_CN` (simplified Chinese) subfolders.
20-
* Graphics files and fonts common to localized documentation are contained in :idf:`docs/_static` subfolder
20+
* Graphics files and fonts common to localized documentation are contained in :idf:`docs/_static` subfolder.
2121
* Remaining files in the root of ``docs`` as well as ``docs/en`` and ``docs/zh_CN`` provide configuration and scripts used to automate documentation processing including the add-ons and extensions.
22-
* Sphinx extensions are provided in two directories, ``extensions`` and ``idf_extensions``
22+
* Sphinx extensions are provided in two directories, ``extensions`` and ``idf_extensions``.
2323
* A ``_build`` directory is created in the ``docs`` folder by ``build_docs.py``. This directory is not added to the `ESP-IDF`_ repository.
2424

2525

@@ -33,7 +33,7 @@ Config Files
3333
This file contains configuration common to each localized documentation (e.g. English, Chinese). The contents of this file is imported to standard Sphinx configuration file ``conf.py`` located in respective language folders (e.g. ``docs/en``, ``docs/zh_CN``) during build for each language.
3434

3535
:idf_file:`docs/sphinx-known-warnings.txt`
36-
There are couple of spurious Sphinx warnings that cannot be resolved without doing update to the Sphinx source code itself. For such specific cases respective warnings are documented in ``sphinx-known-warnings.txt`` file, that is checked during documentation build, to ignore the spurious warnings.
36+
There are couple of spurious Sphinx warnings that cannot be resolved without doing update to the Sphinx source code itself. For such specific cases, respective warnings are documented in ``sphinx-known-warnings.txt`` file, that is checked during documentation build, to ignore the spurious warnings.
3737

3838

3939
Scripts
@@ -75,14 +75,14 @@ These are Sphinx extensions developed for IDF that don't rely on any IDF-docs-sp
7575
Sphinx extensions that provides a ``.. list::`` directive that allows filtering of entries in lists based on whether a tag is set, as ``:tagname: - list content``. See the Python file for a more complete description.
7676

7777
:idf_file:`docs/extensions/html_redirects.py`
78-
During documentation lifetime some source files are moved between folders or renamed. This Sphinx extension adds a mechanism to redirect documentation pages that have changed URL by generating in the Sphinx output static HTML redirect pages. The script is used together with a redirection list ``html_redirect_pages``. ``conf_common.py`` builds this list from :idf_file:`docs/page_redirects.txt`
78+
During documentation lifetime, some source files are moved between folders or renamed. This Sphinx extension adds a mechanism to redirect documentation pages that have changed URL by generating in the Sphinx output static HTML redirect pages. The script is used together with a redirection list ``html_redirect_pages``. ``conf_common.py`` builds this list from :idf_file:`docs/page_redirects.txt`.
7979

8080

8181
Third Party Extensions
8282
^^^^^^^^^^^^^^^^^^^^^^
8383

8484
- ``sphinxcontrib`` extensions for blockdiag, seqdiag, actdiag, nwdiag, rackdiag & packetdiag diagrams.
85-
- `Sphinx selective exclude`_ ``eager_only`` extension
85+
- `Sphinx selective exclude`_ ``eager_only`` extension.
8686

8787
.. _idf-specific extensions:
8888

@@ -94,9 +94,9 @@ Build System Integration
9494

9595
:idf:`docs/idf_extensions/build_system/`
9696

97-
Python package implementing a Sphinx extension to pull IDF build system information into the docs build
97+
Python package implementing a Sphinx extension to pull IDF build system information into the docs build.
9898

99-
* Creates a dummy CMake IDF project and runs CMake to generate metadata
99+
* Creates a dummy CMake IDF project and runs CMake to generate metadata.
100100
* Registers some new configuration variables and emits a new Sphinx event, both for use by other extensions.
101101

102102
Configuration Variables
@@ -112,7 +112,7 @@ New Event
112112

113113
``idf-info`` event is emitted early in the build, after the dummy project CMake run is complete.
114114

115-
Arguments are ``(app, project_description)`` where ``project_description`` is a dict containing the values parsed from ``project_description.json`` in the CMake build directory.
115+
Arguments are ``(app, project_description)``, where ``project_description`` is a dict containing the values parsed from ``project_description.json`` in the CMake build directory.
116116

117117
Other IDF-specific extensions subscribe to this event and use it to set up some docs parameters based on build system info.
118118

@@ -126,7 +126,7 @@ Other Extensions
126126
Subscribes to ``idf-info`` event and uses confgen to generate ``kconfig.inc`` from the components included in the default project build. This file is then included into :doc:`/api-reference/kconfig`.
127127

128128
:idf_file:`docs/idf_extensions/link_roles.py`
129-
This is an implementation of a custom `Sphinx Roles <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`_ to help linking from documentation to specific files and folders in `ESP-IDF`_. For description of implemented roles please see :ref:`link-custom-roles` and :ref:`link-language-versions`.
129+
This is an implementation of a custom `Sphinx Roles <https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`_ to help linking from documentation to specific files and folders in `ESP-IDF`_. For description of implemented roles, please see :ref:`link-custom-roles` and :ref:`link-language-versions`.
130130

131131
:idf_file:`docs/idf_extensions/esp_err_definitions.py`
132132
Small wrapper extension that calls ``gen_esp_err_to_name.py`` and updates the included .rst file if it has changed.

docs/en/contribute/documenting-code.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ There is couple of tips, how you can make your documentation even better and mor
122122

123123
For practical example see :component_file:`nvs_flash/include/nvs.h`.
124124

125-
4. You may want to go even further and skip some code like e.g. repetitive defines or enumerations. In such case enclose the code within ``/** @cond */`` and ``/** @endcond */`` commands. Example of such implementation is provided in :component_file:`driver/include/driver/gpio.h`.
125+
4. You may want to go even further and skip some code like repetitive defines or enumerations. In such case, enclose the code within ``/** @cond */`` and ``/** @endcond */`` commands. Example of such implementation is provided in :component_file:`driver/include/driver/gpio.h`.
126126

127127
5. Use markdown to make your documentation even more readable. You will add headers, links, tables and more. ::
128128

@@ -141,7 +141,7 @@ There is couple of tips, how you can make your documentation even better and mor
141141
Linking Examples
142142
----------------
143143

144-
When linking to examples on GitHub do not use absolute / hardcoded URLs. Instead, use docutils custom roles that will generate links for you. These auto-generated links point to the tree or blob for the git commit ID (or tag) of the repository. This is needed to ensure that links do not get broken when files in master branch are moved around or deleted. The roles will transparently handle files that are located in submodules and will link to the submodule's repository with the correct commit ID.
144+
When linking to examples on GitHub, do not use absolute/hardcoded URLs. Instead, use docutils custom roles that will generate links for you. These auto-generated links point to the tree or blob for the git commit ID (or tag) of the repository. This is needed to ensure that links do not get broken when files in master branch are moved around or deleted. The roles will transparently handle files that are located in submodules and will link to the submodule's repository with the correct commit ID.
145145

146146
The following roles are provided:
147147

@@ -199,9 +199,9 @@ The following types of diagrams are supported:
199199
* `Activity diagram <http://blockdiag.com/en/actdiag/index.html>`_
200200
* `Logical network diagram <http://blockdiag.com/en/nwdiag/index.html>`_
201201

202-
With this suite of tools it is possible to generate beautiful diagram images from simple text format (similar to graphviz’s DOT format). The diagram elements are laid out automatically. The diagram code is then converted into ".png" graphics and integrated "behind the scenes" into **Sphinx** documents.
202+
With this suite of tools, it is possible to generate beautiful diagram images from simple text format (similar to graphviz’s DOT format). The diagram elements are laid out automatically. The diagram code is then converted into ".png" graphics and integrated "behind the scenes" into **Sphinx** documents.
203203

204-
For the diagram preparation you can use an on-line `interactive shell`_ that instantly shows the rendered image.
204+
For the diagram preparation, you can use an on-line `interactive shell`_ that instantly shows the rendered image.
205205

206206
Below are couple of diagram examples:
207207

@@ -327,7 +327,7 @@ When building the documents, Sphinx will use the above mentioned directive and r
327327

328328
The recommended way of doing it is adding the document to one of the list that gets included in ``conditional_include_dict`` in :idf_file:`docs/conf_common.py`, e.g. a document which should only be shown for BT capable targets should be added to ``BT_DOCS``. :idf_file:`docs/idf_extensions/exclude_docs.py` will then take care of adding it to ``exclude_patterns`` if the corresponding tag is not set.
329329

330-
If you need to exclude content inside a list or bullet points then this should be done by using the '':TAG:'' role inside the ''.. list:: '' directive.
330+
If you need to exclude content inside a list or bullet points, then this should be done by using the '':TAG:'' role inside the ''.. list:: '' directive.
331331

332332
.. code-block:: none
333333
@@ -351,11 +351,11 @@ Would render in the documentation as:
351351

352352
This is a {IDF_TARGET_NAME}, with /{IDF_TARGET_PATH_NAME}/soc.c, compiled with `xtensa-{IDF_TARGET_TOOLCHAIN_NAME}-elf-gcc` with `CONFIG_{IDF_TARGET_CFG_PREFIX}_MULTI_DOC`.
353353

354-
This extension also supports markup for defining local (within a single source file) substitutions. Place a definition like the following into a single line of the RST file::
354+
This extension also supports markup for defining local (within a single source file) substitutions. Place a definition like the following into a single line of the RST file:
355355

356356
{\IDF_TARGET_SUFFIX:default="DEFAULT_VALUE", esp32="ESP32_VALUE", esp32s2="ESP32S2_VALUE"}
357357

358-
This will define a target-dependent substitution of the tag {\IDF_TARGET_SUFFIX} in the current RST file. For example::
358+
This will define a target-dependent substitution of the tag {\IDF_TARGET_SUFFIX} in the current RST file. For example:
359359

360360
{\IDF_TARGET_TX_PIN:default="IO3", esp32="IO4", esp32s2="IO5"}
361361

0 commit comments

Comments
 (0)