A viable alternative for TiddlyWiki content export

44 views
Skip to first unread message

Charlie Veniot

unread,
Sep 24, 2022, 3:17:07 PM9/24/22
to TiddlyWiki
I just released a new version of BASIC Anywhere Machine (aka BAM) which has an implementation of the LPRINT statement.

The statement takes a string expression and provides it for download to a file via the web browser's standard "Save File As" dialog.

It is a way of getting text output out of a BASIC program.

Which got me thinking...

It is easy to have a BASIC program include, at runtime, any content from TiddlyWiki.  The "preprocessor" in BAM views TiddlyWiki syntax as "meta commands" that should render as something that BASIC recognizes as valid BASIC syntax.  Like "DATA" statements used by "READ" statements, or values assigned to BASIC variables, or values returned by BASIC functions.

Although it is easy to create a TiddlyWiki export option (once one has figured out, short of documentation, how out-of-the-box TW exports work), I think a BASIC program in TiddlyWiki makes for a viable alternative.

Something I'll be chewing on and maybe proving with code in a future video.

For now, you might be able to imagine the potential via this introduction to LPRINT in BASIC  Anywhere Machine:


Charlie Veniot

unread,
Sep 24, 2022, 6:11:27 PM9/24/22
to TiddlyWiki
Well, that was ridiculously easy.

Download the attached and drag into TiddlyWiki.com to import tiddlers

Two screenshots below:

Imported tiddlers:

Screenshot 2022-09-24 7.09.28 PM.png


The "BASIC Program for TW Export"  (find it and click on RUN):
(a blend of TiddlyWiki and BASIC; TiddlyWiki scripting to dynamically generate the BASIC program)
(strings in BASIC are enclosed in double-quotes; if a tiddler title happens to have a double-quote, it gets replaced by that chr$(34) stuff.)
Screenshot 2022-09-24 7.04.16 PM.png
BASIC Program for TW Export.prod.bas.json

Charlie Veniot

unread,
Sep 24, 2022, 6:50:20 PM9/24/22
to TiddlyWiki
And follow-up show'n tell video:

Charlie Veniot

unread,
Sep 25, 2022, 12:27:25 AM9/25/22
to TiddlyWiki
Thought: using this is a way to create a file for a set of tiddlers, one file per tiddler, based on a template for output.

Say a form letter that needs to be generated for a bunch of individuals in a group.

It would mean having to deal with File Save As for each file.  But not horrible if it is a reasonably small number of files.

I am thinking of an enhancement in which file names are automatically generated, so then it would just be a matter of clicking a button for each file without needing to enter a file name.

Reply all
Reply to author
Forward
0 new messages