Hi Mohammad

>    1. The tiddler contains nasty characters in their titles like (space /\;  
> ) results in uggly filename! Like --render the message tm-zip-render-file can 
> have a filename-filter to avoid this.

Just like under Node.js, we’re currently “uri encoding” the tiddler titles. 
It’s a simple way to guarantee that we don’t generate illegal filenames.

With tm-zip-render-file one can use a filtered attribute to apply this 
processing as in the examples:

<$action-sendmessage $message="tm-zip-render-file" $param="$:/temp/_ZipTiddler" 
filename={{{ [<currentTiddler>encodeuricomponent[]addsuffix[.html]] }}} 
tiddler=<<currentTiddler>> template="$:/core/templates/static.tiddler.html"/>

>    2. If commend 1 is implemented then we need a variable to let correct the 
> links of tiddlers their filename corrected as step 1 above

The static templates already include a definition of tv-wikilink-template that 
allows manipulation of the generated tiddler links.

> I see alto of potential here and this plugin can be simple and powerful tool 
> for publishing not only static pages but also epub and like that

Great, it’s something I’ve been meaning to do for a few years.

Best wishes

Jeremy

> 
> 
> Best wishes
> Mohammad
> 
> 
> 
> 
> On Sunday, May 3, 2020 at 1:06:01 AM UTC+4:30, Jeremy Ruston wrote:
> A disadvantage for some users of TiddlyWiki’s static site generation 
> capabilities is the requirement to use Node.js. I’m therefore pleased to 
> announce an update to the JSZip plugin that makes it practical to render 
> medium sized static sites in the browser, without needing to use Node.js.
> 
> https://github.com/Jermolene/TiddlyWiki5/commit/6a0ff7db1807f45b73061ced82f5a85f1a529bbf
>  
> <https://github.com/Jermolene/TiddlyWiki5/commit/6a0ff7db1807f45b73061ced82f5a85f1a529bbf>
> 
> The updated plugin adds a handful of messages that can be used in the browser 
> to:
> 
> * create a blank ZIP file as a tiddler of type "application/zip”
> * add text files to a ZIP tiddler
> * download a ZIP tiddler as a .zip file
> 
> To try it out, visit the prerelease and review the docs:
> 
> https://tiddlywiki.com/prerelease/#%24%3A%2Fplugins%2Ftiddlywiki%2Fjszip 
> <https://tiddlywiki.com/prerelease/#$:/plugins/tiddlywiki/jszip>
> 
> The complete code to save a static site looks like this:
> 
> \define actions-render-static-site()
> <$action-sendmessage $message="tm-zip-create" $param="$:/temp/_ZipTiddler"/>
> <$list filter="[all[tiddlers]!is[system]limit[100]]">
> <$action-sendmessage $message="tm-zip-render-file" 
> $param="$:/temp/_ZipTiddler" filename={{{ 
> [<currentTiddler>encodeuricomponent[]addsuffix[.html]] }}} 
> tiddler=<<currentTiddler>> template="$:/core/templates/static.tiddler.html"/>
> </$list>
> <$action-sendmessage $message="tm-zip-render-file" 
> $param="$:/temp/_ZipTiddler" filename="static.css" 
> template="$:/core/templates/static.template.css"/>
> <$action-sendmessage $message="tm-zip-download" $param="$:/temp/_ZipTiddler" 
> filename="myzip.zip"/>
> \end
> 
> <$button actions=<<actions-render-static-site>>>
> Render site
> </$button>
> 
> Performance is a bit sluggish with large zip files (>2MB on my desktop 
> machine) but otherwise it seems to work well. I’ve got an idea for improving 
> performance that I’ll work on if I have time.
> 
> Questions and comments welcome.
> 
> 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+unsubscr...@googlegroups.com 
> <mailto:tiddlywiki+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/f586d3ed-07e5-4491-b3dc-08f4b1d4acf5%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/f586d3ed-07e5-4491-b3dc-08f4b1d4acf5%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/DCBE21C0-F5BF-41E9-A124-BBB548714C47%40gmail.com.

Reply via email to