I’m documenting two BASIC Anywhere Machine functions: MIN and MAX .
I’m using the railroad plugin to describe syntax.
MIN and MAX having identical syntax (and I’ve got many other cases like this), I wanted to define the railroad diagram once for both the MIN and MAX tiddlers.
I created a template tiddler called “Syntax MIN MAX” that has the following text:
!! Syntax
<$railroad text={{{
[<currentTiddler>addprefix["]addsuffix["]]
[["("<"numValue1">]]
[[","]]
[[<"numValue2">]]
[[")"]]
+[join[]]
}}}>
Both my MIN and my MAX tiddlers have the following in their text:
{{||Syntax MIN MAX}}
I could have kept things simple by defining the one railroad diagram with it displaying required choice of MIN or MAX, but I did not like the look of that at all.
If you have an approach you think is simpler than the one described above, please let everybody know about it.