template.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. Template
  2. ========
  3. .. note::
  4. *INSTRUCTIONS*
  5. 1. Use this file as a template to document API.
  6. 2. Change the file name to the name of the header file that represents documented API.
  7. 3. Include respective files with descriptions from the API folder using ``..include::``
  8. * README.rst
  9. * example.rst
  10. 4. Optionally provide description right in this file.
  11. 5. Once done, remove all instructions like this one and any superfluous headers.
  12. Overview
  13. --------
  14. .. note::
  15. *INSTRUCTIONS*
  16. 1. Provide overview where and how this API may be used.
  17. 2. Where applicable include code snippets to illustrate functionality of particular functions.
  18. 3. To distinguish between sections, use the following `heading levels <http://www.sphinx-doc.org/en/stable/rest.html#sections>`_:
  19. * ``#`` with overline, for parts
  20. * ``*`` with overline, for chapters
  21. * ``=``, for sections
  22. * ``-``, for subsections
  23. * ``^``, for subsubsections
  24. * ``"``, for paragraphs
  25. Application Example
  26. -------------------
  27. .. note::
  28. *INSTRUCTIONS*
  29. 1. Prepare one or more practical examples to demonstrate functionality of this API.
  30. 2. Each example should follow pattern of projects located in ``esp-idf/examples/`` folder.
  31. 3. Place example in this folder complete with ``README.md`` file.
  32. 4. Provide overview of demonstrated functionality in ``README.md``.
  33. 5. With good overview reader should be able to understand what example does without opening the source code.
  34. 6. Depending on complexity of example, break down description of code into parts and provide overview of functionality of each part.
  35. 7. Include flow diagram and screenshots of application output if applicable.
  36. 8. Finally add in this section synopsis of each example together with link to respective folder in ``esp-idf/examples/``.
  37. API Reference
  38. -------------
  39. .. note::
  40. *INSTRUCTIONS*
  41. 1. Specify the names of header files used to generate this reference. Each name should be linked to the source on `espressif/esp-idf <https://github.com/espressif/esp-idf>`_ repository.
  42. 2. Provide list of API members divided into sections.
  43. 3. Use corresponding ``.. doxygen..`` directives, so member documentation is auto updated.
  44. * Data Structures -``.. doxygenstruct::`` together with ``:members:``
  45. * Macros - ``.. doxygendefine::``
  46. * Type Definitions - ``.. doxygentypedef::``
  47. * Enumerations - ``.. doxygenenum::``
  48. * Functions - ``.. doxygenfunction::``
  49. See `Breathe documentation <https://breathe.readthedocs.io/en/latest/directives.html>`_ for additional information.
  50. 4. Once done remove superfluous headers.
  51. 5. When changes are committed and documentation is build, check how this section rendered. :doc:`Correct annotations <../documenting-code>` in respective header files, if required.
  52. Header Files
  53. ^^^^^^^^^^^^
  54. * `path/header-file.h`
  55. Data Structures
  56. ^^^^^^^^^^^^^^^
  57. ::
  58. .. doxygenstruct:: name_of_structure
  59. :members:
  60. Macros
  61. ^^^^^^
  62. ::
  63. .. doxygendefine:: name_of_macro
  64. Type Definitions
  65. ^^^^^^^^^^^^^^^^
  66. ::
  67. .. doxygentypedef:: name_of_type
  68. Enumerations
  69. ^^^^^^^^^^^^
  70. ::
  71. .. doxygenenum:: name_of_enumeration
  72. Functions
  73. ^^^^^^^^^
  74. ::
  75. .. doxygenfunction:: name_of_function