Tid2md.py: Convert WikiText tiddlers (.tid) to Markdown tiddlers (.md)

Hi TiddlyWiki users,

I would like to share my Python script that I use to convert WikiText tiddlers (.tid) to Markdown tiddlers (.md):

https://github.com/MaxGyver83/tid2md

Markdown has the advantage that it’s used in many places (p.e. GitHub, GitLab, BitBucket, StackOverflow, Reddit) and is supported by many editors, parsers and other tools. When you often copy tiddlers (or parts of them) to other websites or when you edit/process your .tid files with tools except TiddlyWiki itself, it might make sense to write your tiddlers in Markdown or migrate those already written in WikiText to Markdown.

I also use this script to create a static version of my wiki directly (meaning not using TiddlyWiki) from the .tid files. Of course, there is a second step necessary to convert the resulting .md files to HTML. But it’s much faster than using tiddlywiki /path/to/wiki --render '$:/core/templates/alltiddlers.template.html' /tmp/static_wiki.html text/plain and the resulting HTML file is much simpler.

If you are interested, just try it (on a copy of your wiki) and create an issue if something does not work as expected.

Best regards,
Max

P.S.: Sorry for this duplicate post. Mohammad pointed out to me that my Google Groups e-mail was added automatically as read-only post to this forum and it would make sense to start a topic here directly to allow responses.

6 Likes

Hi Max,
Welcome to the community!
and many thanks for sharing this useful script! Much appreciated.

1 Like

Great work @MaxGyver83

Your post reminded me to look up TiddlyWiki support in Pandoc. There has been zero progress on TW support in Pandoc.

Unfortunately, Pandoc is in Haskel; otherwise, we could have built a PR on top of your work.

Unfortunately, Pandoc is in Haskel;

Interesting. I didn’t know that. Unfortunately, I don’t know any Haskell. Otherwise I would love to contribute.

This is great. I’d also like to use it for the exact workflow you have developed it for – to create a static site, and if possible work with a markdown note taking tool like Logseq or Obsidian. Thank you.

Great work, but I hate to manually run PI scripts locally. Is there someone who want to create plugin for this? MD2TID works well, but this way is usefull too.

Although Pandoc is written in Haskel, it uses LUA for filters/scripting. (Why!? But I digress).

Somewhere on the google forum I posted a LUA filter for converting MD. I don’t remember if it was for MD to tid or tid to md, but it might be a useful starting point for someone.

2 Likes

Hi Max, What script do you use to create a static version of your wiki from markdown files? Thanks!

Hi anthrospeak,
sorry, I somehow missed a notification. Actually it’s not a single script but a small set of scripts. These are included in my private TiddlyWiki repository. I don’t want to make it public because it contains personal notes. I’m thinking about creating a public repo only for these scripts. Not today, but I’ll tell you!
Best regards,
Max