MoinMoin
Contents
Snippets
Installation
These snippets install MoinMoin in /tmp, replace the destination to your desired location.
- initialize Python environment:
virtualenv2 \ --python /usr/bin/python2.7 \ --no-site-packages \ -- /tmp/moinmoin/1.9.8--1
install pip (if needed):
/tmp/moinmoin/1.9.8--1/bin/pip install -- pip
install moinmoin:
/tmp/moinmoin/1.9.8--1/bin/pip install -- moin==1.9.8
install docutils:
/tmp/moinmoin/1.9.8--1/bin/pip install -- docutils==0.11
Cleanup
All these commands assume that you are running them within the root folder of the wiki deployment. (I.e. that folder that contains the sub-folders pages, plugin, user, etc.)
find all empty edit-log files belonging to "dangling" pages, and remove them:
find ./pages -mindepth 2 -maxdepth 2 -type f -name 'edit-log' -empty -print # -delete
find all empty attachments folders belonging to pages:
find ./pages -mindepth 2 -maxdepth 2 -type d -name 'attachments' -empty -print # -delete
find all edit-lock files belonging to pages:
find ./pages -mindepth 2 -maxdepth 2 -type f \( -name 'edit-lock' -o -name 'current-locked' \) -print # -delete
find all cache folders belonging to pages, and delete them:
find ./pages -mindepth 2 -maxdepth 2 -type d -name 'cache' -prune -print # -exec rm -R -- {} \;
- find all empty folders belonging to the "dangling" pages, and remove them:
find ./pages -mindepth 1 -maxdepth 1 -type d -empty -print # -delete
- find all attachments created by the LaTeX plugin:
find ./pages -mindepth 3 -maxdepth 3 -type f -path '*/attachments/*' -name 'latex_*_p*.png' -print # -delete
Patches
Disable implicit camel-case page links
This patch forces the parser to ignore camel-case words (for example CamelCase), and not transform them into page links. (Thus the user is forced to use [[CamelCase]] for page links.)
--- ./[original]/MoinMoin/parser/text_moin_wiki.py +++ ./[patched]/MoinMoin/parser/text_moin_wiki.py @@ -303,11 +303,11 @@ (?P<tt_bt_text>.*?) # capture the text ` # off )|(?P<interwiki> %(interwiki_rule)s # OtherWiki:PageName )|(?P<word> # must come AFTER interwiki rule! - %(word_rule)s # CamelCase wiki words + <<__disabled__:%(word_rule)s:__disabled__>> # CamelCase wiki words )| %(link_rule)s | %(transclude_rule)s |(?P<url>
Increase restructured-text includes limit
Increasing this limit might allow an user (which already has write acess to your wiki) to use many include directives, thus leading to increased server load.
--- ./[original]/MoinMoin/parser/text_rst.py +++ ./[patched]/MoinMoin/parser/text_rst.py @@ -563,7 +563,7 @@ # As a quick fix for infinite includes we only allow a fixed number of # includes per page self.num_includes = 0 - self.max_includes = 10 + self.max_includes = 100 # Handle the include directive rather than letting the default docutils # parser handle it. This allows the inclusion of MoinMoin pages instead of EOS