lvgl/docs
lorddevereux c61ca42a2a
feat(scale): add additional style properties (#6649)
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
2024-10-23 08:28:25 +02:00
..
_ext feat(docs): add Chinese translation (jump link) (#5839) 2024-03-13 23:22:27 +01:00
_static feat: simplify the PR template (#5134) 2024-01-02 08:10:46 +01:00
_templates chore(style): remove the trailing space from all source files (#3188) 2022-03-21 11:25:51 +01:00
flyers docs(readme): add LVGL Chinese flyer (#3886) 2023-01-04 06:22:15 +01:00
get-started fix(docs): fix most sphinx warnings (#6916) 2024-09-30 14:57:22 +02:00
integration docs(index): sort the index links alphabetically 2024-10-17 12:24:04 +02:00
intro fix(docs): eliminate 2 types of sphinx warnings: (#6928) 2024-09-26 16:51:06 +02:00
layouts fix(docs): fix most sphinx warnings (#6916) 2024-09-30 14:57:22 +02:00
libs docs(index): sort the index links alphabetically 2024-10-17 12:24:04 +02:00
misc feat(scale): set tick drawing order (#6185) 2024-06-20 22:07:39 +02:00
others docs(index): sort the index links alphabetically 2024-10-17 12:24:04 +02:00
overview feat(scale): add additional style properties (#6649) 2024-10-23 08:28:25 +02:00
porting docs(index): sort the index links alphabetically 2024-10-17 12:24:04 +02:00
widgets feat(scale): add additional style properties (#6649) 2024-10-23 08:28:25 +02:00
add_translation.py docs: make it easy to add more other translations (#5874) 2024-03-15 10:25:41 +08:00
build.py fix(docs): fix error blocking API-doc generation under Windows (#6990) 2024-10-11 21:31:49 +02:00
CHANGELOG.rst fix(docs): fix most sphinx warnings (#6916) 2024-09-30 14:57:22 +02:00
CODE_OF_CONDUCT.rst.back docs: removes non ascii characters (#4175) 2023-04-27 19:47:13 +02:00
CODING_STYLE.rst fix: eliminate misc sphinx warnings... (#6929) 2024-09-26 12:09:04 +02:00
conf.py feat(drivers): GLCDC support for RX72 family (#6291) 2024-06-03 19:43:35 +02:00
config_builder.py feat: add API JSON generator (#5677) 2024-06-20 22:02:25 +02:00
CONTRIBUTING.rst chore: use the new labels in GitHub actions and docs (#6940) 2024-09-30 17:38:49 +02:00
doc_builder.py fix(docs): fix error blocking API-doc generation under Windows (#6990) 2024-10-11 21:31:49 +02:00
Doxyfile chore: fix spelling (#6401) 2024-06-28 09:09:23 +02:00
example_list.py fix(docs): restore missing on-line examples (#6927) 2024-10-01 10:09:47 +02:00
favicon.png chore(logo): update lvgl logo (#6416) 2024-07-05 00:19:44 +02:00
index.rst docs: reorganize and add Integartion and drivers section 2023-10-22 15:13:19 +02:00
logo_lvgl.png chore(logo): update lvgl logo (#6416) 2024-07-05 00:19:44 +02:00
README_jp.rst fix(docs): fix most sphinx warnings (#6916) 2024-09-30 14:57:22 +02:00
README_pt_BR.rst fix(docs): fix most sphinx warnings (#6916) 2024-09-30 14:57:22 +02:00
README_zh.rst fix(docs): fix most sphinx warnings (#6916) 2024-09-30 14:57:22 +02:00
README.md fix(docs/README.md): reworked to handle several things (#6992) 2024-10-16 10:16:59 +02:00
requirements.txt feat(drivers): GLCDC support for RX72 family (#6291) 2024-06-03 19:43:35 +02:00
ROADMAP.rst chore: fix spelling (#6401) 2024-06-28 09:09:23 +02:00

Documentation

Building

Building the documentation is pretty easy to do but it does have some requirements that have to be filled prior to building them.

Here are the requirements:

  • Doxygen
  • Python >= 3.10
  • C compiler (gcc, msvc, clang, etc...)

There are also some Python specific libraries that need to be installed. You can either install these individually or you can use pip to read the requirements file to install everything that is needed for Python.

  • Sphinx
  • breathe
  • imagesize
  • importlib-metadata
  • sphinx-rtd-theme
  • sphinx-sitemap
  • sphinxcontrib-applehelp
  • sphinxcontrib-devhelp
  • sphinxcontrib-htmlhelp
  • sphinxcontrib-jsmath
  • sphinxcontrib-qthelp
  • sphinxcontrib-serializinghtml
  • sphinxcontrib-mermaid
  • sphinx-design
  • sphinx-rtd-dark-mode
  • typing-extensions

To install using the requirements.txt file use the following command:

pip install -r requirements.txt

Once you have all of the requirements installed you are ready to build the documentation. Use the following command:

python build.py skip_latex clean

You may have to use the following command if you are on a Unix like OS

python3 build.py skip_latex clean

The documentation will be output into ./out_html/ in the root directory for LVGL.

For Developers

The most important thing that has to be done when contributing to LVGL is EVERYTHING MUST BE DOCUMENTED.

The below are some rules to follow when updating any of the .rst files located in the ./docs/ directory and any of it's subdirectories.

index.rst files

If you create a new directory you MUST have an index.rst file in that directory and that index file needs to be pointed to in the index.rst file that is located in the parent directory.

Let's take a look at the index.rst file that is located in the docs/layouts directory.

.. _layouts:

=======
Layouts
=======


.. toctree::
    :maxdepth: 2

    flex
    grid

The below explains the parts of this file.

.. _layouts:      <=== Creates an explicit link target
                  <=== Empty line -- important!
=======
Layouts           <=== Heading seen in documentation
=======


.. toctree::      <=== Table of contents
    :maxdepth: 2  <=== Internal use and needs to always be set this way

    flex          <=== .rst files located in directory with index.rst
    grid

The first line is for the purposes of providing a uniquely-named link target that can be referenced elsewhere in the documentation.

.. _{LINK NAME}:

Note that {LINK NAME}:

  • must be preceded by a single underscore, and
  • must be followed by at least one blank line for the doc-generation logic to process it correctly.

Replace {LINK NAME} with a link name that is unique among all documents under the ./docs/ directory. It can have multiple words if needed to make it unique or when otherwise appropriate for clarity. If multiple words are used, they can be separated with single spaces, hyphens or underscores. Whatever you use, the {LINK NAME} string used to reference it must be identical. {LINK NAME} strings are not case sensitive.

That unique name is then used to provide a link reference elsewhere in the documentation using one of two formats.

:ref:`{LINK NAME}`

This in-line markup (interpreted text using the Sphinx-defined custom :ref: role) is then replaced with a hyperlink whose "link text" is the name of the section heading just below the link target. For this reason, when using this syntax, {LINK NAME} must reference link targets that are just above a title or section heading.

:ref:`other link text <{LINK NAME}>`

This latter syntax enables you to put a link target anywhere in an .RST file (not just above a heading) and link to it using this syntax.

Section Headings

Section headings are created by underlining (and optionally overlining) the section title with a punctuation character, at least as long as the text. Example:

=================
This Is a Heading
=================

reStructuredText does not impose any particular heading levels assigned to certain characters since the structure is determined from the succession of headings. So if you are modifying an existing .RST file, please follow the pattern already in use.

If you are creating a new .RST file, use this convention:

=====
Title
=====

Chapter
*******

Section
-------

Sub Section
~~~~~~~~~~~

Sub Sub Section
^^^^^^^^^^^^^^^

Sub Sub Sub Section
'''''''''''''''''''

Note that the "underlining" can be longer than the heading title, but if it is shorter, the documentation-generation logic will fail with an error.

For improved readability in the .RST file, place at least 2 blank lines above section headings.

Code Blocks

  • Do not use tab characters in code blocks.
  • Each indentation level use 4 spaces.
  • Include at least 1 empty line after a code block.
  • There must be one empty line between the code block directive and the code.
  • .. code-block:: is the only directive that should be used. Note carefully that unlike the link target directive above, this directive has 2 colons. (The only ReST and sphinx directives that are valid with one colon are link targets as shown above.) Lone ::, :code: or .. code: should not be used.
  • If you want to separate code into easier-to-understand sections you can do so with a single empty line.
  • For syntax highlighting appropriate to the language in the code block, specify the language after the directive. Some examples are:
    • .. code-block:: c,
    • .. code-block:: cpp,
    • .. code-block:: python,
    • .. code-block:: shell,
    • .. code-block:: kconfig,
    • .. code-block:: json,
    • .. code-block:: yaml,
    • .. code-block:: csharp (or "cs"),
    • .. code-block:: vb.net,
    • .. code-block:: dot (graphviz),
    • .. code-block:: html,
    • .. code-block:: css,
    • .. code-block:: xml,
    • .. code-block:: make.

The full set of supported lexers are listed here: https://pygments.org/docs/lexers/ .

Bulleted Lists

To create a bulleted list, do the following:

- First item description
- If you want to span multiple lines, indent subsequent
  lines to align with item text like this.
- If you want to include a code block under a list item,
  it must be intended to align with the list item like this:

  .. code-block: python
                             <=== blank line here is important
      # this is some code
                             <=== blank line here is important
- If you want to have nested bulleted lists, indent each
  new level to align with its parent list item like this:
                             <=== blank line here is important
  - level 2 item 1: text
  - level 2 item 2: text
                             <=== blank line here is important
- Last list item.  Note that the nested list above is preceded
  and followed by 1 blank line.

All lists (including nested lists) must be preceded and followed with at least 1 blank line. This is mandatory for the documentation-generation logic to process it correctly.

Referencing API Documentation

If you want to reference portions of the LVGL code from the documentation (in .RST files) there are special directives to do this:

:cpp:func:`lv_init`
:c:macro:`LV_USE_FLEX`
:cpp:type:`lv_event_t`
:cpp:enum:`_lv_event_t`
:cpp:enumerator:`LV_EVENT_ALL`
:cpp:struct:`lv_image_dsc_t`
:cpp:union:`lv_style_value_t`

There is a special directive when wanting to use a more complex expression. For example when showing the arguments passed to a function.

:cpp:expr:`lv_obj_set_layout(obj, LV_LAYOUT_FLEX)`

Arguments that are expressions (more than one word), or contain non-alphanumeric characters will cause the :cpp:expr: interpreted-text to fail. Examples:

:cpp:expr:`lv_obj_set_layout(obj, LV_LAYOUT_FLEX/GRID)`         <== arg with > 1 word
:cpp:expr:`lv_obj_set_layout(obj, LV_LAYOUT_*)`                 <== asterisk
:cpp:expr:`lv_obj_set_layout(*obj, LV_LAYOUT_FLEX)`             <== asterisk
:cpp:expr:`lv_obj_set_layout((lv_obj_t *)obj, LV_LAYOUT_FLEX)`  <== cast
:cpp:expr:`lv_obj_set_layout(&obj, LV_LAYOUT_FLEX);`            <== ampersand
:cpp:expr:`lv_obj_set_layout(obj, ...)`                         <== elipsis

For such examples, simply use reStructuredText literal markup like this:

``lv_obj_set_layout(obj, LV_LAYOUT_FLEX/GRID)``
``lv_obj_set_layout(obj, LV_LAYOUT_*)``
``lv_obj_set_layout(*obj, LV_LAYOUT_FLEX)``
``lv_obj_set_layout((lv_obj_t *)obj, LV_LAYOUT_FLEX)``
``lv_obj_set_layout(&obj, LV_LAYOUT_FLEX);``
``lv_obj_set_layout(obj, ...)``