Trac support for a SilverCity module
|Reported by:||Owned by:||Christian Boos|
|Severity:||normal||Keywords:||csharp silvercity syntax coloring|
|Cc:||aj@…, David_Chilton@…, junkmail.joe@…, rhind@…||Branch:|
I've put together the modifications necessary to highlight C# code with Trac using SilverCity. I figured I'd submit them, in case you all say fit to use it. :)
Anyhow, directions are as follows:
trac/Wiki.py needs an update on line 34 to include the hash symbol in the regex.
processor_re = re.compile('#\!([a-zA-Z#]+)')
MIME_MAP in trac/Mimeview.py gets two new entries:
trac/mimeviewers/silvercity.py has a few changes:
supported_types gets a new entry:
as does type_lang:
The site-packages/SilverCity directory gets a new file: CSharp.py. This file has been attached.
Finally, site-packages/SilverCity/Keywords.py gets a new entry:
csharp_keywords = \ "bool break case catch char class const continue "\ "default delete do double else enum explicit export extern false float for foreach "\ "friend goto if inline in int interface long mutable namespace new operator private protected public "\ "register return sealed short signed sizeof static string struct switch "\ "this throw true try typedef typeid typename union unsigned using "\ "virtual void volatile while"
And that should do it. Trac can now syntax-color .cs files, as well as code blocks marked with #!cs or #!c#