This is the markdown export plug in by cdaven. Is it possible to make use of this plug-in to create a view toolbar button which can do any of the given below functions -
clone a wikitext tiddler to convert and save it as a additional markdown tiddler
replace the original wikitext tiddler with its markdown copy
copy to clipboard the tiddler content in markdown format.
I couldn’t find any clues after going through the markdown export plug-in tiddlers.
Hmm… I didn’t know about this plugin and it seems like a good jumping off point. I’d like to convert a back catalog of wikitext tiddlers to markdown but exporting one by one and reimporting seems like it would be a chore.
@Mark_S this md-to-tid viewtoolbar button works well - check this markdown tiddler and click on the viewtoolbar button to see the conversion happening.
@linonetwo is it possible to create a viewtoolbar button that can do the reverse, tid-to-md conversion. If that happens it would be super easy to switch between md and wikitext formats of a tiddler just on a button click.
Which doesn’t look to bad. I assume the stuff (mostly meta) floating on the right has something to do with the extra markdown plugins you have installed.
My bad. I was testing your code in a wiki without markdown plug in. That was the missing point. Now only I realized that. When I set up the demo wiki, I accidentally set it like an md-to-md conversion. Now I have corrected the demo. I also added type="text/markdown" to the set field widget. Now its working.
Can this code be modified to create a view toolbar button which converts the wikitext in the tiddler text field to markdown format and change the tiddler type field to text/markdown
After closing the button tiddler from the storyriver, I tried to convert one wikitext tiddler to md and it was working. Reverse conversion from md to wikitext was possible with md-to-tid convertor by @linonetwo .
How to improve my code to avoid the error due to too much recursion and also how to avoid the front matter during this conversion?
Adding a list filter like shown in the code above resolved the recursion issue. Can you suggest a better filter
Now how to avoid the frontmatter during the conversion?
So here’s a kit to make a tw-to-markdown edit toolbar button. Note that I overwrote one of cdaven’s plugin tiddlers to remove the meta info, so it can’t be used in the node export mechanism (because the meta info is now missing).
Thank you @Mark_S for putting so much of effort on this.
Any particular reason why you preferred it as an editor toolbar button.
If I remember correctly, you do use markdown in your wikis. Any downside for using markdown and wikitext tiddlers intermixed in wikis. I was thinking whether I should use markdown for study note tiddlers.
Oh dang. You meant the other toolbar. Well, they’re about the same.
I keep wondering that too. Markdown is not, out of the box, as extensive or sensible as wikitext. But almost certainly markdown will still be here in 20 years. So … flexibility, or longevity?
I guess you can forge the way and tell us all how it goes mixing up the two types.
Edit:
Here’s the view toolbar. The button will disappear after the conversion to reduce possibility of running a tiddler through twice. The other JSON needs to be previously loaded.
I want to try markdown in my note tiddlers mainly because of the perceived longevity aspect . Lets see how it goes. Because real-time conversion from md to tid and tid to md is now possible as a result of the two toolbar buttons as mentioned in this thread, I don’t see any problem in trying markdown for sometime.
Thank @Mark_S once again for sharing the viewtoolbar button.
Another doubt:
Have you tried referencing local images using relative path in markdown tiddlers. In my wikitext tiddlers its working. But when I tried to convert a wikitext tiddler containing local images referenced via relative path, the syntax of the converted images was like this 
For example in wikitext the image syntax was [img[media/Tweet-ASK_MSK-septo-optic dysplasia2023_2_24 18_09_51.png]]
On md conversion, the image syntax becomes 
The image is not getting rendered with this md syntax , while the same image in wikitext syntax get rendered in markdown tiddlers also. What is going wrong here ?
Coffee tiddler is taken from a tweet made by a doctor whom I follow in twitter - https://twitter.com/theliverdr - he is a hepatologist from my state (Kerala)- a controversial guy since he tweet much against traditional medicine here in India. If you search his timeline you may find something about oatmeal.
I will try my luck there. … my wikis are loaded with lots of external local images which I reference using relative path. I will have to find some way to get images working if I have to use markdown.