Railroad diagram: my approach to segmenting railroads that are too wide

50 views
Skip to first unread message

Charlie Veniot

unread,
Jun 24, 2023, 9:44:40 PM6/24/23
to TiddlyWiki
I added some custom syntax /"BR"/ I can use to generate multiple railroad diagrams from one big chunk of text.

<rdg> is the text for the railroad diagram(s).

```
<$list filter="""[<rdg>split[/"BR"/]]""">
<$railroad text=<<currentTiddler>>/>
</$list>
```



Screenshot 2023-06-24 10.36.03 PM.png

Charlie Veniot

unread,
Jun 25, 2023, 10:05:58 AM6/25/23
to TiddlyWiki
Unsatisfied.  The tweak:

```
<$list filter="""[<rdg>split[/"BR"/]]""" counter=index>
<div style={{{ [<index>match[1]else[margin-left:100px;]]}}}><div style={{{ [[margin-left:]] [<currentTiddler>split[PAD"/]first[]split[/"]last[]else[0]] [[px;]] +[join[]] }}}><$railroad text={{{ [<currentTiddler>search-replace:g:regexp<pad>,[]] }}}/></div></div>
</$list>
```

Screenshot 2023-06-25 11.05.16 AM.png

Charlie Veniot

unread,
Jun 25, 2023, 11:35:14 AM6/25/23
to TiddlyWiki
Iterative and incremental tweaking.  Refining requirements in a "paint the picture and ask: is this what you mean? No, then tweak and repeat" process.

Come to realize looking at that last syntax diagram: nah, I want this chunk to be optional.  So tweak:

Screenshot 2023-06-25 12.21.38 PM.png

Charlie Veniot

unread,
Jun 25, 2023, 11:37:03 AM6/25/23
to TiddlyWiki
Next: editor buttons for the railroad diagram.  Because who wants to type in all of that notation bleurk...

Charlie Veniot

unread,
Jun 25, 2023, 1:18:53 PM6/25/23
to TiddlyWiki
The march towards a helpful editor for railroad diagrams:

Screenshot 2023-06-25 2.17.33 PM.png

Reply all
Reply to author
Forward
0 new messages