\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>
To try it out, visit the prerelease and review the docs:
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/28c0f992-5f35-4927-8bf3-e59b0351bc7b%40googlegroups.com.
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.
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
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
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f586d3ed-07e5-4491-b3dc-08f4b1d4acf5%40googlegroups.com.
Wow, this is amazing! Thanks so much, Jeremy. Very useful and much easier for less technical users.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a1820e61-7ab1-4863-8e03-7750d4e072f7%40googlegroups.com.
Hi Mohammad
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
To try it out, visit the prerelease and review the docs:
The static templates already include a definition of tv-wikilink-template that allows manipulation of the generated tiddler links.
<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/HEEG/static.tiddler.html" exportFilter=<<quotedCurrent>>filename=<<filename>>/>
[<currentTiddler>encodeuricomponent[]addsuffix[.html]]
Yoni Balkind sadly Timmini does not have a Safari plugin...
And yes always good to give credits to TiddlyWiki! I personally have links to tutorials as well on mine: https://www.mentalnodes.com/about
\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>
[<currentTiddler>split[ ]join[-]addsuffix[.html]]
\define tv-filter-export-link() [split[ ]join[-]encodeuricomponent[]addsuffix[.html]]
(apologies if that's not what you're trying to achieve here!)
\define tv-wikilink-template() $uri_doubleencoded$.html
href
attribute on the HTML a
element generated by the $link
widget. The tv-filter-export-link
, if defined, it takes precedence over the tv-wikilink-template
variable." from https://tiddlywiki.com/#tv-wikilink-template%20Variable\define tv-wikilink-template() $uri_encoded$
\define tv-filter-export-link() [split[ ]join[-]encodeuricomponent[]addsuffix[/index.html]addprefix[/]]
[split[ ]join[-]encodeuricomponent[]addsuffix[.html]]
\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>subfilter{$:/config/static/export-link-filter}] }}} 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>
\define tv-filter-export-link() [subfilter{$:/config/static/export-link-filter}]
I am keen to make use of your great work here and the tutorials to match but there has being a lot of water under the bridge. If one or more of can isolate the key changes and package it the instructions will become simpler and even easier to document and teach.
Its easy to do with a good understanding of tiddlywiki which I have but I do not have a strong understanding in this particular subject.
Please give it some thought.
Regards
Tony
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/166113f6-6502-4693-b891-16f259c96a69%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAAV1gMB5CEK0w2B1J%2B-HW4cGLdtTFBSDxSFmX00pYSoJpmGqKw%40mail.gmail.com.
Everyone following my previous suggestions: Please note that the updated example replaces the 3 different steps in one go. Those steps will still work but are no longer necessary. See:
https://tiddlywiki.com/prerelease/#%24%3A%2Fplugins%2Ftiddlywiki%2Fjszip
The only potential improvement I would recommend is to use the subfilter trick as I outlined earlier, so you are writing the filter only once, for file names and links. This will make it easier to tweak the links and remove the need to make the change in two places.
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.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 fileTo try it out, visit the prerelease and review the docs: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 wishesJeremy
[lowercase[]split[ ]join[-]encodeuricomponent[]addsuffix[.html]]
I’ve just pushed an update that adds a new “slugify” operator to transform arbitrary tiddler titles into human readable form for use in filenames or URLs. The transformations applied are:
- If there is a tiddler with the same title that has a ''slug'' field, then return that field instead of running the following steps
- Replace uppercase letters with lowercase equivalents
- Transliterate diacritics to their basic lowercase ASCII equivalents (for example, "Æ" is transliterated to "AE")
- Replace spaces with dashes
- Remove all non-word characters except dashes and periods
- Replace multiple sequential dashes with a single dash
- Trim dashes from start and end
- If the result is the empty string then character codes are used instead (eg. "&£@" transforms to "38-163-64")
There is also a new duplicateslugs operator to detect when multiple tiddlers resolve to the same slug.I’ve also updated the JSZip example to use the slugify operator.You can try out the update at https://tiddlywiki.com/prereleaseBest wishesJeremy.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/166113f6-6502-4693-b891-16f259c96a69%40googlegroups.com.
--
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 tiddl...@googlegroups.com.
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.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 fileTo try it out, visit the prerelease and review the docs: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>
In summary, if anyone wants to write a guide, to adjust filenames and links (for single file wikis) I recommend this process as per my current understanding:
- create a tiddler called $:/config/static/export-link-filter and place here the filter that will operate on the tiddler title to transform it as you like, this filter will receive the tiddler title as input. For example:
[split[ ]join[-]encodeuricomponent[]addsuffix[.html]]- use this filter in the code for your export button:
\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>subfilter{$:/config/static/export-link-filter}] }}} 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>
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.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 fileTo try it out, visit the prerelease and review the docs: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>