First version of Markdown export plugin

Can this export from TiddlyWiki5 server version?

GitHub - oeyoews/tiddlywiki-markdown-importer-cli: tiddlywiki importer/exporter with markdown This repository may be what you want.

You mean something like this?

I just want to say that I really appreciate the Markdown export plugin. It (combined with good old Pandoc) has been much better for sharing individual tiddlers than the static HTML export.

Michael,

Thanks for reawakening this thread, This related thread was raised TW text formatting for common social media. How? - #5 by TW_Tones

This solution by @cdaven does this conversion from the rendered HTML version that may be fed into Pandoc. However it takes the extra step and converts this to Markdown which is also a Pandoc format available for conversion.

I also made a copy html to clipboard in the past.

The advantages of markdown export includes;

  • It is the method used here in talk.tiddlywiki
  • It is more common than tiddlywiki script (I would like to change this)

However in retrospect I would ask if @cdaven could consider one simple addition to his plugin and that is to provide an additional button, on tiddlers, that copies the markdown format, it currently generates to the clipboard (rather than export). This would allow;

  • Quick per tiddler conversions without needing to access the file system
  • Ease of conversion, then save in a Markdown tiddler in the same or other wiki (using the markdown plugin).
  • Make use of for publishing etc…

@cdaven I just noticed this plugin is hosted on TiddlyWiki version 5.2.3 and unfortunately this includes the bug that can stop the plugin been dragged and dropped, from Chrome to Firefox and possible elsewhere. If it could be updated to a 5.x would help people acquire you plugin more easily.

Hi @cdaven , your plugin is great! Thank you!

I notice some strange substitutions with katex, i export this code to markdown:

<$latex text="
\begin{aligned}
&h > 2 \times C \rightarrow \text{Sapata muito rĂ­gida ou bloco}\\ 
\frac{2}{3} \times C \le &h \le 2 \times C \rightarrow \text{Sapata rĂ­gida}\\ 
\frac{C}{2} \le &h < \frac{2}{3} \times C \rightarrow \text{Sapata semi-rĂ­gida}\\ 
&h < \frac{C}{2} \rightarrow \text{Sapata flexĂ­vel} 
\end{aligned}">
</$latex>

And get this result:

$
\begin{aligned}
&amp;h &gt; 2 \times C \rightarrow \text{Sapata muito rĂ­gida ou bloco}\\ 
\frac{2}{3} \times C \le &amp;h \le 2 \times C \rightarrow \text{Sapata rĂ­gida}\\ 
\frac{C}{2} \le &amp;h &lt; \frac{2}{3} \times C \rightarrow \text{Sapata semi-rĂ­gida}\\ 
&amp;h &lt; \frac{C}{2} \rightarrow \text{Sapata flexĂ­vel} 
\end{aligned}$

I notice the symbols < or > are substituted by &lt and &lt, i can change this using the correct code in latex \lt or \gt, but the symbol & is needed to align the equation, so maybe the & symbol don’t need to be substituted or parsed (i dont know what i talking about :sweat_smile:)

Second, i think the <$latex text=" needed to be show as:

$$
\begin{aligned}
&amp;h \gt 2 \times C \rightarrow \text{Sapata muito rĂ­gida ou bloco}\\ 
\frac{2}{3} \times C \le &amp;h \le 2 \times C \rightarrow \text{Sapata rĂ­gida}\\ 
\frac{C}{2} \le &amp;h \lt \frac{2}{3} \times C \rightarrow \text{Sapata semi-rĂ­gida}\\ 
&amp;h \lt \frac{C}{2} \rightarrow \text{Sapata flexĂ­vel} 
\end{aligned}
$$
1 Like

Look at my answer at the Willing to export "Tiddlers" into a web site template engine like Grav - #6 by Offray thread. I’m using my own Brea instead of Jekill for static site publishing, but the part I’m talking about regarding using, in the future, TW on Bun, takes inspiration of @cdaven’s work to smooth the publication workflow.

1 Like

Thanks for bringing this to my attention. Sorry about the delay.

Version 0.6.5 of the plugin should (hopefully) work as you expect it to:

  • The equation will be rendered with $$ as a block if it is the only widget/element on the line
  • The characters <, > and & will be untouched, and not encoded as html entities
3 Likes

Sorry for the necro; but I happen to use ‘native’ markdown files in tiddlywiki. like with type:text/x-markdown; in conjecture with the official Markdown Renderer plugin.

Using this export plugin at the moment ‘mangles’ those native markdown files by assuming it’s wikitext, specifically in handling things like # and * which different between the two.

Can you add a slight update that will not transform the body text of a tiddler with type:text/x-markdown or similar? (maybe just check for ‘markdown’ anywhere in the type: field?)

Anyway I think that would be useful; especially if people have wikis that contain both wikitext and markdown typed tiddlers.

Let me know your thoughts!

-Xyvir

It is possible to first render the tiddler, applying markdown/WikiText and TiddlyWiki script to generate the result and only then capture the result. Currently out of the box this will be HTML, so if your target platform accepts HTML there is nothing more to do, however I believe there are new features in 5.4.0 that allow more robust parsing and return, so I would not be surprised if new conversion opportunities exist, and example may be converting the render to generate an intermediate markdown before rendering as HTML, allowing the intermediate result to be copied for pasting as markdown or into Pandoc.

I do believe we should make it a priority to be able to add tiddlywiki to the pandoc formats or at least have a path to enter the Pandoc ecosystem through markdown.

I note Pandoc does accept html input;

  • The internals plugin allows you to view and copy the rendered html
  • I have made a copy rendered html to clipboard button previously
  • There will be issues with included media
1 Like

Absolutely. We can do this, and it gets us a little further. But the trouble is simple: it’s still static. Most – in fact, I daresay, a vast majority of – Markdown-based sites have one simple form of dynamic behavior: through links or menus, you can choose which of your many Markdown documents to view/edit. That is useful.

But TiddlyWiki does so much more. I can write a simple button that let’s me choose whether to include the simplified version or the more complete one of every tiddler on the page. I can perform calculations on the fly from a dynamic subset of my content tiddlers. I can change layouts with a keystroke. I haven’t had time to investigate the thread @Ste_W has created, but it looks from afar as though he’s creating spreadsheet like behavior just using TW’s features. Look at the work @Springer has done to help display content that is only implicitly present. Look at all the tools @EricShulman, @pmario, @saqimtiaz, @telumire, and so many others put out there.

I haven’t spent a great deal of time with any of them, but I’m pretty sure Obsidian, Joplin, Notion, log-seq, and all their ilk, have little of this flexibility. And if they do, it’s probably supplied through external plugin written by coders, not written with the same tools used for all other content by regular users.

There is plenty of use for such fairly static sites. I do a lot of documentation with Docsify, and have used Hugo and a gazillion other SSGs. I would love to be able to interoperate better with these. The work in this thread you’ve resurrected offers one promising start to that. But it will always be limited to a small subset of TW’s potential. I don’t see any way around that.

2 Likes

You are correct, I have played with some of these PKMSs and none of them implement the full power of transclusions and filters as first-class citizens quite like TW.

Also tiddlywiki/wiki text /filter syntax is extremely syntax light, terse and as it follows more extendable in comparison to what these others offer.

3 Likes