改造デフォルトパーサー
MoinMoin のデフォルトの構文に対する不満点が二つ。
- 改行の保存ができない
WikiName の自動リンクを off にできない
上記二つは config 等で何とかすることはできず、パーサーを直接いじらないと解決できない。
そこで、デフォルトのパーサークラスを継承して小変更を加えた自作のパーサープラグインを作成。
作成にあたって、以下の二つを参考にした。
ダウンロード
MoinMoin 1.9.7 で動作確認済み。
meh.py
インストール
/wiki/data/plugin/parser に meh.py をコピーする。
- パーサーを変更する。次のうちどれかを行えば良い。
- ページ全体のパーサーを変更
#format meh
をページの先頭に記述する。 - ページの一部だけパーサーを変更
{{{#!meh Wikiテキスト }}} wikiconfig.py を変更すると wiki 全体のデフォルトパーサーを変更できる。HelpOnConfiguration
default_markup = 'meh'
- ページ全体のパーサーを変更
リスト中の改行
新しい行をのインデントレベルをリストのドットに合わせる。
Here we go * list 1 proper new line * nested list proper new line * list 2 wrong new line * list 3 another wrong new line
Here we go
- list 1
proper new line- nested list
proper new line
- nested list
- list 2
wrong new line
- list 3
- another wrong new line