1
This commit is contained in:
Evan Pratten 2019-07-15 19:06:57 -04:00
parent f298ade21e
commit dc5ec6a1d2
7 changed files with 517 additions and 15 deletions

View File

@ -0,0 +1,128 @@
---
layout: post
title: "Mind map generation with Python"
description: "Step 1"
date: 2019-07-15 18:38:00
categories: projects frc
---
While working on an assignment with [Coggle](https://coggle.it) today, I noticed an interesting option in the save menu. *Download as .mm file*. Having rarely worked with mind maps before, and only doing it online, it never occured to me that someone would have a file format for it. So I took a look.
## What is a .mm file?
It turns out, a `.mm` file is just some XML describing the mind map. Here is a simple mind map:
![Simple Mind Map](/assets/images/mindmap-simple.png)
And again as a `.mm` file:
```xml
<map version="0.9.0">
<node TEXT="Master Node" FOLDED="false" POSITION="right" ID="5d2d02b1a315dd0879f48c1c" X_COGGLE_POSX="0" X_COGGLE_POSY="0">
<edge COLOR="#b4b4b4"/>
<font NAME="Helvetica" SIZE="17"/>
<node TEXT="Child branch" FOLDED="false" POSITION="right" ID="f72704969525d2a0333dd635">
<edge COLOR="#7aa3e5"/>
<font NAME="Helvetica" SIZE="15"/>
<node TEXT="Children 1" FOLDED="false" POSITION="right" ID="c83826af506cae6e55761d5c">
<edge COLOR="#7ea7e5"/>
<font NAME="Helvetica" SIZE="13"/>
</node>
<node TEXT="Children 2" FOLDED="false" POSITION="right" ID="47723a4d0fb766863f70d204">
<edge COLOR="#82aae7"/>
<font NAME="Helvetica" SIZE="13"/>
</node>
</node>
</node>
</map>
```
Neat, right?
## What can we do with it?
I have not done much research about this because I wanted to work all of this out on my own. But I know one thing as a fact: working with XML sucks (especially in Python). I decided that this would be much better if I could load `.mm` files as JSON. This would allow easy manipulation and some cool projects.
## My script
Like everything I do, I made a script to play with these files.
It's pretty simple. First, It loads a `.mm` file, then parses it into a `list` of `xml.etree.ElementTree.Element`.
```python
raw_mm = ""
with open(args.file, "r") as fp:
raw_mm = fp.read()
fp.close()
xml = ET.fromstring(raw_mm)
```
The parsed `list` is then passed into a recursive function that constructs a `dict`
```python
def xmlToDict(xml):
output = []
for elem in list(xml):
if "TEXT" not in elem.attrib:
continue
name = elem.attrib['TEXT']
json_element = {"name": name}
try:
json_element["children"] = xmlToDict(elem)
except:
continue
# Detect node type
if json_element["children"]:
json_element["type"] = "branch"
else:
json_element["type"] = "leaf"
del json_element["children"]
output.append(json_element)
return output
```
Finally, the `dict` is written to a file with `json.dump`
```python
json.dump(mind_map, open(args.file + ".json", "w"))
```
The whole script (with comments) can be found on my [GitHub account](https://gist.github.com/Ewpratten/0d8f7c7371380c9ca8adcfc6502ccf84#file-parser-py).
## The output
Running the `.mm` file from above through the script gives:
```json
[
{
"name":"Master Node",
"children":[
{
"name":"Child branch",
"children":[
{
"name":"Children 1",
"type":"leaf"
},
{
"name":"Children 2",
"type":"leaf"
}
],
"type":"branch"
}
],
"type":"branch"
}
]
```
## The next step
This script just translates a `.mm` file to JSON. Nothing else. Next, I want to convert this to a library, and add a JSON to `.mm` function as well. This leads into my ultimate goal for this project.
I want a script that I can drop in the root of any project to build a [Gource](https://gource.io/)-style visualization of the folder structure. This will give me a way to make cool visualizations for lessons on the robotics team.

View File

@ -96,6 +96,13 @@
<ul> <ul>
<!-- <header class="major"> -->
<li><h3><a href="/blog/2019/07/15/mindmap" class="link" title="2019-07-15 14:38:00 -0400">Mind map generation with Python</a></h3></li>
<!-- </header> -->
<!-- <header class="major"> --> <!-- <header class="major"> -->
<li><h3><a href="/blog/2019/07/13/lookback-gmad" class="link" title="2019-07-13 10:43:00 -0400">Taking a look back at GMAD</a></h3></li> <li><h3><a href="/blog/2019/07/13/lookback-gmad" class="link" title="2019-07-13 10:43:00 -0400">Taking a look back at GMAD</a></h3></li>
<!-- </header> --> <!-- </header> -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,264 @@
<!DOCTYPE html>
<html>
<head>
<title>Evan Pratten</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<!--[if lte IE 8]><script src="/assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="/assets/css/main.css" />
<!-- <link rel="stylesheet" href="/assets/css/custom.css" /> -->
<!--[if lte IE 9]><link rel="stylesheet" href="/assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="/assets/css/ie8.css" /><![endif]-->
<!-- Syntax highlight -->
<link rel="stylesheet" href="/assets/css/vs.css" />
</head>
<body>
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header" >
<a href="http://0.0.0.0:4000//" class="logo"><strong>Evan Pratten</strong> <span>retrylife</span></a>
<nav>
<!-- <a href="#menu">Menu</a> -->
</nav>
</header>
<!-- Menu -->
<!-- <nav id="menu">
<ul class="links">
<li><a href="http://0.0.0.0:4000//">Home</a></li>
<li><a href="http://0.0.0.0:4000/all_posts">All posts</a></li>
</ul>
<ul class="actions vertical">
<li><a href="#" class="button special fit">Get Started</a></li>
<li><a href="#" class="button fit">Log In</a></li>
</ul>
</nav> -->
<section id="banner" class="major" style="height:40vh">
<div class="inner">
<header class="major">
<h1>Mind map generation with Python</h1>
</header>
<div class="content">
<p >Step 1</p>
</div>
</div>
</section>
<!-- Main -->
<div id="main" class="alt">
<!-- One -->
<section id="one">
<div class="inner">
<p><p>While working on an assignment with <a href="https://coggle.it">Coggle</a> today, I noticed an interesting option in the save menu. <em>Download as .mm file</em>. Having rarely worked with mind maps before, and only doing it online, it never occured to me that someone would have a file format for it. So I took a look.</p>
<h2 id="what-is-a-mm-file">What is a .mm file?</h2>
<p>It turns out, a <code class="highlighter-rouge">.mm</code> file is just some XML describing the mind map. Here is a simple mind map:</p>
<p><img src="/assets/images/mindmap-simple.png" alt="Simple Mind Map" /></p>
<p>And again as a <code class="highlighter-rouge">.mm</code> file:</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;map</span> <span class="na">version=</span><span class="s">"0.9.0"</span><span class="nt">&gt;</span>
<span class="nt">&lt;node</span> <span class="na">TEXT=</span><span class="s">"Master Node"</span> <span class="na">FOLDED=</span><span class="s">"false"</span> <span class="na">POSITION=</span><span class="s">"right"</span> <span class="na">ID=</span><span class="s">"5d2d02b1a315dd0879f48c1c"</span> <span class="na">X_COGGLE_POSX=</span><span class="s">"0"</span> <span class="na">X_COGGLE_POSY=</span><span class="s">"0"</span><span class="nt">&gt;</span>
<span class="nt">&lt;edge</span> <span class="na">COLOR=</span><span class="s">"#b4b4b4"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;font</span> <span class="na">NAME=</span><span class="s">"Helvetica"</span> <span class="na">SIZE=</span><span class="s">"17"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;node</span> <span class="na">TEXT=</span><span class="s">"Child branch"</span> <span class="na">FOLDED=</span><span class="s">"false"</span> <span class="na">POSITION=</span><span class="s">"right"</span> <span class="na">ID=</span><span class="s">"f72704969525d2a0333dd635"</span><span class="nt">&gt;</span>
<span class="nt">&lt;edge</span> <span class="na">COLOR=</span><span class="s">"#7aa3e5"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;font</span> <span class="na">NAME=</span><span class="s">"Helvetica"</span> <span class="na">SIZE=</span><span class="s">"15"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;node</span> <span class="na">TEXT=</span><span class="s">"Children 1"</span> <span class="na">FOLDED=</span><span class="s">"false"</span> <span class="na">POSITION=</span><span class="s">"right"</span> <span class="na">ID=</span><span class="s">"c83826af506cae6e55761d5c"</span><span class="nt">&gt;</span>
<span class="nt">&lt;edge</span> <span class="na">COLOR=</span><span class="s">"#7ea7e5"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;font</span> <span class="na">NAME=</span><span class="s">"Helvetica"</span> <span class="na">SIZE=</span><span class="s">"13"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/node&gt;</span>
<span class="nt">&lt;node</span> <span class="na">TEXT=</span><span class="s">"Children 2"</span> <span class="na">FOLDED=</span><span class="s">"false"</span> <span class="na">POSITION=</span><span class="s">"right"</span> <span class="na">ID=</span><span class="s">"47723a4d0fb766863f70d204"</span><span class="nt">&gt;</span>
<span class="nt">&lt;edge</span> <span class="na">COLOR=</span><span class="s">"#82aae7"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;font</span> <span class="na">NAME=</span><span class="s">"Helvetica"</span> <span class="na">SIZE=</span><span class="s">"13"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/node&gt;</span>
<span class="nt">&lt;/node&gt;</span>
<span class="nt">&lt;/node&gt;</span>
<span class="nt">&lt;/map&gt;</span>
</code></pre></div></div>
<p>Neat, right?</p>
<h2 id="what-can-we-do-with-it">What can we do with it?</h2>
<p>I have not done much research about this because I wanted to work all of this out on my own. But I know one thing as a fact: working with XML sucks (especially in Python). I decided that this would be much better if I could load <code class="highlighter-rouge">.mm</code> files as JSON. This would allow easy manipulation and some cool projects.</p>
<h2 id="my-script">My script</h2>
<p>Like everything I do, I made a script to play with these files.</p>
<p>Its pretty simple. First, It loads a <code class="highlighter-rouge">.mm</code> file, then parses it into a <code class="highlighter-rouge">list</code> of <code class="highlighter-rouge">xml.etree.ElementTree.Element</code>.</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">raw_mm</span> <span class="o">=</span> <span class="s">""</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">args</span><span class="o">.</span><span class="nb">file</span><span class="p">,</span> <span class="s">"r"</span><span class="p">)</span> <span class="k">as</span> <span class="n">fp</span><span class="p">:</span>
<span class="n">raw_mm</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="n">xml</span> <span class="o">=</span> <span class="n">ET</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span><span class="n">raw_mm</span><span class="p">)</span>
</code></pre></div></div>
<p>The parsed <code class="highlighter-rouge">list</code> is then passed into a recursive function that constructs a <code class="highlighter-rouge">dict</code></p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">xmlToDict</span><span class="p">(</span><span class="n">xml</span><span class="p">):</span>
<span class="n">output</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">elem</span> <span class="ow">in</span> <span class="nb">list</span><span class="p">(</span><span class="n">xml</span><span class="p">):</span>
<span class="k">if</span> <span class="s">"TEXT"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">elem</span><span class="o">.</span><span class="n">attrib</span><span class="p">:</span>
<span class="k">continue</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">elem</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s">'TEXT'</span><span class="p">]</span>
<span class="n">json_element</span> <span class="o">=</span> <span class="p">{</span><span class="s">"name"</span><span class="p">:</span> <span class="n">name</span><span class="p">}</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">json_element</span><span class="p">[</span><span class="s">"children"</span><span class="p">]</span> <span class="o">=</span> <span class="n">xmlToDict</span><span class="p">(</span><span class="n">elem</span><span class="p">)</span>
<span class="k">except</span><span class="p">:</span>
<span class="k">continue</span>
<span class="c1"># Detect node type
</span> <span class="k">if</span> <span class="n">json_element</span><span class="p">[</span><span class="s">"children"</span><span class="p">]:</span>
<span class="n">json_element</span><span class="p">[</span><span class="s">"type"</span><span class="p">]</span> <span class="o">=</span> <span class="s">"branch"</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">json_element</span><span class="p">[</span><span class="s">"type"</span><span class="p">]</span> <span class="o">=</span> <span class="s">"leaf"</span>
<span class="k">del</span> <span class="n">json_element</span><span class="p">[</span><span class="s">"children"</span><span class="p">]</span>
<span class="n">output</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">json_element</span><span class="p">)</span>
<span class="k">return</span> <span class="n">output</span>
</code></pre></div></div>
<p>Finally, the <code class="highlighter-rouge">dict</code> is written to a file with <code class="highlighter-rouge">json.dump</code></p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">json</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="n">mind_map</span><span class="p">,</span> <span class="nb">open</span><span class="p">(</span><span class="n">args</span><span class="o">.</span><span class="nb">file</span> <span class="o">+</span> <span class="s">".json"</span><span class="p">,</span> <span class="s">"w"</span><span class="p">))</span>
</code></pre></div></div>
<p>The whole script (with comments) can be found on my <a href="https://gist.github.com/Ewpratten/0d8f7c7371380c9ca8adcfc6502ccf84#file-parser-py">GitHub account</a>.</p>
<h2 id="the-output">The output</h2>
<p>Running the <code class="highlighter-rouge">.mm</code> file from above through the script gives:</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="s2">"Master Node"</span><span class="p">,</span><span class="w">
</span><span class="s2">"children"</span><span class="p">:[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="s2">"Child branch"</span><span class="p">,</span><span class="w">
</span><span class="s2">"children"</span><span class="p">:[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="s2">"Children 1"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="s2">"leaf"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="s2">"Children 2"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="s2">"leaf"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="s2">"branch"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">],</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="s2">"branch"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span></code></pre></div></div>
<h2 id="the-next-step">The next step</h2>
<p>This script just translates a <code class="highlighter-rouge">.mm</code> file to JSON. Nothing else. Next, I want to convert this to a library, and add a JSON to <code class="highlighter-rouge">.mm</code> function as well. This leads into my ultimate goal for this project.</p>
<p>I want a script that I can drop in the root of any project to build a <a href="https://gource.io/">Gource</a>-style visualization of the folder structure. This will give me a way to make cool visualizations for lessons on the robotics team.</p>
</p>
</div>
</section>
</div>
<!-- Footer -->
<footer id="footer">
<div class="inner">
<ul class="icons">
<li><a href="https://twitter.com/ewpratten" class="icon alt fa-twitter" target="_blank"><span class="label">Twitter</span></a></li>
<li><a href="https://gitlab.com/u/ewpratten" class="icon alt fa-gitlab" target="_blank"><span class="label">GitLab</span></a></li>
<li><a href="https://github.com/ewpratten" class="icon alt fa-github" target="_blank"><span class="label">GitHub</span></a></li>
<li><a href="/feed.xml" class="icon alt fa-rss" target="_blank"><span class="label">RSS</span></a></li>
</ul>
<ul class="copyright">
<li>&copy; Evan Pratten</li>
<li>Design based from: <a href="https://html5up.net" target="_blank">HTML5 UP</a></li>
</ul>
</div>
</footer>
</div>
<!-- Scripts -->
<script src="http://0.0.0.0:4000/assets/js/jquery.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/jquery.scrolly.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/jquery.scrollex.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/skel.min.js"></script>
<script src="http://0.0.0.0:4000/assets/js/util.js"></script>
<!--[if lte IE 8]><script src="http://0.0.0.0:4000/assets/js/ie/respond.min.js"></script><![endif]-->
<script src="http://0.0.0.0:4000/assets/js/main.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-74118570-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-74118570-2');
</script>
</body>
</html>

View File

@ -1,4 +1,118 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://0.0.0.0:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://0.0.0.0:4000/" rel="alternate" type="text/html" /><updated>2019-07-15T11:11:19-04:00</updated><id>http://0.0.0.0:4000/feed.xml</id><title type="html">Evan Pratten</title><subtitle>Computer wizard, student, &lt;a href=&quot;https://github.com/frc5024&quot;&gt;@frc5024&lt;/a&gt; programming team lead, and radio enthusiast.</subtitle><entry><title type="html">Taking a look back at GMAD</title><link href="http://0.0.0.0:4000/blog/2019/07/13/lookback-gmad" rel="alternate" type="text/html" title="Taking a look back at GMAD" /><published>2019-07-13T10:43:00-04:00</published><updated>2019-07-13T10:43:00-04:00</updated><id>http://0.0.0.0:4000/blog/2019/07/13/Lookback-GMAD</id><content type="html" xml:base="http://0.0.0.0:4000/blog/2019/07/13/lookback-gmad">&lt;p&gt;One day, back in June of 2018, I was both looking for a new project to work on, and trying to decide which Linux distro to install on one of my computers. From this, a little project was born. &lt;a href=&quot;/gmad&quot;&gt;Give Me a Distro&lt;/a&gt; (or, GMAD, as I like to call it) is a little website that chooses a random distribution of Linux and shows a description of what you are about to get yourself into, and a download link for the latest ISO.&lt;/p&gt; <?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://0.0.0.0:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://0.0.0.0:4000/" rel="alternate" type="text/html" /><updated>2019-07-15T19:01:28-04:00</updated><id>http://0.0.0.0:4000/feed.xml</id><title type="html">Evan Pratten</title><subtitle>Computer wizard, student, &lt;a href=&quot;https://github.com/frc5024&quot;&gt;@frc5024&lt;/a&gt; programming team lead, and radio enthusiast.</subtitle><entry><title type="html">Mind map generation with Python</title><link href="http://0.0.0.0:4000/blog/2019/07/15/mindmap" rel="alternate" type="text/html" title="Mind map generation with Python" /><published>2019-07-15T14:38:00-04:00</published><updated>2019-07-15T14:38:00-04:00</updated><id>http://0.0.0.0:4000/blog/2019/07/15/MindMap</id><content type="html" xml:base="http://0.0.0.0:4000/blog/2019/07/15/mindmap">&lt;p&gt;While working on an assignment with &lt;a href=&quot;https://coggle.it&quot;&gt;Coggle&lt;/a&gt; today, I noticed an interesting option in the save menu. &lt;em&gt;Download as .mm file&lt;/em&gt;. Having rarely worked with mind maps before, and only doing it online, it never occured to me that someone would have a file format for it. So I took a look.&lt;/p&gt;
&lt;h2 id=&quot;what-is-a-mm-file&quot;&gt;What is a .mm file?&lt;/h2&gt;
&lt;p&gt;It turns out, a &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; file is just some XML describing the mind map. Here is a simple mind map:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/assets/images/mindmap-simple.png&quot; alt=&quot;Simple Mind Map&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And again as a &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; file:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;map&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0.9.0&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;node&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;TEXT=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Master Node&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;FOLDED=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;POSITION=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;right&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;ID=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;5d2d02b1a315dd0879f48c1c&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;X_COGGLE_POSX=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;X_COGGLE_POSY=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;edge&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;COLOR=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#b4b4b4&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;font&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;NAME=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Helvetica&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;SIZE=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;17&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;node&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;TEXT=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Child branch&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;FOLDED=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;POSITION=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;right&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;ID=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;f72704969525d2a0333dd635&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;edge&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;COLOR=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#7aa3e5&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;font&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;NAME=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Helvetica&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;SIZE=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;15&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;node&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;TEXT=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Children 1&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;FOLDED=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;POSITION=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;right&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;ID=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;c83826af506cae6e55761d5c&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;edge&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;COLOR=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#7ea7e5&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;font&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;NAME=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Helvetica&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;SIZE=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;13&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/node&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;node&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;TEXT=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Children 2&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;FOLDED=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;false&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;POSITION=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;right&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;ID=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;47723a4d0fb766863f70d204&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;edge&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;COLOR=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;#82aae7&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;font&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;NAME=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Helvetica&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;SIZE=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;13&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/node&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/node&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/node&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/map&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Neat, right?&lt;/p&gt;
&lt;h2 id=&quot;what-can-we-do-with-it&quot;&gt;What can we do with it?&lt;/h2&gt;
&lt;p&gt;I have not done much research about this because I wanted to work all of this out on my own. But I know one thing as a fact: working with XML sucks (especially in Python). I decided that this would be much better if I could load &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; files as JSON. This would allow easy manipulation and some cool projects.&lt;/p&gt;
&lt;h2 id=&quot;my-script&quot;&gt;My script&lt;/h2&gt;
&lt;p&gt;Like everything I do, I made a script to play with these files.&lt;/p&gt;
&lt;p&gt;Its pretty simple. First, It loads a &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; file, then parses it into a &lt;code class=&quot;highlighter-rouge&quot;&gt;list&lt;/code&gt; of &lt;code class=&quot;highlighter-rouge&quot;&gt;xml.etree.ElementTree.Element&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;raw_mm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;r&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;raw_mm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;fp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ET&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fromstring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;raw_mm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The parsed &lt;code class=&quot;highlighter-rouge&quot;&gt;list&lt;/code&gt; is then passed into a recursive function that constructs a &lt;code class=&quot;highlighter-rouge&quot;&gt;dict&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;xmlToDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;elem&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;TEXT&quot;&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;elem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;elem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;attrib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'TEXT'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;children&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xmlToDict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;elem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;except&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;continue&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Detect node type
&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;children&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;branch&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;leaf&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;del&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;children&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;json_element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, the &lt;code class=&quot;highlighter-rouge&quot;&gt;dict&lt;/code&gt; is written to a file with &lt;code class=&quot;highlighter-rouge&quot;&gt;json.dump&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mind_map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;.json&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;w&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The whole script (with comments) can be found on my &lt;a href=&quot;https://gist.github.com/Ewpratten/0d8f7c7371380c9ca8adcfc6502ccf84#file-parser-py&quot;&gt;GitHub account&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-output&quot;&gt;The output&lt;/h2&gt;
&lt;p&gt;Running the &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; file from above through the script gives:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Master Node&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;children&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Child branch&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;children&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Children 1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;leaf&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Children 2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;leaf&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;branch&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;branch&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;the-next-step&quot;&gt;The next step&lt;/h2&gt;
&lt;p&gt;This script just translates a &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; file to JSON. Nothing else. Next, I want to convert this to a library, and add a JSON to &lt;code class=&quot;highlighter-rouge&quot;&gt;.mm&lt;/code&gt; function as well. This leads into my ultimate goal for this project.&lt;/p&gt;
&lt;p&gt;I want a script that I can drop in the root of any project to build a &lt;a href=&quot;https://gource.io/&quot;&gt;Gource&lt;/a&gt;-style visualization of the folder structure. This will give me a way to make cool visualizations for lessons on the robotics team.&lt;/p&gt;</content><author><name></name></author><summary type="html">While working on an assignment with Coggle today, I noticed an interesting option in the save menu. Download as .mm file. Having rarely worked with mind maps before, and only doing it online, it never occured to me that someone would have a file format for it. So I took a look.</summary></entry><entry><title type="html">Taking a look back at GMAD</title><link href="http://0.0.0.0:4000/blog/2019/07/13/lookback-gmad" rel="alternate" type="text/html" title="Taking a look back at GMAD" /><published>2019-07-13T10:43:00-04:00</published><updated>2019-07-13T10:43:00-04:00</updated><id>http://0.0.0.0:4000/blog/2019/07/13/Lookback-GMAD</id><content type="html" xml:base="http://0.0.0.0:4000/blog/2019/07/13/lookback-gmad">&lt;p&gt;One day, back in June of 2018, I was both looking for a new project to work on, and trying to decide which Linux distro to install on one of my computers. From this, a little project was born. &lt;a href=&quot;/gmad&quot;&gt;Give Me a Distro&lt;/a&gt; (or, GMAD, as I like to call it) is a little website that chooses a random distribution of Linux and shows a description of what you are about to get yourself into, and a download link for the latest ISO.&lt;/p&gt;
&lt;h2 id=&quot;backend-tech&quot;&gt;Backend tech&lt;/h2&gt; &lt;h2 id=&quot;backend-tech&quot;&gt;Backend tech&lt;/h2&gt;
&lt;p&gt;This is one of the simplest projects I have ever made. All the backend does is:&lt;/p&gt; &lt;p&gt;This is one of the simplest projects I have ever made. All the backend does is:&lt;/p&gt;
@ -481,15 +595,4 @@ __&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&g
&lt;li&gt;Have mentors do “guest presentations”&lt;/li&gt; &lt;li&gt;Have mentors do “guest presentations”&lt;/li&gt;
&lt;li&gt;Dedicate a day to robot driving lessons&lt;/li&gt; &lt;li&gt;Dedicate a day to robot driving lessons&lt;/li&gt;
&lt;li&gt;Use a custom library with wrappers and tools built by me to provide easy interfaces for new programmers&lt;/li&gt; &lt;li&gt;Use a custom library with wrappers and tools built by me to provide easy interfaces for new programmers&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><summary type="html">Over the past two years (2018 / 2019), I have been a member of my schools FRC team, Raider Robotics. Specifically, a programmer.</summary></entry><entry><title type="html">I made a new song!</title><link href="http://0.0.0.0:4000/blog/2019/06/17/amm2m1-release" rel="alternate" type="text/html" title="I made a new song!" /><published>2019-06-17T06:20:00-04:00</published><updated>2019-06-17T06:20:00-04:00</updated><id>http://0.0.0.0:4000/blog/2019/06/17/AMM2M1-release</id><content type="html" xml:base="http://0.0.0.0:4000/blog/2019/06/17/amm2m1-release">&lt;p&gt;I am currently taking a class in school called &lt;a href=&quot;https://www.facebook.com/studio225beal/&quot;&gt;Music and computers (AMM2M)&lt;/a&gt;, where as part of the class, whe get together into bands, and produce a song. After taking a break from music production for over a year, we have released our song for the class (we do two songs, but the second is not finished yet).&lt;/p&gt; &lt;/ul&gt;</content><author><name></name></author><summary type="html">Over the past two years (2018 / 2019), I have been a member of my schools FRC team, Raider Robotics. Specifically, a programmer.</summary></entry></feed>
&lt;h2 id=&quot;my-contribution&quot;&gt;My contribution&lt;/h2&gt;
&lt;p&gt;My main contribution to the project was a mix of live drumming, and most of the songs MIDI work. The song is far from perfect, but pretty good for the time we had to produce it.&lt;/p&gt;
&lt;h2 id=&quot;just-give-me-the-song&quot;&gt;Just give me the song!&lt;/h2&gt;
&lt;p&gt;Ok. Ok. Here is the song:&lt;/p&gt;
&lt;audio controls=&quot;&quot;&gt;
&lt;source src=&quot;/assets/audio/SpamPhoneCalls.mp3&quot; type=&quot;audio/mpeg&quot; /&gt;
Your browser does not support audio players
&lt;/audio&gt;</content><author><name></name></author><summary type="html">I am currently taking a class in school called Music and computers (AMM2M), where as part of the class, whe get together into bands, and produce a song. After taking a break from music production for over a year, we have released our song for the class (we do two songs, but the second is not finished yet).</summary></entry></feed>

View File

@ -127,12 +127,12 @@
<ul> <ul>
<li><h3><a href="/blog/2019/07/15/mindmap" class="link" title="2019-07-15 14:38:00 -0400">Mind map generation with Python</a></h3></li>
<li><h3><a href="/blog/2019/07/13/lookback-gmad" class="link" title="2019-07-13 10:43:00 -0400">Taking a look back at GMAD</a></h3></li> <li><h3><a href="/blog/2019/07/13/lookback-gmad" class="link" title="2019-07-13 10:43:00 -0400">Taking a look back at GMAD</a></h3></li>
<li><h3><a href="/blog/2019/07/06/scrapingfrcgithub" class="link" title="2019-07-06 11:08:00 -0400">Scraping FRC team's GitHub accounts to gather large amounts of data</a></h3></li> <li><h3><a href="/blog/2019/07/06/scrapingfrcgithub" class="link" title="2019-07-06 11:08:00 -0400">Scraping FRC team's GitHub accounts to gather large amounts of data</a></h3></li>
<li><h3><a href="/blog/2019/07/01/devdns" class="link" title="2019-07-01 18:13:00 -0400">devDNS</a></h3></li>
</ul> </ul>
<a href="all_posts.html" class="button next">View All</a> <a href="all_posts.html" class="button next">View All</a>

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB