Using TiddlyWiki to write pages for MediaWiki sites like wikipedia, wikiversity and wikibooks

I have started developing a Wikiversity project which involves creation of a significant amount of content in mediawiki.

Is anyone aware of any plugins that could all me to generate pages in mediawiki (using lists, filters, etc. to scoop up tiddlers into my pages), and export an output file that could be imported into the wikiversity site? I’d even be interrested in generating tiddlers that I could copy/paste into wikiversity.

My experience so far: mediawiki is a terrible environment for generating text and organizing ideas, and tiddlywiki is far better. Wikiversity and Wikipedia are excellent platforms for sharing knowledge. So I’ll try to use both…

Thanks!

//steve.

I know of nothing, and I think it would be a big job to create something. But I agree that if it existed, this could be an extremely useful workflow for complex documentation.

1 Like

I did find a stackoverflow post from 9 years ago asking the same thing…

Media wiki is closer to markdown than tw wiki text so using the markdown plugin will get you closer.

Other options exist and looking at conversion tools may help such as “pandoc”. Both tw and mediawiki generate html

Of your look at the internals plugin you can see html and I could imagin some conversion tools.

I think it’s its own beast, with some things closer to Markdown, but the majority (including choice of the name “wikitext”) is probably closer to TW’s wikitext. It is missing many of TW’s features, of course since it’s meant for static text, and has some things neither TW wikitext nor Markdown have. The most striking difference from Markdown is that Mediawiki does have transclusion.

My thought perhaps mostly because I’m s a JS developer, would be to do something like this from the internal tree structure, and not to try a markup-to-markup conversion. But although I’d love to see it done, and would happily cheer from the sidelines, it’s not something I am interested in taking on now.

Writing a pandoc converter between TiddlyWiki and MediaWiki shouldn’t be that hard (and I might take the time to do it if I remember). After that, you could copy the tiddlers into pandoc and then the media wiki. Writing a script to do it automatically wouldn’t be the worst either as it could be done in python pretty easy.

* Edit: Why is pandoc written in haskell

* Edit 2: Ok, the reader and writers can be written in lua, less bad.

2 Likes

It would require a bit of elbow grease, but you could probably add a MediaWiki parser to TiddlyWiki with a custom plugin. There are JavaScript parsers for mediawiki format (e.g. https://github.com/spencermountain/wtf_wikipedia/tree/master/plugins/html) that might work as a base. The Markdown plugin (https://github.com/Jermolene/TiddlyWiki5/tree/master/plugins/tiddlywiki/markdown) would be a good template for adding a new markup language.

Thanks for the thoughts!

Here is a rather primitive approach using css to insert characters “before” and “after” each paragraph, based on style to insert mediawiki section markdown, that would then rely on the copy-to-clipboard. However, the characters inserted “before” and “after” are not captured by the TW copy-to-clipboard – any ideas why?

And an update: Using simple vars I can cycle through two levels of an outline with heading1, heading2, etc and 2 levels of bullets. One tiddler open in view mode, copy-all, and paste into mediawiki, and get very nice mediawiki code, including mediawiki transclusion!

<$vars 
1s="=" 
2s="=="
3s="==="
cbo="{{" 
cbc="}}"
b="•"
>

<$list filter="[tag[Topics]]">
<<1s>> <$link/> <<1s>><br>
<$list filter="[tag<currentTiddler>]">
<<2s>> <$link/> <<2s>><br>
<$transclude mode="block"/>
</$list>
</$list>
<$vars user="Stevesuny">
<<cbo>>Special:PrefixIndex/User:<<user>>/<<cbc>>

Hi @stevesuny we did some work on this problem back in the TiddlyWiki Classic days at Osmosoft. Martin Budden wrote a TWC pluggable parser that implemented MediaWiki’s syntax, and an adaptor for saving tiddlers to a MediaWiki server. (Search for “media wiki” at https://tiddlyvault.tiddlyspot.com). Together, that made it possible to edit and view MediaWiki content offline and then sync it back to a server. As @michael1 notes, a similar approach should work for TW5.

Thanks, Jeremy. Martin Budden’s wiki is archived at https://web.archive.org/web/20080612142242/http://www.martinswiki.com/.

Also found an old thread: https://groups.google.com/g/tiddlywiki/c/nhDr_nWbIk0 that discusses the Budden plugins.

I can get the “special characters” to be copyable using variables, but not using CSS: