What about using colored blocks like this (just a draft, someone else should find better suited colors
)?
Applied to search-replace operator:
Source code:
\procedure i(_) <span class="tc-fop-block tc-fop-input"><<_>></span>
\procedure o(_) <span class="tc-fop-block tc-fop-operator"><<_>></span>
\procedure s(_) <span class="tc-fop-block tc-fop-suffix"><<_>></span>
\procedure so(_) <span class="tc-fop-block tc-fop-suffix tc-fop-optional"><<_>></span>
\procedure p(_) <span class="tc-fop-block tc-fop-parameter"><<_>></span>
\procedure po(_) <span class="tc-fop-block tc-fop-parameter tc-fop-optional"><<_>></span>
\procedure m(_) <span class="tc-fop-meaning"><<_>></span>
<style>
.tc-fop-syntax{
line-height: 2em;
}
span.tc-fop-block{
font-family: monospace;
border: 3px solid;
border-radius: 0.5em;
padding: 0 0.2em;
margin-left: 0.05em;
margin-right: 0.05em;
}
span.tc-fop-input{
background-color:lightgray;
border-color: darkgray;
color: gray;
}
span.tc-fop-operator{
background-color:mistyrose;
border-color: pink;
color: deeppink;
}
span.tc-fop-suffix{
background-color:plum;
border-color: orchid;
color: darkorchid;
}
span.tc-fop-parameter{
background-color:aliceblue;
border-color: lightsteelblue;
color: steelblue;
}
span.tc-fop-meaning{
font-family: sans;
font-weight: 400;
}
span.tc-fop-optional{
border-style: dashed;
}
</style>
!! General filter operator syntax:
@@.tc-fop-syntax
<pre>[<<i input>><<o operator>>:<<s suffix1>>:<<s suffix2>><<p parameter1>>,<<p parameter2>>]</pre>
"""
<<i input>>: <<m "Input values for the considered filter operator">>
<<o operator>>: <<m "Filter operator name">>
<<s suffix>>: <<m "Some filter operators use one or more suffixes to change their behavior. Suffixes must be literal values.">>
<<p parameter>>: <<m "Optional. Parameters for the filter operator.">>
"""
@@
<$transclude $variable=".tip" _={{Filter operand brackets}} $mode="block" title="Operands (parameter values):"/>
---
! Examples
---
! search-replace Operator
<<tag "Filter Operators">> <<tag "String Operators">>
!! Purpose
Returns each item in the list, replacing within each title the string specified by the first parameter with the second parameter.
!! Syntax
@@.tc-fop-syntax
<pre>[<<i "input">><<o search-replace>>:<<so "flag-list">>:<<so "regexp-mode">><<p search-term>>,<<p replacement>>]</pre>
"""
<<i "input">>: <<m "a [[selection of titles|Title Selection]]">>
<<s "''Suffix'':">> <<m "''search-replace'' operator uses a rich suffix, see below for details.">>
<<so "flag-list">>: <<m "''g'' for global mode to replace all matches, ''i'' for case-insensitive mode, ''m'' for multiline mode, ''gim'' for all (optional).">>
<<so "regexp-mode">>: <<m "''regexp'' to treat the first parameter as a regular expression (optional).">>
''Parameters'':
<<p "search-term">>: <<m "string or regular expression that should be replaced">>
<<p "replacement">>: <<m "string that should replace the search-term">>
"""
@@
<$transclude $variable=".tip" _={{Filter operand brackets}} $mode="block" title="Operands (parameter values):"/>
operators-syntax.json (3.8 KB)
(uses doc macros, try it on tiddlywiki.com)
Fred