Skip navigation.

Posts tagged with "moinmoin"

使用CSS美化MoinMoin页面布局

http://moinmoin.wikiwikiweb.de/ZhangYunfeng/DivParser

大部分代码取自于ReimarBauer'的Frame Parser

在CSS文件中定义相应id或class,可以让MoinMoin wiki中的页面布局随意变更。这里的布局是指正文中的布局。整个wiki页面的布局还是需要通过theme来定义。

看下面这个示例

修改Moin不查找带有日期的页面

,

在Moin Wiki里面使用MonthCalendar作日志,所以带有日期的页面有很多比如Journal/xxxx-xx-xx (x表示数字. 日期格式) 每次点击类似不存在的页面时Moin都要找来找去列出一堆类似页面,速度太慢了,而且没有什么用处,所以使用正则表达式来剔除这种页面。

修改macro/LikePages.py

# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - Create list of LikePages

    @copyright: 2004 by Johannes Berg <johannes@sipsolutions.de>
    @license: GNU GPL, see COPYING for details.
"""

Dependencies = ['namespace']

from MoinMoin.action import LikePages

# 正则表达式
import re
date = re.compile(r'\d{4}-\d{2}-\d{2}')

def execute(macro, args):
    request = macro.request
    pagename = macro.formatter.page.page_name

    # 检查页面是否带有日期形式字符串
    if re.search(date, pagename):
        return 'Calendar Page will not be searched.'

    # Get matches
    start, end, matches = LikePages.findMatches(pagename, request)

    # Render matches
    if matches and not isinstance(matches, (str, unicode)):
        return request.redirectedOutput(LikePages.showMatches, pagename, request, start, end, matches, False)

    return args

Theme for MoinMoin: rightsidebar_darkblue

use original sidebar theme and blosxom's default background image.

you can download the theme file here




Wiki 内部专用

, ,

我们刚刚使用MoinMoin建立了一个供内部使用的wiki,维护工作由hitluckyfox负责。

建立这个wiki的目的是要把内部资源整合梳理,保证信息在内部成员之间顺畅的传递,同时对有价值的内容要整理保留。成员可以就各种内部问题进行探讨,新人可以在wiki里面快速定位查找必要的资料信息。

愿望虽然好,实施和推广却不容易,除了少数几个人之外,绝大多数对wiki一无所知。但是很多人已经有知识整理的愿望,希望能够有一种方便的高效的方式来处理信息。相较于前年第一次向大家介绍和演示wiki时的失败经历已经好多了。我想可以在近期再次推介wiki,相信可以达到更好效果。

BTW: 可能wiki不是最理想的手段,但它是目前我们可以使用的、不需要太多训练就可以使用的手段。

MoinMoin LikePages little hack

,

MoinMoin中每次点击一个页面不存在的链接时,都会引入MissingPage,其中列出可以使用的模板以及与当前页面名称类似的页面名称列表,这个“类似”指的是含有全部或者部分相同的名称。这个功能是挺好的,但是用在日志页面的时候(用MonthCalendar宏做日志记录很方便),就会列出很长的一个列表,让人不剩厌烦。

于是乎自己修改了一下LikePages文件,对查找到的类似的页面名称只显示5个,多余的内容则通过javascript隐藏起来,只给出一个"More"链接。具体修改内容可以看hide show too many LikePages results

下面是修改之后的效果