A Golang Widget That Converting Xmind to Markdown
Introduction
An XMind file is actually an archived package of several XML files and other attachments compressed using general ZIP algorithm. An XMind archive may contain the following components:
- content.xml: (required) main data and hierarchy
- styles.xml: style information
- meta.xml: meta information
- META-INF/: meta folder
- manifest.xml: (required) the manifest of this archive
- attachments/: attachment folder, used to store attached files
- markers/: markers folder, used to store custom markers
- Thumbnails/: thumbnail folder, used to store preview image of this workbook
- thumbnail.jpg: the preview image
Attribute Visiting Using DFS Algorithm
The content.xml contains main data and hierarchy of this xmind file. The struct of content.xml is as following,
1 | <xmap-content version="1.0"> |
The major elements is topic elements. A topic element represents a topic in a mind map. A topic may have subtopics (or none), but has only one parent (or none). In view of this, the best method of visiting attribute is Depth First Search algorithm.
Get Hands Dirty
Save the following code into file. Now, you can run go run widget.go
to convert xmind to markdown file.
1 | package main |