Nyall Dawson 709c14391b Change expression help from free form html files to structured json
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.
2015-09-02 14:22:50 +10:00

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>"}
]
}