Edgewall Software

Changes between Initial Version and Version 1 of FlexibleWikiPageNames


Ignore:
Timestamp:
Oct 17, 2005, 3:44:17 PM (19 years ago)
Author:
Christian Boos
Comment:

Proposal for easily customizable WikiPageNames rules

Legend:

Unmodified
Added
Removed
Modified
  • FlexibleWikiPageNames

    v1 v1  
     1= Flexible WikiPageNames =
     2
     3This page describes an experimental feature for having new custom-defined
     4wiki page names conventions.
     5
     6The implementation can be found in the
     7[source:branches/cboos-dev/flexible-branch flexible] branch.
     8
     9Each alternate Wiki Syntax is presented by a `IWikiPageNamesSyntaxProvider`.
     10By default, there are 3 WikiPageNames syntaxes to choose from.
     11This can easily be setup in the `[components]` section from the TracIni.
     12
     13Furthermore, it makes it easy to take full control of the wiki page names syntax
     14by writing an additional plugin.
     15For example, this is what we use:
     16{{{
     17#!python
     18class BctWikiPageNames(Component):
     19    """Like FlexibleWikiPageNames, but:
     20     * allow initial lower case letter
     21     * allow anything after the slash "/"
     22    """
     23
     24    implements(IWikiPageNameSyntaxProvider)
     25
     26    # IWikiPageNameSyntaxProvider methods
     27
     28    def get_wiki_page_names_syntax(self):
     29        return (WIKI_START +
     30                r"(?:[A-Z\d]{2,}[a-z]+"                          # 1st way
     31                r"|[a-z]?[A-Z\d]+[a-z]+(?:/?[A-Z\d]+[a-z]*)+)" + # 2nd way
     32                WIKI_TARGET + WIKI_END)
     33
     34}}}
     35
     36The `WIKI_START`, `WIKI_TARGET` and `WIKI_END` constants correspond
     37to pieces of regular expressions that can be reused from syntax provider
     38to syntax provider.
     39