text-to-freemind: 将缩进文本转换成freemind

text-to-freemind是一个python脚本, 用来将缩进的文本转换成freemind的mm格式,实际上就是一个xml了。作者Wouter Bolsterlee今天刚更新了版本,节点里面可以换行,这样可以避免以前那样有太长的节点。

因为我的笔记本内存只有256M,如果同时上网和使用freemind, 就会比较慢。而我又喜欢用freemind来整理思路,所以这个脚本 正好满足我的需求。

用法非常简单,编写一个文本文件,每一行就是一个节点。 除第一行以外,所有行都以TAB缩进,视缩进的多少而定节点与前面节点的关系。 例子如下:

  Root node
      First level
          Subnode
              Subsubnode
                  Subsubsubnode
          Subnode
      Another first level
          Subnode with some longer text
          Another subnode with even longer text,\nbut fortunately it can be wrapped onto\nmultiple lines.
      中文也可以
          长句中没有问题\n又是一行\n再来一行
长句子中间可以用\n来换行。 使用text-to-freemind转换成freemind的mm格式。

text-to-freemind test.mm.txt > test.mm

最后才用freemind来观察、输出结果。

值得一提的是作者还提供了一个make文件,可以用来自动转换整个目录中的.mm.txt文件。

Read More:

11 Comments

  1. 1 hijff Commented @ 2008-07-31 1:03Reply to this comment

    恩,很棒的工具

  2. 2 liufeng Commented @ 2008-07-31 1:39Reply to this comment

    好东西。 要是能用FreeMind做后端或者直接集成FreeMind的代码来直接输出图形就更爽了。

  3. 3 antisamael Commented @ 2008-07-31 1:54Reply to this comment

    很实用~喜欢!

  4. 4 eagle Commented @ 2008-07-31 9:29Reply to this comment

    不错。方便。

  5. 5 lwl Commented @ 2008-07-31 9:44Reply to this comment

    @liufeng 已经有人提交请求了,耐心等待吧。 http://freemind.sourceforge.net/wiki/index.php/Requestsforenhancements#Exportingfromcommand_line

  6. 6 snowdream Commented @ 2008-07-31 11:25Reply to this comment

    确实不错。

  7. 7 frank28_nfls Commented @ 2008-07-31 12:34Reply to this comment

    使用了新版本,可是为什么在我这边换行功能没办法用?加了\n的长句,还是被显示在一行,没有分行。。。 我是在windows上实验的

  8. 8 wenti Commented @ 2008-07-31 15:15Reply to this comment

    我在ubuntu gnu/linux 8.04下用emacs按格式编写一个中文的文件。生成的freemind图在查看时有些字显示为方块?可能是什么问题?

    谢谢!

  9. 9 lwl Commented @ 2008-07-31 15:45Reply to this comment

    @frank28_nfls 那你的\n有没有显示出来呢? 我怀疑是因为windows上用\r换行,不妨在用text-to-freemind之前用dos2unix转一下。

    @wenti 在freemind中换个中文字体看看。

  10. 10 wenti Commented @ 2008-07-31 16:21Reply to this comment

    我参考了2篇在jre中装字体让freemind用 都没有成功 因为 ubuntu gnu/linux下安装的目录和文章说的不一样,而且jre没有fonts目录

    sudo apt-get install xfonts-wqy后安装字体的位置在 /usr/share/fonts/X11/misc/wenquanyi_

    http://blog.chinaunix.net/u/25081/showart_1073868.html

    http://blog.chinaunix.net/u1/55011/showart_460737.html

    fontconfig.properti中似乎有相关设置 但wqy的名字和位置都不对 我不知道如何改

    Component Font Mappings

    allfonts.chinese-wqy=-wenquanyi-wenquanyi zenhei-medium-r-normal------p-*-utf-8

    Font File Names

    filename.-wenquanyi-wenquanyi zenhei-medium-r-normal------p-*-iso10646-1=/usr/share/fonts/truetype/wqy/wqy-zenhei.ttf

  11. 11 lwl Commented @ 2008-07-31 21:00Reply to this comment

    @wenti 我以前是所有中文都是方块,后来在freemind中选择所有节点, 在右上角选择一个中文字体,就可以显示了。 而你这种,可以显示部分汉字,不知道怎么解决,只好请教google了。