mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
A new script then parses these json help files into the html help contents, in a standardised manner. Previously, the function help was a bunch of different formats and structures. Now, a custom stylesheet can be applied (and later tweaked!) to format these help. Eg, this commit colors variables and function names in the syntax section for greater readability.
14 lines
1.3 KiB
Plaintext
14 lines
1.3 KiB
Plaintext
{
|
|
"function": "scale_linear",
|
|
"description": "Transforms a given value from an input domain to an output range using linear interpolation.",
|
|
"arguments": [ {"arg":"val","description":"A value in the input domain. The function will return a corresponding scaled value in the output range."},
|
|
{"arg":"domain_min","description":"Specifies the minimum value in the input domain, the smallest value the input value should take."},
|
|
{"arg":"domain_max","description":"Specifies the maximum value in the input domain, the largest value the input value should take."},
|
|
{"arg":"range_min","description":"Specifies the minimum value in the output range, the smallest value which should be output by the function."},
|
|
{"arg":"range_max","description":"Specifies the maximum value in the output range, the largest value which should be output by the function."}],
|
|
"examples": [ { "expression":"scale_linear(5,0,10,0,100)", "returns":"72 <i>(eg, scaling a value between 0 and 1 to an angle between 0 and 360)</i>"},
|
|
{ "expression":"scale_linear(0.2,0,1,0,360)", "returns":"72"},
|
|
{ "expression":"scale_linear(1500,1000,10000,9,20)", "returns":"10.22 <i>(eg, scaling a population which varies between 1000 and 10000 to a font size between 9 and 20)</i>"}
|
|
]
|
|
}
|