Need to convert Markdown to Wikitext
November 1, 2017 1:30 PM   Subscribe

I've got a very long file in Markdown that I need to convert to Wikitext and I'm having trouble.

I'm trying to work on a Wikia for a podcast I like and we want to make a list of episodes. We have the list from RSS in Markdown; you can see an example of the raw code for the first 3 episodes here on Wikia. We want to end up with a table with the columns Title, Airdate, Episode Number, Link, and Episode Description, and all that data is already there. It's okay if we have to split it by every 100 episodes to shrink the file size.

The three of us working on this can't figure out how to convert that code into Wikitext (I'm not sure if that's very different from MediaWiki's code format.) My only experience is really with find and replace in a notepad editor. I found Pandoc recommended for this but it has no GUI and so I'm having a lot of problems with it. I have Python installed on my Windows PC but I seem to have trouble running Python programs (as an example, Plexpy is another Python program I've tried to use.)

One of the other folks working on this managed to convert the first ten episodes as a sample to an XLSX file, but that looks like it would take her a very long time (there's over 900 episodes).

Is there either a Windows program or a web interface where we can (fairly easily) convert the code? Or do you have any alternative suggestions?
posted by IndigoRain to Computers & Internet (8 answers total)
 
I'd see if Pandoc has wiki formats that work for you.
posted by conic at 2:18 PM on November 1, 2017 [1 favorite]


You mention that Pandoc is giving you some headaches on the command line. It might well be a good solution though - there's a form here:

https://pandoc.org/try/

...that you can use to see whether it will at least do the kind of output you need, which might be helpful for deciding whether it's worth further effort.
posted by brennen at 3:05 PM on November 1, 2017


The approach to one offs is to make a bunch of small (unix tools shine here) passes, creating a sequence of temporary files that can be worked on one after another simplifying each step. A good editor (cough emacs) is worth the trouble to learn. So what I'm getting at, Pandoc may not directly do the conversion but it make convert your file (try plain text) to a form that is easier to work with in the wiki format.
posted by sammyo at 3:08 PM on November 1, 2017


So after checking out the http://community.wikia.com/wiki/Help:Tables/Wikitext help page, it seems like your output is pretty close to the desired formatting.

If you change this part:
! scope="col"|Episode Number
! scope="col"|Publication Date
! scope="col"|Title
! scope="col"|Description
! scope="col"|Link

To look like this:
!Episode Number
!Publication Date
!Title
!Description
!Link


It should work.

I made an example page on your wiki and I think it's doing what you want.
http://techstuff.wikia.com/wiki/Test_page_for_table_formatting?venotify=created


Sorry if that doesn't answer your larger question about conversion, but assumed there wouldn't be too many of those to change via find and replace.
posted by megamanwich at 3:21 PM on November 1, 2017


Though after further investigation, your original code does work, so perhaps I've grossly misunderstood the problem. My apologies.
posted by megamanwich at 3:27 PM on November 1, 2017


Can you post the markdown to pastebin or gist.github.com and then bring the link here?
posted by czytm at 10:10 AM on November 2, 2017


Also where are you trying to use this wikitext? Somewhere besides mediawiki?
posted by czytm at 10:11 AM on November 2, 2017


Brennen, thank you, I forgot to mention I tried it and it didn't work. This was the output.

megamanwich thank you, I'll give that a try.
posted by IndigoRain at 3:54 PM on November 2, 2017


« Older What do you put in your quiche?   |   Simple IRA: to keep or not to keep? Newer »
This thread is closed to new comments.