Willing to export "Tiddlers" into a web site template engine like Grav

This is the idea:

Use TiddlyWiki as source for pages and blog posts that will be imported into web site template engine like Grav (or suggested others)

This engine is using markdown files is /user/pages/ directory.
gravuserpages

Using special “taggings”, i could use an export command to do so

 tiddlywiki --load twindex.html \
   --output ~/tmp --render '.' "rss.json" \
'text/plain' '$:/core/templates/exporters/JsonFile' \
'exportFilter' '[days:created[-30]!is[system]tag[BlogArticle]]'

Then run a program on the resulting json,

  1. convert content into “md”
  2. use tagging logic like “01Page” “02Page”, “01Menu”, etc…
    Then fill Grav directory.

I remember reading about such a thing, but can’t find the subject anymore…
[edit] : How to use TiddlyWiki as a static website generator in 3 steps - Ness Labs

I wonder if some “exporters” exists already for this use case?
Any one have already made such usage?
Thanks for your help

1 Like

I don’t use the node version and the command line much, but inside a single file wiki you could follow how the current static tiddler exporter works, or JSON if that is what you want to export, copy it and make your own exporter, there is some information about making your own exporter on tiddlywiki.com.

  • This involves a template which you can modify to meet your requirements.
  • You can then export and test your output
  • Perhaps later you can then do it for multiple tiddlers at a time from the commend line.

In future I intend to use the zip plugin to help me name and export multiple files from my single file wiki, and thus may create a website template engine that way.

I don’t feel being able to create an “exporter” yet…

which web engine would you use?

Using CLI tiddlywiki and IPFS makes it a convenient place to store anything.
In my process list, seems I found a way to directly export in markdown format

https://cdaven.github.io/tiddlywiki/#Markdown%20Export%20Plugin

tiddlywiki <folder> --render <tiddler>  '[encodeuricomponent[]addsuffix[.md]]' 'text/plain' '$:/plugins/cdaven/markdown-export/md-tiddler'

Need to choose the “Tag logic” now …

Sorry, but my answer would be tiddlywiki. Using tiddlywiki as the engine to generate websites.

My main point is you can choose and craft the output template of your choice to generate the final result or prepare content in your tiddlywiki to generate an output that can be subsequently imported into another platform.

  • If this is too much work, or of value it is for you to decide.
  • I would look for a simpler method first, like via HTML or JSON if possible.

Sorry I can’t help much with the CLI

Hi @papiche here is an example of a wiki that contains a custom exporter that exports the selected content tiddlers as a static website.

Here’s the exporter tiddler within the source wiki:

Here’s the output static website:

https://federatial.com/

1 Like

We had a similar problem over here in HackBo, our local hackerspace and in fact, I have used and enjoyed Grav before. But theme customization in it became really annoying and the sources of information started to be more spread: pictures and sounds in Internet Archive, quick Markdown notes in HedgeDoc and so on. So, inspired by static site generators like Grav or Pelican, but also dealing with their limitations regarding customized data sources and publishing workflows and overcomplicated tech stacks, I created Brea (repo/docs) a Pharo/GT powered and still alpha “middle place” between a static site generator and a decoupled CMS.

Now, with TiddlyWikiPharo, we are making some experiments on how to use TW as the dynamic editor for the static site generator. Our last interactive document shows how we are querying the wiki and manipulating the data to do versioning (in Fossil SCM) and for taking a subpart and creating the site.

For example, here are some snippets taken from the subsection related with converting from the wiki to the web site.

This would select all artist of a recent exposition

artists := microwiki tiddlers 
	select: [:tiddler | tiddler tags includesAll: #('Artista' 'Perfil') ]

The following snippet creates a “Dokuwiki” page of all the artist in the previous collection (I use Dokuwiki format as quick hack because its resemblance with WikiText, but future versions would use TiddlyWiki conversors running on Bun, a NodeJS alternative):

artistsPage := '' writeStream.
artists do: [:each | 
	artistsPage
		nextPutAll: '===== ', each title, ' ====='; cr; cr;
		nextPutAll: each text; cr; cr
].
artistsPage contents withInternetLineEndings

I convert the page with: pandoc --from dokuwiki --to markdown artistas.doku -o artistas.md. And the next snippet takes the output page and inject into a particular page applying a given template:

artistsBreaPage := BreaPage new.
artistsBreaPage 
    shortName: 'artistas';
    folder: siteFolder;
    template: 'artistas.mus.html';
    bodyTag: 'contenido'.

The output looks like this:

While the procedure still has important improvement to be made, being able to edit and define our site data mode quickly in TiddlyWiki, while having a domain specific language (DSL) made on a general purpose programming language, to query, manipulate and publish such TW data has proven a pretty useful and flexible approach, particularly suited to our particular needs and where we have the best of all worlds: TW emergent structure, Pharo powered interactive executable documentation and a fast and beautiful static site. There is still road ahead, but the path seems promising.

2 Likes

Hi @Offray that’s great to hear, and I must say how much I enjoy it when I encounter your work. The way that you build your vision by combining multiple open source systems is powerful and has now built up to a very impressive system.

1 Like