改造デフォルトパーサー

MoinMoin のデフォルトの構文に対する不満点が二つ。

上記二つは config 等で何とかすることはできず、パーサーを直接いじらないと解決できない。
そこで、デフォルトのパーサークラスを継承して小変更を加えた自作のパーサープラグインを作成。
作成にあたって、以下の二つを参考にした。

ダウンロード

MoinMoin 1.9.7 で動作確認済み。
meh.py

インストール

  1. /wiki/data/plugin/parsermeh.py をコピーする。

  2. パーサーを変更する。次のうちどれかを行えば良い。
    • ページ全体のパーサーを変更
      #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
  • list 2

wrong new line

  • list 3

    • another wrong new line

Moin/meh (最終更新日時 2014-07-30 00:10:14 更新者 dossist)