Search code examples
pythonwiki-markup

Wiki markup language with excellent table support


I'm developing a wiki with Python/Django, partly for educational purposes. Up to now I'm still missing the right markup language. I tried quite a view, including Creole and Markdown, which worked well except for the table support. Common wiki markup languages seem to support only rudimentary tables, i.e. a single line per cell or no complex markups within cells. But the users of my wiki want to be able to create tables with bigger formatet text and lists within the cells. I have my problems with finding a markup language which actually can do this.

I've gazed upon the MediaWiki markup language which seems to support everything but I think using this would be overkill. The rest of the markup can be quite simple with focus on easy-writability of markup (I find MediaWiki markup somewhat ugly sometimes). Furthermore, there must be a Python module for translating markup into HTML which I can use in the webapp. I'm still looking for one for MediaWiki markup.

Another alternative would be to dump wiki markup languages at all and instead allow a set of defined HTML tags for markup. But that makes it harder to write wiki articles, since HTML is not invented for such use. and also finding and escaping forbidden HTML could be quite tricky. I would rather have a nice markup language with a lightweight Python implementation.

Does anyone know of a markup language with extended table support and an implementation in Python which I could use?

Thanks in advance!


Solution

  • I have found a solution myself since I found reST to complicated to use for technically inexperienced users. I might be a bit elaborate but it works for me.

    The key is an extension for an already existing markup language. I found Markdown rather pleasant, despite its lack of table support. Using Python-Markdown, here is everything you need to know for writing your own extension. It's not that complicated. I hacked something together in half an hour and it actually works so far. I would show the code here but I'm not really proud of it yet ;) Basically, you parse a markup block and insert the table elements in the DOM as you like.

    I guess every usable implementation of a markup language should have some kind of extension mechanism, so it should be possible to write extensions for other languages and implementations, too. That's not the most convenient solution but still better than using some ugly language just for the feature's sake.