Modify

Opened 6 years ago

Closed 3 years ago

#3608 closed enhancement (fixed)

(patch) add Syntax Coloring of Source Code to blog

Reported by: Wang Diancheng Owned by: 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

    old new  
    11/* 
    22** Styles for the /blog pages and blog items in macros 
    33*/ 
     4@import url(../../../chrome/common/css/code.css); 
    45 
    56.blog #main { 
    67    width: 75%; 

Attachments (0)

Change History (6)

comment:1 Changed 6 years ago by anonymous

  • Type changed from defect to enhancement

comment:2 follow-up: Changed 6 years ago 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?

comment:3 in reply to: ↑ 2 ; follow-up: Changed 6 years ago 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.

comment:4 in reply to: ↑ 3 Changed 6 years ago 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.

comment:5 Changed 5 years ago by rjollos

  • Cc rjollos added

comment:6 Changed 3 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

(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 Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.