I’ll take the function from https://tiddlywiki.com/#Functions as example:
\function myfun(param:"2")
[<param>multiply[1.5]]
\end
If I want to document it, are there any conventions for docs? Are there any tools, like a linter, an automated documentation generator?
I suppose I can use HTML comments, to get something like this:
\function myfun(param:"2")
<!--
Multiply a numeric value by 1.5
Parameters:
param - value to multiply
-->
[<param>multiply[1.5]]
\end
This is a la Python docstrings, with doc inside the function body.
I think JavaScript (albeit wikitext is not JavaScript) puts this before the function body, so it’s rather like
<!--
Multiply a numeric value by 1.5
Parameters:
param - value to multiply
-->
\function myfun(param:"2")
[<param>multiply[1.5]]
\end
This is at least friendlier for oneliner code snippets. But is this the recommended way? Are there any standards at all?
And of course I have to be picky about a wording detail in the docs, due to my limited English knowledge. Quote from https://tiddlywiki.com/#Pragmas :
They (pragmas) can only appear at the start of the text of a tiddler, but blank lines and comments are allowed between them.
If I translate this literally, the “between” part especially, does it mean that the very first function/macro in a tiddler can’t have a HTML comment like above before its definition?