# 2017-04-28 Markdown vs Wiki Creole

Remember Creole, the markup language for all wikis? These days, I’m starting to think that we should just move on and simply switch to Markdown.

I would like to switch this wiki and see how it goes. If it turns out to be necessary, I will publish a migration script. When I tried it, there were immediate problems regarding numbered lists, headers, and tables. Ugh!

For now, here are some of the global search and replace operations I’m considering.

Numbered lists, and nested numbered lists.

• (?m)^#(?=\s)1. (affects 565 pages, some of them with code where the hash was used for comments, this is a major pain and requires manual review!)
• (?m)^(?=\s)## → ## 1.## (11 matches; not sure this is supported, actually)

• (?m)^=(\s.*?)\s*=+$#$1 (1 match)
• (?m)^==(\s.*?)\s*=+$##$1 (170 matches)
• (?m)^===(\s.*?)\s*=+$###$1 (10 matches)
• (?m)^====(\s.*?)\s*=+$####$1 (2 matches)
• (?m)^=====(\s.*?)\s*=+$#####$1 (0 matches)
• (?m)^======(\s.*?)\s*=+$######$1 (0 matches)

Creole style headings. These are much more lenient so I am expecting more trouble.

• (?m)^=\s#  (1 match, watch out for math stuff; this requires manual review)
• (?m)^==\s##  (46 matches)
• (?m)^===\s###  (9 matches)
• (?m)^====\s####  (1 match, which required manual review because it was about markup)
• (?m)^=====\s#####  (0 matches)
• (?m)^======\s######  (0 matches)

Source code. This requires some manual interverntion because ##### turn into \# and the like.

• (?m)^(\{\{\{|\}\}\})$ →  (449 matches) Tables: The first row already gets the th element instead of the td element, so I think we should be fine just changin |= to |. • \|=| (72 matches, some of them used in Perl code and thus also requires manual review!) Quoted text using ##hashes## is also tricky. • ##(\S.*?)## → = \$1

Escaped WikiWords.

• !((?-i)\p{Uppercase}+\p{Lowercase}+\p{Uppercase}\p{Alphabetic}+)\b\$1

Tags:

Not sure if that’s the best move. Sure, most things support Markdown (kinda), but Markdown does not even have tables… oops.

There’s CommonMark, and that’s what you should use, but it has its own problems.

There’s just no way to win :|

– AlexDaniel 2017-04-28 22:56 UTC

Also, perhaps it’s worth mentioning that Github renders markdown comments, markdown wiki pages and .md` files differently, so you’re dealing with three different markdowns…

– AlexDaniel 2017-04-28 22:57 UTC

Sadly, you are correct. But all the text editing stuff on iOS I have used is either plain text or Markdown, e.g. iA Writer. GitHub and its large family of friends uses GitHub Flavored Markdown. Have you seen The Homebrewery? If you write stuff for D&D 5 or if you like the looks of it, here’s a tool to create awesome looking PDFs using Markdown, online, with menus to insert tables for classes, spells, monster stat blocks, and so on. And it is so beautiful and fast, it nearly makes me want to cry. Even the sample text used to fill the templates is great. This is just great.

(Still fiddling with the formatting rules.)

– Alex Schroeder 2017-04-28 23:02 UTC

The Common Markup spec raises interesting questions. Curious minds want to know about the corner cases. But as far as I can tell, it doesn’t have tables, right?

– Alex Schroeder 2017-04-28 23:15 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.