Project

General

Profile

Converting a Wiki page into a MS Word file

The Electronic Design Notebook's underlying software (Redmine) uses textile formatting as its mark up language. Pandoc is a command line tool for converting one document (markup) format to another. It can convert a wiki page into a MS Word file. This document briefly introduces the basic conversion steps. A full pandoc user guide is found at http://pandoc.org/README.html.

Installing pandoc

Pandoc's home is http://pandoc.org/. If you are not using MS Windows, follow the installation instructions found at http://pandoc.org/installing.html.

For Windows, go to the download page from http://pandoc.org/installing.html. Click the button to download the latest installer. Note that the current installation package is pandoc-2.14.0.3-windows-864_64.msi, as of July 7, 2021.

Run the installer and follow the instructions.

Preparation Method 1 - Copying a wiki page into a text file

Pandoc can include images in a wiki page into the corresponding MS Word file. Both the text file containing the wiki and the images must be in the same folder.

  • First time only: Create a working folder.
  • Prepare the wiki text file.
    • Open the EDN wiki page.
    • Chose the edit option.
    • Highlight and copy the contents.
    • Go back to the previous page or close the tab (page).
    • Under MS windows, open a Notepad.
    • Paste the contents.
    • Remove any unnecessary items, such as {{toc}}, in the file.
    • Save the file in the working folder. Make sure to choose UTF-8 from the Encoding option that is left of the Save option.
    • Close the Notepad.
  • If two or more wiki pages must be converted, repeat the above steps.
  • Down load image files that are at the bottom of wiki page and save them in the working folder.

Preparation Method 2 - Creating a html file containing sub-wiki pages

This method does not retain attachments but includes sub-wiki text contents. Thus, images must be manually inserted into a MS Word file later.

  • Prepare the wiki html file.
    • Open the top wiki page.
    • Click Index by Title that is in the right column near the top of the page.
    • Click HTML that is one of "Also available in" options at the bottom the page.
    • The html file is saved in your Downloads folder. Move the file to your working folder.

Generating a MS Word file

You can find detailed instructions at http://pandoc.org/getting-started.html.

  • For Windows 7, hold the Windows key and press r. In the Run windows, type cmd and press OK.
  • Optional: Check pandoc is installed by typing:
    pandoc --version
  • Move to the working folder using the "cd" command.
  • Generate a MS Word file from text files containing textile markups by typing:
    pandoc -f textile -o output_file.docx inputfile1 inputfile2 ... 
  • Generate a MS Word file from html files by typing:
    pandoc -f html -o output_file.docx inputfile1 inputfile2 ... 

Post Processing

The following tasks must be manually performed.

  • Common
    • Figure captions, table captions, and cross-references must be added as needed.
    • Image sizes may have to be adjusted.
    • If a complex table is not correctly converted, the problems must be manually corrected.
    • Citations must be added as needed.
    • Adjust heading levels as needed.
  • Text Method
    • Internal links, such as a link to a sub-wiki page, must be manually created by choosing an appropriate Heading using the Cross-reference.
  • HTML Method
    • Insert figure in the Word file.