New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Populate Expression list with information from the function_help #5747
Comments
Hi @SrNetoChan
I like the idea of not manually maintain this list. So if it can be automatically populated (or generated), great news. Let me check whether I understand your proposal: you mean we'll have automatically generated rst files in a folder and use the include:: directive or something like that to populate each section in the expression.rst file, right? Not another chapter nor a replacement of the file (only the existing lists are replaced). I've been thinking about this chapter recently and here are some ideas/needs I came to. Not sure how or if they are compatible with your proposal, but here they are:
|
Yes, exactly.
I really miss having at least the parameters available in the docs. Sometimes in forums I want to send a function documentation and its actually very poor. I would also keep the simple examples. Then, I would keep just more advanced examples below, like we already do. But cleaning the repetitions. It may feel as a duplication, but I really think it would be nice to have a place with everything without the need to check it inside QGIS.
I think those are the ones I would keep out of the imported function list, and use them to expand what come directly from the functions help. Simple examples that we think that are missing, we could add it to the function help.
My idea would be to replace each function group table by something more completed, I would keep the rest.
I haven't looked into variables yet, but I like that idea too. Sometimes people (me) get lost when not finding a certain variable. |
@SrNetoChan , great work here! |
Automating this seems like a good idea. The challenge will be to combine the harvested data with the "manually" created content. I have no solution. |
I am already working on it. My plan is to use a python script to fetch the json files and create a rst snippet for each group. |
I think having the arguments / parameters in the "heading" is nice. |
I like it too, the only caveat is that it clutters the index above |
Agreed. and it would look ugly (I know, beauty is subjective). What about a subtitle level mentioning only the function and its first row showing the call, and maybe indicating whether the parameter is optional/has default or are these details in the tables (your examples are not concerned with this)?
But going the option above assumes that we already have the answer to
I'm fine with one function one table option (I actually don't imagine what the others would look like). And with the subtitle level, it would be possible to directly reference a function url 'not possible in a group level table). Also if we have information to add to a particular function, we can add it in its section and not after many other functions. I'm thinking eg to the processing algs that relate to some functions or some advanced examples. Unless the tables are supposed to be :included: all in one (group)? The only thing that scares me is the length of the page once all the tables are generated. The minimal split we should do is to separate the expression builder dialog (description of "expression" and "function editor" tabs) to the actual functions (the same as we have Processing framework vs processing algs list). Thinking about variables, they probably have somewhere in the code their scope(s) listed, don't they? |
I also tend to favour one table for each function. |
@DelazJ said:
It was just me moving forward with some trials. I will be happy to go any other direction.
My idea was in fact to have only one include per group. The rationale was that it would be easier to keep track of 10 to 15 includes for the groups, but much harder to keep it for 100s if we have each funcion in a separate file. Notice, creating each function file to include would be easy (probably even easier that grouping) the real work would be to place each include in the RST file and keep track of it. I understand the idea of adding extra information in each function section. My idea would be to had any crucial explanation that might be missing directly on the QGIS/QGIS help, including extra examples. And put anything more elaborated, like advanced examples, warnings or other information, either at the begining or the end of the group section. But, you are the ones actively working on it, so, it's up to you. Really. I can prepare what you guys think is more useful.
Yes, that would probably be wiser.
I was including it at group level and strict the main one to two levels only. (Maybe I should do a PR so we can all see how the actual code looks like)
After each release, someone runs a python script that will fetch the function's help from QGIS/QGIS repository and recreate the files to use in the include:: directive. That person needs to check if all files are being used in the RST file.
We can look at it on another time. Let's see if we can achieve something for the expressions first. |
@SrNetoChan, I am fine with your preferred solution. |
This is implemented already. |
Description
Currently, we maintain two lists of expressions and related help/documentation.
The developers maintain a list of functions help in json files in the QGIS/QGIS repository:
https://github.com/qgis/QGIS/tree/master/resources/function_help/json
The documentation team maintains a page about the expressions and keeps a list existing functions:
https://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/expression.html#list-of-functions
While the second is more exhaustive, the second is a bit more curated, but only provides part of the information. For example, there's no description about each function arguments, nor there are examples for all the fucntions.
My idea would be to use the JSON files in QGIS\QGIS to semi-automagically populate the Documentation List.
My idea would be to use a python script to grab each function group and create a rst formated file to be included in the main expressions page.
Looking for some opinions about this before I start looking at it.
The text was updated successfully, but these errors were encountered: