Extract Tiddler Files From HTML Tiddlywiki

94 views
Skip to first unread message

Kevin Kleinfelter

unread,
May 10, 2018, 6:41:55 PM5/10/18
to TiddlyWiki
If I have a stand-alone HTML Tiddlywiki, is it possible to run a command line to extract the tiddler files which would be the result of running the GUI import into a node.js TW?  Excluding system tiddlers...

I see https://tiddlywiki.com/static/How%2520to%2520build%2520a%2520TiddlyWiki5%2520from%2520individual%2520tiddlers.html.  I'd like to go the other direction.  To complicate matters a bit, I have classic markup, TW5 markup, and markdown markup tiddlers in my HTML TW.  I'd like a way to automate an export into the related .tid and .md files.  

As explanation, I'd like to work with a HTML TW, save my file using WebDAV, and have the server generate a file per tiddler, so that an indexing process on the server can index the individual files.  I'm considering this route because node.js Tiddlywiki has some characteristics which make it unsuitable for some of my users.

Thanks!
-kevin

Jim

unread,
May 12, 2018, 9:58:14 AM5/12/18
to TiddlyWiki
You'll need a node executable and the TW5 source.

I'm using Windows. Here's a batch file example:

set node_exe="C:\Users\Jim\Downloads\node-v8.11.1-win-x64\node.exe"
set tw_js="C:\Users\Jim\Downloads\TiddlyWiki5-5.1.17\tiddlywiki.js"

set wiki_html=%1

%node_exe% %tw_js% --verbose --load %wiki_html% ^
--output ./tiddlers ^
--render "[!is[system]]" "[encodeuricomponent[]addsuffix[.tid]]"  "text/plain" "$:/core/templates/tid-tiddler"



Reply all
Reply to author
Forward
0 new messages