[QGIS-Developer] Add function group to functions_help JSON files
Alexandre Neto
senhor.neto at gmail.com
Mon Jun 22 03:06:34 PDT 2020
Hi,
*TL;DR;*
Would it be ok to add a group key in the function help JSON files?
Something like this:
{
"name": "array_agg",
"type": "function", * "group": "Aggregates",*
"description": "Returns an array of aggregated values from a field or
expression.",
"arguments": [
{"arg": "expression", "description": "sub expression of field to
aggregate"},
{"arg": "group_by", "optional": true, "description": "optional expression
to use to group aggregate calculations"},
{"arg": "filter", "optional": true, "description": "optional expression to
use to filter features used to calculate aggregate"},
{"arg": "order_by", "optional": true, "description": "optional expression
to use to order features used to calculate aggregate"}
],
"examples": [
{ "expression": "array_agg(\"name\",group_by:=\"state\")", "returns":"list
of name values, grouped by state field"}
]
}
*WHY*
I am following Thomas Grattier effort to put all expression functions in a
single HTML page:
https://gist.githack.com/ThomasG77/0c6862fb2b6b3fc301ea994733688ea5/raw/99ecc5e6127e7238814da330a4d5d0b9fa2afe4e/qgis-3-12-expressions-single-page.html
This is how he did it:
https://gist.github.com/ThomasG77/0c6862fb2b6b3fc301ea994733688ea5
This made me think that would be great to have a complete list like this on
our documentation. But, unfortunately we can't use his approach which
generates HTML
My idea would be to use the JSON files in QGIS\QGIS to semi-automagically
populate the function list with Sphinx format files. Which would be much
easier to do, if there is a group key in each function.
https://github.com/qgis/QGIS-Documentation/issues/5747
Thanks,
Alexandre Neto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200622/f254279a/attachment.html>
More information about the QGIS-Developer
mailing list