[GRASS-dev] module header definitions add: text/multiline and latex support?

Pietro peter.zamb at gmail.com
Wed Jan 14 00:42:14 PST 2015


Dear devs,

sometimes I would like to add some multiline text on the module GUI to
help to understand the meaning of the parameter, and/or understand the
logic of the module.

Do you think that would be possible to have a description option that
it does not take any input but allow us to be more descriptive inside
the module interface?

for instance if I have two mutual exclusive options like:

{{{
#%module
#%  description: test script
#%end
...
#%option
#% key: raster
#% type: string
#% gisprompt: old,cell,raster
#% description: Raster input map:
#% required : no
#%end
#%option
#% type: description
#% answer: OR
#%end
#%option
#% key: vector
#% type: string
#% gisprompt: old,vector,vector
#% description: Vector input map
#% required : no
#%end
}}}

So in the gui of the module I will have:

Raster input map:
-> raster menu

OR

Vector input map:
-> vector menu

or add a relation, to do something like:

{{{
#%module
#%  description: test script
#%end
...
#%option
#% key: raster
#% type: string
#% gisprompt: old,cell,raster
#% description: Raster input map:
#% required : yes
#%end
#%option
#% key: vector
#% type: string
#% gisprompt: old,vector,vector
#% description: Vector input map
#% required : yes
#%end
#%keyrelation: raster OR vector
}}}

Is it this possible already? If yes how? Do you have some links?

Do you think that would be feasible add also a LaTex option?
To do something like:

{{{
#%module
#%  description: test script
#%end
...
#%option
#% guisection: Costs
#% type: description
#% answer: This option is used to compute the total
#% cost of %%%% using this formula:
#%end
#%option
#%option
#% guisection: Costs
#% type: latex
#% answer: \rho = \frac{\gamma}{\pi}
#%end
#%option
#% guisection: Costs
#% key: gamma
#% type: double
#% description: $\gamma$ value
#% required : no
#% answer: 12.45
#%end
#%option
#% guisection: Costs
#% key: currency
#% type: string
#% description: the currency
#% required : no
#% answer: €
#%end
}}}

In this way the GUI could be more descriptive and clearer.

I have not idea if this could be feasible or not... What do you think?

Best regards

Pietro


More information about the grass-dev mailing list