[tw5] Another example: one TiddlyWiki acting like a "server" to another TiddlyWiki

The BASIC Anywhere Machine has the IDE and a bunch of BASIC programs.

The BAM Programming Reference is all about documentation. Unlike typical documentation that just shows static code, this programming reference shows static code and provides a button to run that code. It is nice to see what the code does.

To investigate BAM’s compatibility with GW-BASIC, I’ve setup the programming reference with a Compatibility with GW-BASIC tiddler to track things, including displaying in an iframe a tiddler from the BASIC Anywhere Machine that lists GW-BASIC programs that have been tested (and possibly tweaked) to work in BAM.

Screenshot attached.

The “artifacts” of interest:

In the Programming Reference TiddlyWiki:

The code that says “hey, show me GW-BASIC Examples here”:

{{GW-BASIC||tEx}}

The “tEx” template (in the process of cleaning it up, just showing the relevant content):

<iframe src={{{ [[https://basicanywheremachine.neocities.org/BAM_IDE.html?target=]] [<currentTiddler>split[#️⃣]first[]else<currentTiddler>] [[#View%20Program]] +[join[]] }}} style="width:100%;height:500px;resize:both;overflow:auto;">
</iframe>

Aside: I use the :hash: character to quickly add extra some extra info to make a tiddler unique when two tiddlers have otherwise the same title. Ignore that.

Over in the BASIC Anywhere Machine:

The “View Program” tiddler has the rest of the magic:

<$list variable="thisTarget" filter="[[$:/info/url/search]get[text]removeprefix[?]split[&]removeprefix[target=]uppercase[]search-replace:g[%20],[ ]]" >

! <<thisTarget>> Sample Programs

<$vars caselessTarget={{{ [<thisTarget>search-replace[$],[]addprefix[(?i)\b]addsuffix[\b]] [<thisTarget>split[]match[$]addprefix[\]] +[join[]] }}}>
<$list filter="[tag[.bas]regexp:description<caselessTarget>]">

<details> <summary><<currentTiddler>>{{||Run Basic Program Button}}</summary>
<div style="margin-left:5px;border-left:1px solid lightgray;">

{{!!text}}
</div>
</details>
</$list>
</$vars>
</$list>

1 Like