|
From: will kahn-g. <wi...@bl...> - 2010-11-01 12:46:09
|
When you say "I can't get it to work", what does that entail? What's
failing? Does it do something, but not the right thing? Are there \n
in the text? Is there an error?...
On 11/01/2010 05:50 AM, Dieter Plaetinck wrote:
>
> Thanks, that seems like a good idea.
> I've been looking at the markdown and linebreak parser plugins to see
> how to do it, but I can't get it to work.
> Just to get the first step working (modifying the page content), I use
> this code (comments stripped for clarity):
>
>
> __author__ = 'Dieter Plaetinck <di...@pl...>'
> __version__ = "0.1"
> PREFORMATTER_ID = 'pygments'
>
> import re
> def cb_preformat(args):
> if args['parser'] == PREFORMATTER_ID:
> return parse(''.join(args['story']))
>
> def parse(text):
> text = re.sub('\n','<h1>somethinghappens</h1>',text)
> return text
>
>
> and my config:
> $ grep pygment /srv/http/dieterblog/config.py
> py["load_plugins"] = ["comments", "tags", 'pygments']
> py['parser'] = 'pygments'
> the code is in this file: /srv/http/dieterblog/plugins/pygments.py
>
> Normally I should see "<h1>somethinghappens</h1>" all over the place,
> right? But my pages are the way they were before, as if it's still
> using the plain parser. When I use the debug renderer it confirms that
> Request.get_configuration() dict contains parser -> pygments
>
> No errors in my lighttpd error log either.
>
> Dieter
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> pyblosxom-users mailing list
> pyb...@li...
> https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
>
|