sdkmanでインストール可能なパッケージ見て気になったので試してみた。
--------------------------------------------------------------------------------
Gaiden (1.0) http://kobo.github.io/gaiden/
Gaiden is a tool that makes it easy to create documentation with Markdown.
$ sdk install gaiden
--------------------------------------------------------------------------------
インストール
$ sdk i gaiden
sdkmanのインストールや使用方法はこちらを参考に。
使ってみる
プロジェクト作成
create-projectでプロジェクトを作成する。
$ gaiden create-project gaiden-test
ディレクトリ配下のファイルはこんな感じ。
$ cd gaiden-test
$ ls -a
./ ../ README.md config.groovy gaidenw gaidenw.bat pages.groovy wrapper/
ドキュメント生成
$ gaiden build
buildディレクトリ配下に以下のようなファイルが作成される。
$ ls build
css/ fonts/ index.html js/
$ ls -R build
build:
css/ fonts/ index.html js/
build/css:
bootstrap.min.css font-awesome.min.css highlight.css my.css style.css
build/fonts:
FontAwesome.otf fontawesome-webfont.svg fontawesome-webfont.woff glyphicons-halflings-regular.svg glyphicons-halflings-regular.woff
fontawesome-webfont.eot fontawesome-webfont.ttf glyphicons-halflings-regular.eot glyphicons-halflings-regular.ttf
build/js:
application.js highlight.js jquery-2.1.1.min.js my.js
ブラウザで開いてみるとこんな感じのページが出来てる。
カスタマイズ・他
- 作成されるページはREADME.mdファイルから作成されるので、このファイルを編集してbuildする。
- 複数ファイルからページを作成したい場合、pages.groovyにファイルを追加する。
- タイトルを変更したい場合、config.groovyのtitleにタイトル名を設定する。
- gaiden watchを起動しておくと、README.mdの変更がリアルタイムでドキュメントに反映される。
Reference
$ gaiden
Usage: gaiden [-v|--version] [--non-interactive] <command> [<args>]
commands:
gaiden build Build pages from page sources
gaiden clean Clean the build directory
gaiden create-project <project-name> Create the project directory
gaiden help [<command-name>] Show help for a command
gaiden install-theme <theme-name> Install a theme resources into the project directory
gaiden watch Watch the project files, build when files are changed
gaiden wrapper Install wrapper resources