Attachment 'camelcase_setting.diff'

Download

   1 diff -r 2254e666cea3 MoinMoin/config/multiconfig.py
   2 --- a/MoinMoin/config/multiconfig.py	Sat Nov 29 22:42:52 2008 +0100
   3 +++ b/MoinMoin/config/multiconfig.py	Sun Nov 30 02:23:13 2008 +0100
   4 @@ -991,6 +991,8 @@
   5      ('language_default', 'en', "Default language for user interface and page content, see HelpOnLanguages."),
   6      ('language_ignore_browser', False, "if True, ignore user's browser language settings, see HelpOnLanguages."),
   7  
   8 +    ('link_camelcase', True, 'if True, auto-link CamelCase words'),
   9 +
  10      ('log_reverse_dns_lookups', True,
  11       "if True, do a reverse DNS lookup on page SAVE. If your DNS is broken, set this to False to speed up SAVE."),
  12      ('log_timing', False,
  13 diff -r 2254e666cea3 MoinMoin/parser/text_moin_wiki.py
  14 --- a/MoinMoin/parser/text_moin_wiki.py	Sat Nov 29 22:42:52 2008 +0100
  15 +++ b/MoinMoin/parser/text_moin_wiki.py	Sun Nov 30 02:23:13 2008 +0100
  16 @@ -94,21 +94,23 @@
  17           |
  18           ^  # ... or beginning of line
  19          )
  20 -        (?P<word_bang>\!)?  # configurable: avoid getting CamelCase rendered as link
  21 -        (?P<word_name>
  22 -         (?:
  23 -          (%(parent)s)*  # there might be either ../ parent prefix(es)
  24 -          |
  25 -          ((?<!%(child)s)%(child)s)?  # or maybe a single / child prefix (but not if we already had it before)
  26 +        (?P<word_all>
  27 +         (?P<word_bang>\!)?  # configurable: avoid getting CamelCase rendered as link
  28 +         (?P<word_name>
  29 +          (?:
  30 +           (%(parent)s)*  # there might be either ../ parent prefix(es)
  31 +           |
  32 +           ((?<!%(child)s)%(child)s)?  # or maybe a single / child prefix (but not if we already had it before)
  33 +          )
  34 +          (
  35 +           ((?<!%(child)s)%(child)s)?  # there might be / child prefix (but not if we already had it before)
  36 +           (?:[%(u)s][%(l)s]+){2,}  # at least 2 upper>lower transitions make CamelCase
  37 +          )+  # we can have MainPage/SubPage/SubSubPage ...
  38 +          (?:
  39 +           \#  # anchor separator          TODO check if this does not make trouble at places where word_rule is used
  40 +           (?P<word_anchor>\S+)  # some anchor name
  41 +          )?
  42           )
  43 -         (
  44 -          ((?<!%(child)s)%(child)s)?  # there might be / child prefix (but not if we already had it before)
  45 -          (?:[%(u)s][%(l)s]+){2,}  # at least 2 upper>lower transitions make CamelCase
  46 -         )+  # we can have MainPage/SubPage/SubSubPage ...
  47 -         (?:
  48 -          \#  # anchor separator          TODO check if this does not make trouble at places where word_rule is used
  49 -          (?P<word_anchor>\S+)  # some anchor name
  50 -         )?
  51          )
  52          (?:
  53           (?![%(u)s%(l)s/])  # require anything not upper/lower/slash following
  54 @@ -402,6 +404,9 @@
  55          self.line_anchors = kw.get('line_anchors', True)
  56          self.start_line = kw.get('start_line', 0)
  57          self.macro = None
  58 +
  59 +        self.link_camelcase = (request.getPragma('camelcase', request.cfg.link_camelcase)
  60 +                               in (True, 1, 'on', '1'))
  61  
  62          # currently, there is only a single, optional argument to this parser and
  63          # (when given), it is used as class(es) for a div wrapping the formatter output
  64 @@ -608,6 +613,8 @@
  65  
  66      def _word_repl(self, word, groups):
  67          """Handle WikiNames."""
  68 +        if not self.link_camelcase:
  69 +            return self.formatter.text(groups.get('word_all'))
  70          bang = ''
  71          bang_present = groups.get('word_bang')
  72          if bang_present:
  73 @@ -635,6 +642,7 @@
  74      _word_bang_repl = _word_repl
  75      _word_name_repl = _word_repl
  76      _word_anchor_repl = _word_repl
  77 +    _word_all_repl = _word_repl
  78  
  79      def _url_repl(self, word, groups):
  80          """Handle literal URLs."""

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-11-13 22:24:06, 64.4 KB) [[attachment:FeatureRequests-PragmaCamelCase-text_moin_wiki.py]]
  • [get | view] (2008-11-30 01:29:04, 3.6 KB) [[attachment:camelcase_setting.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.