docxpandocheadingdokuwiki

Pandoc Word to Dokuwiki heading conversion


I am trying to convert a word docx file to dokuwiki using the pandoc command line utility. There are no errors, and lists are correctly converted.

However, heading formats are not recognized at all. I set the headings in the word file using the styles. The dokuwiki format should then use the = to delineate different levels. This does not work. I tried with -f docs+styles but no luck.

Anybody know what I’m missing here?


Solution

  • The template word file made available in pandoc contains the heading styles needed in word to correctly identify headers. The following command will place the template in the current directory:

    echo '# myheader' | pandoc -o output.docx
    
    1. Copy your text into this DOCX file.
    2. Open the styles pane and scroll down to find all the styles named Heading 1, 2, etc...
    3. Use these styles for the heading levels you want to use in the dokuwiki file (start with Heading 1 for the most top-level heading style).
    4. Save this document and use it as the input for the pandoc conversion.
    5. All headings will be converted to the correct dokuwiki formats.

    Thanks to mb21 for the answer!