Export Writer document to MediaWiki format

On Ubuntu 22.04 I have default LibreOffice installed 7.3.5.2.

I also installed libreoffice-wiki-publisher package and logged off from Ubuntu and login again.

Then File | Export and there is no MediaWiki.

How to export Writer document to MediaWiki format?

I haven’t used media wiki but it might be worth reading this question from a few years ago. I hope it is still relevant, What is the MediaWiki Publisher extension?

2 Likes

@ErnestAI. This does not work for me. When I select File | Send there is no To MediaWiki option. Also I now see the idea about MediaWiki Publisher is to connect with Writer to MediaWiki and publish document. What I would like to do is to manually export document to .txt file and then open .txt file with text editor to check if transformation is correctly performed and then manually publish on MediaWiki.

The second option I tried is Edit | Find and Replace and then manually change some style to some text, but I can’t figure it out if this works or not.

Hello. How did you install the package ? apt, Synaptic, etc. I couldn’t find it at https://extensions.libreoffice.org/ Note : You don’t have to add a MediaWiki server to be able to export in MediaWiki format with libreoffice-wiki-publisher. It’s in File/Export like you mentioned in your question when the installation is OK.

There is the possibility to install LibreOffice directly from source. I installed from source LO 7.4.0.3 on Ubuntu 22.04.1 (Terminal-Based Install). I can export to MediaWiki. There is a .deb (LibreOffice_7.4.0.3_Linux_x86-64_deb/DEBS/libobasis7.4-extension-mediawiki-publisher_7.4.0.3-3_amd64.deb) in the file tar.gz that installs among others. I keep my older LibreOffice version (have a look at Should I uninstall the LibreOffice that comes with my Distro? section of this page : Installing LibreOffice on Linux). It seems complicated but it’s only few commands tar, cd and dpkg. Make sure you always have a backup of your important files on an external drive.

I also installed the package with the default 7.3.5.2 LO version on Ubuntu 22.04.1 by installing the dependencies and extracting the missing files in the extension directory from the source (.tar.gz). This method is a little longer and I’m not sure it will work for you. I can explain in details if you want and if my memory is good enough to repeat the steps in my Ubuntu ISO. It may work for you if you have a problem similar to mine :
In Menu/Tools/Extension Manager do you have libreoffice-wiki-publisher ?

  • If yes, you can click on it. Do you have an Options button ? Can you click on it or is it gray ?
  • Also, you can type cd /usr/lib/libreoffice/share/extensions than ls in a terminal, do you have wiki-publisher directory ? If so : type cd wiki-publisher than ls | grep "mediawiki.jar". This file and others where missing for me when I compared to a working version (7.3.5.2 from source).

I try installing libreoffice-wiki-publisher with Synaptic on Linux Mint 20.3 (LO 6.4.7.2). It works.

I try libreoffice-wiki-publisher Export to MediaWiki. It seems to work for bold and italic texts, hyperlinks (external), numbered lists, superscript and other basic formatting.

If you want simple code for tables, I’m not sure it’s the right tool. This is the code generated for only two cells :

|-
| style="background-color:transparent;border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding:0.097cm;color:#000000;" | A1
| style="background-color:transparent;border:0.5pt solid #000000;padding:0.097cm;" | <span style="color:#000000;">B1</span>
|-

The complete table in MediaWiki source editor (Wikipedia for example) :

{| class="wikitable"
|+ Caption text
|-
| A1 || B1
|-
| A2 || B2
|}

For ODT to MediaWiki there is also pandoc. With pandoc -f odt -t mediawiki -o testMediaWiki.txt testMediaWiki.odt in a terminal. With my tests, pandoc doesn’t keep formatting (bold, etc.). Don’t know if my command is wrong. Tables where not to bad, but not perfect.

I prefer working directly with MediaWiki editor with preview on my user space. Wikilinks are an important feature of MediaWiki. You cannot check for wikilinks validity in LibreOffice. Anyway I was curious to test the extension. Really not sure if you save time, but it’s interesting.