Ticket #3608 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

(patch) add Syntax Coloring of Source Code to blog

Reported by: Wang Diancheng Assigned to: osimons
Priority: normal Component: FullBlogPlugin
Severity: normal Keywords:
Cc: rjollos Trac Release: 0.11

Description

there is no "Syntax Coloring of Source Code" in fullblog.css, I create a patch to add it:

--- fullblog.css~       2008-08-26 10:41:33.000000000 +0800
+++ fullblog.css        2008-08-26 10:19:53.000000000 +0800
@@ -1,6 +1,7 @@
 /*
 ** Styles for the /blog pages and blog items in macros
 */
+@import url(../../../chrome/common/css/code.css);

 .blog #main {
     width: 75%;

Attachments

Change History

08/26/08 05:38:29 changed by anonymous

  • type changed from defect to enhancement.

(follow-up: ↓ 3 ) 08/26/08 12:25:27 changed by osimons

Sorry, but I cannot replicate this. If I add code to the post, it highlights like it should - both inside the blog and when posts are rendered as macros. Try something like this inside a post:

{{{
#!python

class Testing(object):
    """ My docstring. """
    pass
}}}

Does it not highlight in your Trac? The source rendering processor should add the needed stylesheet - mine adds pygments/trac.css. Do you perhaps use a different highlighter?

(in reply to: ↑ 2 ; follow-up: ↓ 4 ) 08/26/08 12:45:14 changed by anonymous

Replying to osimons:

Sorry, but I cannot replicate this. If I add code to the post, it highlights like it should - both inside the blog and when posts are rendered as macros. Try something like this inside a post: {{{ {{{ #!python class Testing(object): """ My docstring. """ pass }}} }}} Does it not highlight in your Trac? The source rendering processor should add the needed stylesheet - mine adds pygments/trac.css. Do you perhaps use a different highlighter?

I use clearsilver, there is no highlight by default when I add code to post.

(in reply to: ↑ 3 ) 08/28/08 02:35:16 changed by osimons

Replying to anonymous:

I use clearsilver, there is no highlight by default when I add code to post.

You mean silvercity, I suppose?

Anyway, that starts sounding like a Trac bug I need to look into. The stylesheet should be added as needed, and work for all supported highlighters.

09/03/09 08:16:09 changed by rjollos

  • cc set to rjollos.

11/14/10 01:06:47 changed by osimons

  • status changed from new to closed.
  • resolution set to fixed.

(In [9429]) FullBlogPlugin: Adding Trac code.css stylesheet to all post rendering for correct rendering of inline syntax highlighting.

Fixes #3608. Sorry for the time it took to fix this... :-)


Add/Change #3608 ((patch) add Syntax Coloring of Source Code to blog)




Change Properties
Action