Skip to content
Commit 91384ef0 authored by Ulf Magnusson's avatar Ulf Magnusson Committed by Carles Cufí
Browse files

scripts: genrest: Support splitting symbol documentation up by path



Add a --modules flag to genrest.py for generating separate index pages
for symbols defined within certain paths.

Passing

    --modules Shell:shell:subsys/shell Storage:storage:subsys/storage

will generate these index pages, instead of a single index.rst file:

 - index-shell.rst: Lists the symbols defined in subsys/shell

 - index-storage.rst: Lists the symbols defined in subsys/storage

 - index-main.rst: Lists all symbols that are not in subsys/shell or
   subsys/storage

 - index-all.rst: Lists all symbols

 - index.rst: Contains links to the other index pages

The string before the first ':' ('Shell' and 'Storage' above) is used
when generating the title of the index page. 'Shell' gives
'Shell Configuration Options', for example.

The title for index-main.rst can be set by passing
'--non-module-title <title>'. It defaults to "Zephyr".

By default, paths in symbol information pages that are within modules
are shown as '<title>/<path relative to module>'. This can be disabled
by passing --keep-module-paths.

--keep-module-paths would make sense for the example above, but
stripping the path to the module is nice when dealing with modules
defined outside the Zephyr repository.

If a symbol is defined in multiple modules (or both in a module and
outside all modules), it will appear on multiple index pages.

This commit also simplifies how genrest.py is called a bit, making the
Kconfig filename optional (default: Kconfig).

Signed-off-by: default avatarUlf Magnusson <Ulf.Magnusson@nordicsemi.no>
parent f7d9af8c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment