Re: showing source code in blog posts

Dieter Plaetinck <dieter-7FYLOmueu/[email protected]> Mon, 1 Nov 2010 22:53:01 +0100
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Thanks guys for your input.

On Mon, 1 Nov 2010 10:35:10 -0500
Terry Brown <terry_n_brown-/[email protected]> wrote:

> There's also http://alexgorbatchev.com/SyntaxHighlighter which is a
> javascript approach.

Seems wrong by design to me.  They even mention it themselves (at
http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html)
If you want the code to be shown instead of interpreted, you must do
all the escaping yourself, and then still rss readers will not apply
the hilighting ("<pre> method").  The alternative "<script>" method
allows you to not escape the html yourself, but will break horribly
without support for js (i.e. in rss readers)

On Mon, 1 Nov 2010 19:53:53 +0000
seanh <[email protected]> wrote:

> My Python Markdown 2 plugin can do source code highlighting if you
> have python pygments. It's another plugin that isn't in the plugin
> registry:
> 
> http://github.com/seanh/PyBlosxom-Python-Markdown-2-Plugin
> 
> See the Python Markdown 2 instructions for how to use source code
> highlighting:
> 
> http://www.freewisdom.org/projects/python-markdown/CodeHilite
> 
> You will have to edit line 35 of markdown-plugin.py to enable the
> codehilite extension.

Thanks, although I don't use markdown (nor RST), your plugin seems
simple enough to try using as a starting point.
Although i still don't get why my own plugin doesn't affect the text..
really weird..

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