Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#4523 closed enhancement (worksforme)

How to add JSP syntax coloring to Trac

Reported by: a.rodger@… Owned by: Christian Boos
Priority: lowest Milestone:
Component: version control/browser Version: 0.10.2
Severity: trivial Keywords: jsp, syntax, highlighting, coloring
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In trac_install_dir\mimeview\api.py if you change line 94 to read

    'text/xml':               ['xml', 'jsp'],

then you will have pretty good syntax highlighting (at least good enough to get you through until SilverCity or Enscript add JSP)

Attachments (0)

Change History (4)

comment:1 by a.rodger@…, 18 years ago

Forgot to mention, the java portions of the JSP will stay in plain text but any HTML parts and any use of taglibs will be colored properly

comment:2 by Christian Boos, 18 years ago

Milestone: 0.10.4
Resolution: worksforme
Status: newclosed

Well, no, in 0.10 we added a way to avoid having to hack the mimeview/api.py file each time a new kind of highlighting was needed: check TracIni#mimeviewer-section, the mime_map entry.

Here that would be:

[mimeviewer]
mime_map = text/xml:jsp

as xml is already mapped.

On a related node, Pygments could probably be extended to support highlighting HTML and the Java expressions inside…

comment:3 by Matthew Good, 18 years ago

I've opened an enhancement for this in Pygments: http://trac.pocoo.org/ticket/184

Using Trac 0.11dev or the th:TracPygmentsPlugin Trac should automatically support this if/when it's added to Pygments.

comment:4 by Christian Boos, 18 years ago

Done by Tim in http://trac.pocoo.org/changeset/2693.

Looks like it will be available in Pygments 0.7.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.