Locked History Actions

MoinMoinWiki

MoinMoinWiki

Moin リンク

バックアップ

wikiconfig.pyに以下の行を追加。ただし、 data_dir の値が定義されている必要あり。

# Who is allowed to perform remote backup, change this!
backup_users = ['UserName']

# What to backup
backup_include = [data_dir] # this is the default value, see multiconfig.py

# Backup exclude - each file is matched against this list, any match will 
# be excluded from the backup. By default, cache files, python compiled modules 
# and various temporary files are excluded.
# BE CAREFUL: this stuff is used as a regex and therefore must be valid regexes.
#backup_exclude = [ # this is the default value, see multiconfig.py
#    r"(.+\.py(c|o)$)",
#    r"%(cache_dir)s",
#    r"%(/)spages%(/)s.+%(/)scache%(/)s[^%(/)s]+$" % {'/': os.sep},
#    r"%(/)s(edit-lock|event-log|\.DS_Store)$" % {'/': os.sep},
#]

http://be.nucl.ap.titech.ac.jp/~koba/cgi-bin/moin.cgi/?action=backup

閲覧制限

以下の文を書く。

#acl All:

wiki 内にコメント

  • 以下の文を書く。
  • {{{#!wiki comment
    ここがコメント
    }}}

wiki 内に{{{

  • 以下のように{{{{ ~ }}}}を用いる。

  • {{{{
    {{{#!wiki
    ~~~~~~
    }}}
    }}}}

wiki 内にそのまま表示

  • ` でくくる。

ナビバー

ナビバーの項目を変更するには wikiconfig.py の以下の部分を変更。

    navi_bar = [
        # If you want to show your page_front_page here:
        u'%(page_front_page)s',
        u'RecentChanges',
        u'FindPage',
        u'HelpContents',
        u'SyntaxReference',
        u'SiteNavigation',
    ]

SyntaxReference を日本語にする

ナビバー上の SyntaxReference を日本語にするには、 home/USERNAME/MoinMoin/lib/python2.4/site-packages/i18n/ja.MoinMoin.po に以下の行を追記した。msgid "FrontPage" , msgid "RecentChanges"

  • 辺りに追記した。

msgid "SyntaxReference"
msgstr "シンタックスリファレンス"

マクロを追加

MiniPage

MacroMarket / MiniPage から MiniPage のマクロをダウンロードし、 DATA-DIR/plugin/macro に MiniPage-1.7.1-5.py をダウンロードして、 MiniPage.py にリネームすれば良い。

$ cd /path_to_wiki_instance/data/plugin/macro # path_to_wiki_instance は Wiki の実体があるディレクトリ。
$ wget http://moinmo.in/MacroMarket/MiniPage\?action\=AttachFile\&do\=get\&target\=MiniPage-1.7.1-5.py
$ mv MiniPage\?action\=AttachFile\&do\=get\&target\=MiniPage-1.7.1-5.py MiniPage.py

MIME タイプの設定

MIME タイプの設定をしていない添付ファイルはページ内では表示できず、以下のようなメッセージが表示される。

現在の設定はMIMEタイプが application/octet-stream であるファイル htest.f の埋め込みを許可していません。: htest.f

wukiconfig.py で 以下のように設定すればよい。.fで終わるファイルの場合、 FORTRAN90 のパーサが適用される。

    # Content options ---------------------------------------------------
    import mimetypes
    mimetypes.add_type("text/plain", ".kumac", True)
    mimetypes.add_type("text/palin", ".f", True)

パーサを追加

shell

からダウンロードする。以下はダウンロード及びパーサ導入の例。DATA-DIR/plugin/parser に shell-11.py をダウンロードして、 shell.py にリネームすれば良い。

$ cd /home/user/share/moin/mywiki/data/plugin/parser
$ wget http://moinmo.in/ParserMarket/Shell\?action\=AttachFile\&do\=get\&target\=shell-11.py
$ mv Shell\?action\=AttachFile\&do\=get\&target\=shell-11.py shell.py

FORTRAN90

FORTRAN77 のパーサがないようなので、代わりに FORTRAN90 のパーサを追加する。

このページに行き、ソースを fortran90.py として DATA-DIR/plugin/parser に保存。使い方もこのページに書いてある。以下はコマンドの例。

$ cd /home/user/share/moin/mywiki/data/plugin/parser
$ emacs fortran90.py
  fortran90.py のソースをコピーして保存。行番号は消す。
  さらに、 Moin1.8 では、 

  from MoinMoin.util.ParserBase import ParserBase

  Dependencies = []

  の部分を、
 
  from MoinMoin.parser._ParserBase import ParserBase

  Dependencies = ['user'] # the "Toggle line numbers link" depends on user's language

  に変更。

使い方は以下のようにソースの先頭に {{{#!fortran90 と書く。

{{{#!fortran90  numbers=off
c
c hello_world.f
c
      program hello_world
      write(*,*) 'Hello world!'
      
      end
}}}

Moin で LaTeX

上記サイトを参考に、Moin で LaTeX を使えるようにする。まず、 Wiki が動いているサーバーに入り、 tex をインストールしたり、LaTeX を表示させるマクロ等をダウンロードして適切な場所に置く。

# apt-get install tetex-bin latex-ucs dvipng
# exit
$ wget http://johannes.sipsolutions.net/Projects/new-moinmoin-latex/parser?action=raw
$ mv parser\?action\=raw /home/user/share/moin/mywiki/data/plugin/parser/latex.py
$ wget http://johannes.sipsolutions.net/Projects/new-moinmoin-latex/macro?action=raw
$ mv macro\?action\=raw /home/user/share/moin/mywiki/data/plugin/macro/latex.py
$ # もし Actions で Attach File が使えなかったら、wikiconfig.py にallowed_actions = ['AttachFile'] を書く?うちの場合は、何もしなかった。
$ # さらに default_markup = "inline_latex" って行も加えたほうがいいんだろうか?なくてもよさそう。

そうしたら、 Wiki のどこかのページに以下の行を書いてみる。

<<latex(\usepackage{dsfont} % $$\mathds{C}$$)>>

 $$\mathds{C}$$ と表示されれば OK 。ほかにも以下のようにいろいろ試してみる。

<<latex($$\int_{-\infty}^{+\infty}e^{-ax^2}dx=\sqrt{\frac{\pi}{a}}$$)>>

$$\int_{-\infty}^{+\infty}e^{-ax^2}dx=\sqrt{\frac{\pi}{a}}$$

注) Internet Explorer 6 だと画像の表示が変になる。透過PNGは無理?