I use the open source mindmapping software freeplane on a day to day basis. Because of its java nature the gui tends to cause a little bit of eye strain for the spoiled average mac / apple user, but the rich feature set makes up for that! Freeplane has an integrated scripting api which can be used to freely manipulate the nodes, attributes and connections of a mindmap with javascript or groovy.

I recently had the need to paste mindmap structures into a redmine wiki (which uses the textile markup) and groovy was still on my “look into it soon”-list. So i took the chance.

Here’s the gist:
-> Most recent version on github

import javax.swing.*;

*	Export Freeplane mindmap branch to nested list in textile format e.g. for use in Redmine wiki
*	- Save as <filename>.groovy in <freeplane directory>/scripts/
	- Select node and start script from menu: Tools -> Scripts -> <filename>

def process(thisNode, childPosition) {
		def result =""
		result = prefix(childPosition)+thisNode.text+suffix(childPosition)
    	thisNode.children.each {
        result += process(it, childPosition + 1)
    return result
def showDialog(String text) {
    def dialog = new JDialog(ui.frame)
    dialog.setSize(500, 700)
    dialog.add(new JScrollPane(new JTextArea(text)))
    dialog.visible = true

def prefix(position){
	if(position == 0){
		return "h1. "
	} else if (position == 1){
		return "\nh2. "
	} else {
		return "*".multiply(position-1)+" "

def suffix(position){
	if(position == 0){
		return "\n"
	} else if (position == 1){
		return "\n\n"
	} else {
		return "\n"
def output = process(node, 0);


3 thoughts on “Freeplane mindmap to redmine wiki

  1. Thanks a lot !! I was almost about to write it by myself, but then remembered that “Google it first” mantra and voila !! Now I’m seriously thinking about using Redmine REST API to create a swarm of issues straight from my FreePlane !! :)))

  2. Thanks again ! By the way, it’s worth mentioning, that if you want to do it often, you could hold “Ctrl” while selecting item from “Tools\Scripts” and assign a hot-key to this script.

    I’ve also added a modified version of your script that does not display a dialog, but rather copies the Textile into clipboard.

    • You are welcome! Thanks for the tip with the hotkey assignment. Nice workflow improvement! Copying to clipboard also saves some seconds. Nice!

Leave a Reply

Your email address will not be published. Required fields are marked *