Pandocでライブラリを書いたときのメモ
Pandocを使って競技ライブラリを書き始めた。
そのメモ。
こんなんでファイルをたくさんくっつけて一つのhtmlを生成する。
#!/bin/sh BASE_DIR=$(cd $(dirname $0);pwd) files=( title.md template.md type.md io.md vector.md search.md string.md number.md structure.md graph.md geometry.md game.md data.md) cd ${BASE_DIR} cd source echo "making with ${files[*]}" pandoc ${files[*]} -c library.css -t html --toc --mathjax --highlight-style tango -s -o ../library.html
ディレクトリの監視はinotify-toolsをつかってみた。
#!/bin/sh #This script needs inotify-tools! BASE_DIR=$(cd $(dirname $0);pwd) cd ${BASE_DIR} firefox library.html & while inotifywait -e modify ./source; do ./make.sh done
Firefoxでローカルのファイル変更を監視して、自動更新するには以下のアドオンを使ってる。
https://addons.mozilla.org/ja/firefox/addon/auto-reload/
現状、MathMLはChromeでは動かないのでMathJAXを使うことにした。