LoginSignup
35
38

More than 5 years have passed since last update.

XMinDoc: XMindのマインドマップをMarkdownなどに変換できるスクリプトをgem化した

Posted at

この記事はドキュメンテーション Advent Calendar 2013 - Qiita [キータ]の9日目の記事・・・でしたが遅刻しましたorz

また、この記事は

Markdown - マインドマップから全てを紡ぎ出す - XMind+Pandocのドキュメント作成術 - - Qiita [キータ]

の実質的な続きです。そもそもの背景などはこちらをご覧ください。

おさらい

マインドマップから様々な文書(Markdownなど)を作成したい。
XMind to Documents

どうやって?

  • Pandocという文書変換ツールをベースに利用する
  • それに加えて、XMindファイルをPandocに渡すスクリプトXMinDocを利用する

インストール

ここが最大の改善点です。だいぶ楽になりました。

準備

  • XMind
    • 最新版(XMind 2013 v3.4.0)では日本語が入力できるようになりました。トピックの日本語入力時に1字だけ変換されないバグも無くなっています。
    • 適当なマインドマップファイルを作ってください。面倒な場合は、GitHubからサンプルファイルをダウンロードしてもOKです。
  • Ruby 1.9.3 (2.0は動作未確認です)

1. Pandocをインストールする

Mac

brew install haskell-platform
cabal update
cabal install pandoc

またはパッケージをインストール。

Linux (Debian/Ubuntu)

sudo apt-get install pandoc

Windows

パッケージをインストール。

インストールの具体的な手順については以下の記事をご覧ください。

2. iconvのインストール

Mac

brew tap homebrew/dupes
brew install libiconv
brew link --force libiconv 

Linux

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure
make
sudo make install

3. gemでXMinDocをインストールする

gem install xmindoc

以上です。

使い方

Usage: xmindoc [options] input.xmind
-o, --output FILE                Output Filename
-t, --to=FORMAT                  Output formats: markdown, org, html, latex, rst,  ...
-w, --write=FORMAT               Output formats: markdown, org, html, latex, rst,  ...
    --pandoc-options=OPTIONS     Pandoc options (Use double quotes like "--atx-headers")
-h, --help                       Display this screen

以下のサンプルファイルはGitHubsamples/ディレクトリに置いています。

例1 (Japanese: 寿限無) Markdownとして出力

xmindoc -t markdown -o test1.md samples/test1.xmind --pandoc-options="--atx-headers"

例2 (English: Lorem Ipsum) Orgファイルとして出力

xmindoc -t org -o test2.org samples/test2.xmind

その他

動いた・動かなかったの報告を歓迎します。

ソースコードは GitHub に置いています。

質問やPull Request等があればどうぞ。

35
38
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
35
38