In a beautiful meta-example of WikiNature, people have evolved PikiPiki into MoinMoin, with lots more features. * does this mean PikiPiki is deprecated and we should use MoinMoin instead? -- PhilJones * YES. ---- In addition, DiamondWiki is based on PikiPiki ---- PikiPiki is MartinPool's reimplementation of WikiWikiWeb in PythonLanguage, released under the GnuGeneralPublicLicense. The source is available at http://sourcefrog.net/projects/piki/. PikiPiki now comes with installation instructions and looks much prettier! I wanted to write this software because: * I wanted to compare a Python version to a Perl or Java implementation, in terms of code quality and performance. * It's fun to work on a small and productive project. * Everybody else seems to be building one. :-) Distinguishing features: * Tab is never required as a formatting character, because it's hard to type into many browsers. The markup codes are pretty similar. * Data is stored in plain text files, not in a database. This reduces contention between concurrent users and is more in the spirit of a quick solution. * Full-text search is quite fast, and doesn't lock out updates. * I don't do versioning - I think Wiki is not meant to be a document-management system. * PikiPiki offers an index of all titles, and an index of all words occurring in titles. I'd like to solve the ReverseLinkDisabled problem, perhaps by distracting SpamBot''''''s to a SpiderTrap. I've just installed it at MincomLtd as a ProjectWiki: it's going pretty well, but it takes a while to get people used to it. (More on this later, but see the discussion in ProjectWiki.) ---- I look back at this code now a year later and I still like it a lot. I think in some way it is the closest I have come to WabiSabi in code. -- MartinPool ---- There was formerly a Japanese-localized version of PikiPiki, derived from MoinMoin, but it no longer exists. The only change to MoinMoin needed by the Japanese version was to insert a META tag to specify the charset. I was amazed myself. :) ---- Re: SpamBot''''''s. Wiki currently denies access to sites that fetch stuff too quickly. Seems to work well, as the SpamBot''''''s can't tell the difference between a normal page and a page with nothing but a nasty message on it. Have you considered using a "submit" button, as described on the ReverseLinkDisabled page? If you're really in a bad mood, you could build a SpiderTrap: See http://www.turnstep.com/Spambot/harassment.html and http://www.monkeys.com/wpoison/ [link is dead. according to archive.org, it's been dead since 2002. Happily there are cached versions at archive.org] ''I thought I'd probably use some combination of a SpiderTrap and a YouAreDominatingMe message. The current working version is not public and so doesn't have to worry.'' ---- ''Thanks for making the source available, Martin (and thanks for advancing me a copy after my plea). BTW, it was easy as Py to install -- TimVoght'' ---- Can somebody help fix what I think is a PikiPiki bug? Verbatim mode ( three open braces in a row, text, three closed braces in a row ) doesn't seem to handle dashes correctly. It expands dashes to bars (HTML horizontal rules) instead of leaving them as ASCII dashes. Can someone point me in the right direction? My glance at the Python code didn't reveal any obvious defects. ---- The below code change seems to make PikiPiki handle dashes properly in verbatim mode. I made PikiPiki use a different regular expression scanner when in preformatted mode. If I knew Python, I could make a cleaner fix, but this seems to work. $ diff piki.cgi piki_old.cgi 412,413d411 < # When text is in
formatted mode, don't substitute
 <       # HTML horizontal rules for dashes.
 426,436d423
 <         scan_pre = re.compile(
 <             r"(?:(?P'{2,3})"
 <             + r"|(?P[<>&])"
 <             + r"|(?P\b(?:[A-Z][a-z]+){2,}\b)"
 <             + r"|(?P(http|ftp|nntp|news|mailto)\:[^\s'\"]+\S)"
 <             + r"|(?P[-\w._+]+\@[\w.-]+)"
 <             + r"|(?P
  • ^\s+\*)" < + r"|(?P
    (\{\{\{|\}\}\}))"
     <             + r"|(?P\[\[(TitleSearch|FullSearch|WordIndex"
     <                             + r"|TitleIndex|RecentChanges|GoTo)\]\])"
     <             + r")")
     450,452c437
     <                 print re.sub(scan_re, self.replace, line)
     <             else:
     <                 print re.sub(scan_pre, self.replace, line)
     ---
     >             print re.sub(scan_re, self.replace, line)
    ----
    
    ''Hi, does this do what you want? -- AndreasMeyer''
    
     $ diff piki.cgi piki.cgi.new
     416c416
     <             + r"|(?P-{4,})"
     ---
     >             + r"|(?P^-{4,})"
    
    ----
    
    The above looks like it will only convert a line of dashes to a horizontal rule
    if the line of dashes starts the beginning of a line. I don't think this does
    what I want, because preformatted text could also have a string of dashes that
    starts at the beginning of the line.
    
    ----
    
    Dashes isn't the problem, but anything inside braces works like outside; try to insert any text inside double quotes and it will be italicized. This hopefully will fix the problem:
    
        def _pre_repl(self, word):
            if word == '{{{' and not self.in_pre:
                self.in_pre = 1
                return '
    '
            elif self.in_pre:
                self.in_pre = 0
                return '
    ' else: return word def replace(self, match): for type, hit in match.groupdict().items(): if hit: if (not self.in_pre or self.in_pre and hit == '}}}'): return getattr(self, '_' + type + '_repl')(hit) else: return hit else: "Can't handle match " + repr(match) def print_html(self): # For each line, we scan through looking for magic # strings, outputting verbatim any intervening text scan_re = re.compile( r"(?:(?P'{2,3})" + r"|(?P[<>&])" + r"|(?P\b(?:[A-Z][a-z]+){2,}\b)" + r"|(?P-{4,})" + r"|(?P(http|ftp|nntp|news|mailto)\:[^\s'\"]+\S)" + r"|(?P[-\w._+]+\@[\w.-]+)" + r"|(?P
  • ^\s+\*)" + r"|(?P
    (\{\{\{|\}\}\}))"
                + r"|(?P\[\[(TitleSearch|FullSearch|WordIndex"
                                + r"|TitleIndex|RecentChanges|GoTo)\]\])"
                + r")")
            blank_re = re.compile("^\s*$")
            bullet_re = re.compile("^\s+\*")
            indent_re = re.compile("^\s*")
            eol_re = re.compile(r'\r?\n')
            raw = self.raw.expandtabs()
            for line in eol_re.split(raw):
                if not self.in_pre:
                    if blank_re.match(line):
                        print '

    ' continue indent = indent_re.match(line) print self._indent_to(len(indent.group(0))) print re.sub(scan_re, self.replace, line) if self.in_pre: print '

    ' print self._undent() ---- See WikiWikiClone MyConfusedIdeaOfWiki ---- ---- CategoryWikiImplementation