Closed gavg712 closed 2 years ago
Hi, @nyalldawson.
Something happened with pylint checks. There wasn't any error before I changed the title of this PR.
Dear @nyalldawson and @JanCaha
Do you think a feature like this PR could be interesting for the plugin? If not, it is not a problem I could close this PR.
I have to say that I dont know. I can see the point of this feature, it makes sense. On the other side, I quite like that you are forced to have the logic of the tool and the help separate, as IMO it makes things clearer.
It is design question. I cant say that I am for or against. I will leave it to @nyalldawson to decide. If you decide to include it, I am happy to take care of this PR as there likely will be some minor changes needed.
@JanCaha
Well, there is a move for the QGIS "core" algorithms to provide better help to users by adding explanatory tooltips to individual parameters, so in that regard I can see having this support in the R provider as a good thing.
I'm not particular convinced by the #'
prefix though... maybe ###
would be a better approach?
Ok, lets go with it then.
The prefix #'
is taken from R, it is used there for automatic generation of documentation from code. Should be fairly obvious to R programmers. Can be have both #'
and ###
and let user choose the one that suits him?
@JanCaha I didn't realise that -- in that case, let's go with it
Thanks to both of you for finding this feature useful. So, @JanCaha any code change request?
Yea, I would change the way the lines are sorted as mentioned above. Besides that, I dont think that there is anything that need to be changed.
Hi guys. Please take a look at this idea. I think it will be useful for easier documentation of R scripts. Let's think of a new parser for lines starting with
#'
that picks up aparameter:description
string and enters it as Help Texts for parameters and help section. Here is an example script that I have tested on my local hostThis script will not require an extra file
.rsx.help
to display description texts. Can be enough with thus lines starting with#'
The
.rsx.help
files are the primary option, in case of missing file, help lines will be used. If both are missing, no help is shown.This is intended for make easy to document R scripts. Do you agree?