This plugin provides a <$railroad> widget for generating railroad diagrams as SVG images.
Alternatively, the diagram notation can be stored in a dedicated tiddler with its type field set to text/vnd.tiddlywiki.railroad, and that tiddler can simply be transcluded to wherever it is needed.
The plugin is based on a library by Tab Atkins, and has been extended to make it more flexible, including allowing components of a diagram to function as links or be transcluded from other tiddlers.
The railroad widget uses a special notation to construct the components defined below.
x and y here stand for any component.
Names (as opposed to quoted strings) are available when a value starts with a letter and contains only letters, digits, underscores, dots and hyphens.
<- and -> delimiters allow you to force a single component to be treated as a sequence. This is occasionally useful for spacing a diagram outx appear straight aheadx+ suffix adds y as a separator between each x and the nextx, i.e. a list of zero or more x