[TW5] Help exporting to static HTML (and then word)

604 views
Skip to first unread message

Scott Hatcher

unread,
Mar 26, 2014, 10:39:49 AM3/26/14
to tiddl...@googlegroups.com
Hello,

I feel as though I'm nearly there, but also way off. There are similar questions on this group about doing the same thing (generating a static HTML document from all tiddlers, and then importing it into Word), but they haven't gotten me very far.

My situation is the same as most. A large TW written for a boss that wants a Word document. I'm going to keep both, and explain that one will be updated and the other be static. He'll just be happy once he sees a word doc exists.

the --render.allcontent shadow tiddler seems to be my answer, but I've also looked into plugins. I'm running a single stand-along .html document TW, and so there's no "plugins" folder. I'm completely confused.

What's the easiest way to generate a static HTML from the browser (save as?).

Thanks,
Scott

Jeremy Ruston

unread,
Mar 26, 2014, 11:21:22 AM3/26/14
to TiddlyWiki
Hi Scott

There's an example of how to save content in static HTML buried in the control panel: in the "tools" tab there's a big green button to "Download all tiddlers as static HTML". Clicking it should download a static HTML file containing all the non-system tiddlers concatenated together in alphabetical order.

The code that creates the button is in "$:/core/ui/ControlPanel/Tools":

<$button message="tw-download-file" param="$:/core/templates/alltiddlers.template.html" class="btn-big-green"><<lingo Export/AllAsStaticHTML/Caption>> {{$:/core/images/save-button}}</$button>

In order to change the tiddlers that are included, and control their ordering, you can overwrite the filter in "$:/core/templates/alltiddlers.content":

{{{ [!is[system]sort[title]] ||$:/core/templates/static-tiddler}}}

Best wishes

Jeremy




--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Scott Hatcher

unread,
Mar 27, 2014, 3:31:44 PM3/27/14
to tiddl...@googlegroups.com
Embarrassingly straight forward. Thanks very much for your help.

-Scott

CB

unread,
Aug 31, 2014, 1:48:50 AM8/31/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy, 

Is there a way to control the filename of the target file to be saved? As of now it prompts to save the output file with the same name as tiddly wiki. 

Thanks
CB

Alex Hough

unread,
Aug 31, 2014, 3:09:54 AM8/31/14
to TiddlyWiki
My planned use case is to generate static HTML file which would then be a stripped down version of my Tiddling  for public view.

How would I export only default tiddlers, or a list of Tiddlers?

Maybe it's not the best approach. Copying the .tid files over then generating a static from them might be easier?


Alex

Jeremy Ruston

unread,
Aug 31, 2014, 4:57:21 AM8/31/14
to CB, TiddlyWiki
Hi CB
 
Is there a way to control the filename of the target file to be saved? As of now it prompts to save the output file with the same name as tiddly wiki. 

The default filename for the download is currently set to the final portion of the URL of the wiki (eg, index.html). There's currently no way to override it.

Browsers other than Chrome appear to ignore any specified filename.

Best wishes

Jeremy

Jeremy Ruston

unread,
Aug 31, 2014, 5:07:01 AM8/31/14
to TiddlyWiki
Hi Alex

My planned use case is to generate static HTML file which would then be a stripped down version of my Tiddling  for public view.

How would I export only default tiddlers

There's an example at tiddlywiki.com/static.html which is a static view of the default tiddlers on tiddlywiki.com. It is generated by this command:

--rendertiddler $:/core/templates/static.template.html static.html text/plain

or a list of Tiddlers?

If you want an arbitrary list of tiddlers baked into a single file then you'd need to create a template.

For example, "mytemplate" could contain:

<$set name="tv-config-toolbar-icons" value="no">

<$set name="tv-config-toolbar-text" value="no">

<$set name="tv-config-toolbar-class" value="tc-btn-invisible">

<$set name="currentTiddler" value={{$:/language}}>

<$set name="languageTitle" value={{!!name}}>

<$set name="currentTiddler" value="">

<$list filter="tiddlerone tiddlertwo [tag[mytag]]" template="$:/core/ui/ViewTemplate"/>

</$set>

</$set>

</$set>

</$set>

</$set>

</$set>

Change the <$list> filter in order to select which tiddlers are included.

Then use this command to save the file:

--rendertiddler mytemplate mystatic.html text/plain

Or you can create a button to save the file in the browser:

<$button message="tm-download-file" param="mytemplate" class="tc-btn-big-green">Download</$button>

Best wishes

Jeremy

Alex Hough

unread,
Sep 1, 2014, 11:17:33 AM9/1/14
to TiddlyWiki
Thank you Jeremy,

I'll have a go...

Alex
Reply all
Reply to author
Forward
0 new messages