Links and transclusions in railroad diagrams

This commit is contained in:
Astrid Elocson
2015-01-06 01:39:24 +00:00
parent 71357a8e39
commit 2f42c9fb8d
11 changed files with 233 additions and 76 deletions

View File

@@ -2,10 +2,12 @@ created: 20150103184022184
modified: 20150103184022184
title: $:/plugins/tiddlywiki/railroad/syntax
The railroad widget constructs a diagram from the components defined below.
The railroad widget uses a special ''diagram syntax'' 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.
---
; sequence
@@ -52,7 +54,6 @@ The railroad widget constructs a diagram from the components defined below.
; nonterminal
: <$railroad text=""" (name | "<" string ">") """/>
* A nonterminal component, i.e. the name of another diagram
* The simple `name` option is available when the text starts with a letter and contains only letters, digits, underscores, dots and hyphens
---
@@ -64,4 +65,16 @@ The railroad widget constructs a diagram from the components defined below.
; dummy
: <$railroad text=""" "-" """/>
* The absence of a component
* The absence of a component
---
; link
: <$railroad text=""" "[[" x "|" (name|string) "]]" """/>
* A link to the tiddler title or URI given by the string or name
---
; transclusion
: <$railroad text=""" "{{" (name|string) "}}" """/>
* Treats the content of another tiddler as diagram syntax and transcludes it into the current diagram