Converting Between Wavemaker and LibreOffice using Pandoc

I’m a great fan of www.wavemaker.cards. however, like everything in the digital world, there is a bit of finesse required to get multiple tools to play nice together.

Enter pandoc.

Pandoc converts documents with a minimum of fuss. The hardest part is using the command line.

The first I tried was wavemaker’s markdown export. I thought that would be best as markdown is just text and I wouldn’t have to worry about a million styling issues. Unfortunately, wavemaker’s markdown export gets tid of the hashes between chapters and loses the line break, so it became impossible to know where the chapter breaks were.

So I used the html export, instead. Now, I could have just copied the text from a browser to Libreoffice and called it a day, but I was already halfway there with pandoc.

So I followed the steps in the getting started docs and, 15 seconds later (I was typing slowly) I had my document.

And it was great… Except, as with all things, there was more to do. Mainly:

  • The quotes were straight, and I want curly quotes.
  • I wanted to get rid of the hashes and just replace them with a blank line.

Replacing the hash marks was easy: just use find & replace and enable regular expressions. Use \n to add a newline. I wanted 2 new lines, so I used \n\n.

The quotes required a few more steps. I have these listed here for my own future reference:

  • Change the entire document to Default Style. This didn’t seem to lose any formatting, but I was only using italics. If I had chapter headings or other formatting, this might cause issues. I may not have even needed to do this step, as I had gone down a rabbit hole before success.
  • Change the auto correct options to exclude Combine single line paragraphs if length greater than 50%. I have no idea why anybody would want this, but with it enabled it destroyed most of my dialogue lines.
  • Then simply apply autocorrect. All the quotes will become curly quotes, which is great.
  • Note: this should also affect single quotes, and apostrophes, but I had replaced them manually with find & replace.

Now that I have done it once, it will probably take 20 seconds to convert another document.

Leave a comment