Installing Zim + Ditaa On Win32

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Installing Zim + Ditaa on Win32

Dejan Budimir

2015-10-01

Motivation
I used to write my notes into plain old .txt files but I
kept losing track of them. I used to run Keynote,
which I loved (no buts). I used to use Tomboy
because I liked the name and its simplicity. Finally I've
found Zim and it felt cute and was Python hackable
so, for better or worse, I decided to stick with it.
To install it, simply grab it from here. I've installed the
Desktop version (the obsolete 0.60 version, since I
am still running winxp on this box).
The first thing I did was to scroll down its core plugins

list, turning on everything interesting. That's how I


found out about ditaa . I googled it. I loved it. I wan1

ted to have it. But I ran into a snag .

So here's how to set it up on Windows.

Basically, what happens is this. Zim's ditaa plugin (python script) will run a
dependency check looking for executable files called ditaa in your PATH. This
search will include batch files (*.bat). However, when it is about to launch the
ditaa.bat it will not append the .bat extension to its filepath and this will
confuse the subprocess.Popen() call, which wil expect an .exe file.

Download the ditaa executable


Grab it from here and simply extract it somewhere.

Create a batch file as a stub


Write something like this into a plain .txt file. Adjust
the paths to match your system's setup:
@echo off
"c:\programme\java\jre1.8.0_51\bin\java.exe" ^
-jar "c:\Programme\GNU\ditaa0_9\ditaa0_9.jar" %*

Name it ditaa.bat and put it somewhere in your


3

PATH .

I've put mine into c:\Programme\GNU\ditaa0_9\ .

When in doubt, simply drop it into your equivalent of c:\WINDOWS\system32\ .

Edit the plugin source


Locate the ditaaeditor.py in the zim/plugins
4

folder in your Zim install root . Insert the line dotcmd


= "ditaa.bat" as indicated.
self.dotfile.writelines(text)
# Call GraphViz
try:
dotcmd = "ditaa.bat" # <--- insert THIS !
dot = Application(dotcmd)
dot.run((self.dotfile, '-o', self.pngfile))
except ApplicationError:
return None, None # Sorry, no log
else:
return self.pngfile, None

Restart Zim and look into its plugin list again. You
should be able to put a checkmark next to ditaa now.
If you have questions, find me on facebook and feel
free to ask.
4

Mine was at c:\Programme\GNU\Zim Desktop Wiki\zim\plugins\ .

Enjoy!
Right-click on a previously copy-and-pasted ditaa
diagram in one of your Zim notes...

...then edit its source...

You might also like