Skip to main content
100%

Generate single page documentation for expressions

โœ“ Published0๐ŸŒ Public
TThomasG77
Last edited Jun 21, 2020
Created on Jun 20, 2020

Generate single page documentation for expressions

Why?

The goal was a single page documentation on expression

One approach could have been about using scripts/process_function_template.py and/or files in resources/function_help/json/. As there is no link between groups and functions documented in these json files, you need to look for the relation in the source src/core/expression/qgsexpressionfunction.cpp. You would also need to manage translations. FYI, all paths are relative to the root of the source code repo.

So, instead we've made the choice to use HTML generated doc for expressions from PyQGIS docs. It works for any languages

How to

You need to install third party Python library BeautifulSoup4 into the version of Python used by QGIS. For Linux, do it with

pip install beautifulsoup4

Then, run the script pyqgis-list-expressions.py within PyQGIS console.

As the script is generated dynamically within QGIS and we need to change the locale each time we want to generate a new lang doc, we only produced some translations. Feel free to ask in the comments for another languages.

Current generated docs

  • QGIS 3.14

    • English
    • French
    • Japanese
    • Spanish
  • QGIS 3.12

    • English