Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Excel documents to wiki markup

Is it possible to convert Excel spreadsheets into MediaWiki markup? I stumpled upon strange recommendations exporting to HTML and convert it into markup. Is there a solution, maybe exporting to XML first or directly converting it?

like image 636
user366121 Avatar asked Aug 11 '10 10:08

user366121


2 Answers

I know of three options:

  1. Install a WYSIWYG editor extension like FCKeditor (see also Official). Advantage: fairly easy Paste As Word (and therefore also as Excel) button. Disadvantage: installation can be tricky.
  2. Use a macro in Excel. Advantage: a one-click creation of markup. Disadvantage: client-side solution (so need it for all users).

My preference is the FCKeditor option because once it is installed it works pretty well.

like image 169
Reinstate Monica - Goodbye SE Avatar answered Oct 18 '22 20:10

Reinstate Monica - Goodbye SE


You can do this in a graphical interface, with proper software.

  • Install LibreOffice and add the "wiki publisher" extension, often contained in a package named libreoffice-wiki-publisher.
  • Open your spreadsheet with LibreOffice Calc, copy your table.
  • Open a new Writer document, paste with Edit > Paste special (RTF style).
  • Find "Export" in the menu, select "MediaWiki (txt)" in the format dropdown and confirm.
  • (Optional.) In your preferred text editor, remove any excess table HTML markup with a couple of simple text replacements and replace the first line {| with {| class="wikitable" to have pretty backgrounds and borders.

LibreOffice is free/open source software and is better than Excel at handling Excel's own spreadsheets, as you see. There used to be an Office plugin too but I've not heard of anyone using it recently.

You may need table styles, available in LibreOffice 5+; but in the meanwhile you can just apply CSS classes to your MediaWiki table.

Alternatively, just copy and paste your table in a page powered by VisualEditor, which is quite good for tables. If your wiki doens't have it, you could still use the MediaWiki.org sandbox: paste your rich text, click the pencil button at the top and then "wikitext/source editing", cut the wikitext and paste into your wiki.

like image 37
Nemo Avatar answered Oct 18 '22 21:10

Nemo