• +43 660 1453541
  • contact@germaniumhq.com

Staying Organized With Freeplane (and Scripts)


Staying Organized With Freeplane (and Scripts)

As the number of blog posts keeps increasing on this blog, organizing and keeping track of all the tags that are available becomes more complicated. Fortunately it involves only a mindmap program, and a small script.

Freeplane is a maintained fork of Freemind. As Freemind is now unmaintained, it’s probably a good idea to switch. Freeplane has more features, and is slightly more complex than Freemind. On the plus side I only use a subset of the available functionality, and that seems to work rather well.

This is the current set of tags available for the blog:

Current Tags Mindmap

Each tag depends on the parent tag, and potentially other thematic tags.

When generating a new article it’s possible that I’ll either mistype, or forget to add some parent tag. This is why, because we live in the era of automation, I wrote a script for it.

The definition of the tags sits in its own place, with tags defining on what other tags they activate:

AVAILABLE_TAGS: Dict[str, List[str]] = {
    "germanium": ["selenium"],
        "germanium-api": ["germanium"],
        "germanium-drivers": ["germanium", "webdriver"],
        "germanium-selectors": ["germanium", "selenium-selectors"],
    "devops": [],
        "jenkins": ["devops"],
        "docker": ["devops"],
        "kubernetes": ["devops"],
        "automation": ["devops"],
        "ansible": ["devops"],
        "security": ["devops"],
    "germanium-selector-builder": ["germanium-selectors"],
    "selenium": [],
        "selenium-selectors": ["selenium"],
        "webdriver": ["selenium"],
        "selenium-grid": ["selenium", "devops"],
    "development": [],
        "python-development": ["development"],
        "java-development": ["development"],
        "ide": ["development"],
            "eclipse": ["ide", "java-development"],
            "vim": ["ide"],
    "testing": [],
        "integration-testing": ["testing"],
        "automated-test": ["testing"],
    "felix-build-monitor": ["jenkins"],
    "desktop": [],
        "gnome": ["desktop"],
    "release": [],
}

This script checks also if there are duplicates or not:

def generate_tags(tags_str: str) -> str:
    tags_to_process = list(tags_str.split(','))
    processed_tags: Set[str] = set()
    resolved_tags = list()

    for tag in tags_to_process:
        if tag in processed_tags:
            continue

        if tag not in AVAILABLE_TAGS:
            raise Exception(f"Tag '{tag}' not found in available tags: {AVAILABLE_TAGS.keys()}")

        processed_tags.add(tag)
        resolved_tags.append(tag)

        for dependent_tag in AVAILABLE_TAGS.get(tag, []):
            if dependent_tag not in processed_tags:
                tags_to_process.append(dependent_tag)

    return "\n".join([f"- {tag}" for tag in resolved_tags])

That’s why creating a new blog post is so much easier, and stays better organized.