Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#9097 closed enhancement (fixed)

Consider adding keyword `csharp` to list of KNOWN_MIME_TYPES

Reported by: Ryan Ollos <ryano@…> Owned by: Christian Boos
Priority: normal Milestone: 0.12
Component: rendering Version: 0.12dev
Severity: normal Keywords: mimetypes
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I think it would be worthwhile to add the keyword csharp for use in wiki processor syntax highlighting. The one line patch to implement this is attached.

As described in my post on the mailing list, it was not readily apparent to me that file extensions can be used in addition to keywords. Since keywords such as python and ruby are used for specifying syntax highlighting, without knowing that any file extensions defined in the list of known mime types can be used, one might guess that csharp would be implemented as well.

I can't think of a reason extra keyword synonyms would be a problem, so if there is none, I would think that it would be helpful to have a few extra synonyms that a user might reasonably guess.

If this is determined to be not worthwhile, then I'll just define csharp in the [mimeviewer] section of trac.ini, so its not a big deal to me either way. Also text/csharp can be used in a wiki processor, so the additional synonym presents a pretty minor convenience (aside from catching those users that are making a guess).

Finally, after looking at #127 (and the associated changesets that shown methods such as def c_processor), I also wonder if the keywords are only present for backward-compatibility, which might be a reason to NOT add additional keywords.

Attachments (1)

csharp-keyword.patch (597 bytes ) - added by ryano@… 14 years ago.

Download all attachments as: .zip

Change History (5)

by ryano@…, 14 years ago

Attachment: csharp-keyword.patch added

comment:1 by Christian Boos, 14 years ago

Keywords: mimetypes added
Resolution: fixed
Status: newclosed

Btw, those "keywords" were not originally keywords but rather file extensions, intended to be used to detect the type from the filename. IIRC we only added some synonyms later (for python and ruby, etc.), so there's no harm in adding one more for csharp. I did that in a more systematic way in r9303.

The real improvement would be to make the existing keyword more discoverable than by looking inside trac/mimeview/api.py, as there are various sources beyond that. I was somehow waiting for making some progress on #3332 before that, but creating a [[KnownMimeTypes]] macro first shouldn't be that problematic.

Added in r9305.

comment:2 by Christian Boos, 14 years ago

Owner: set to Christian Boos

comment:4 by Ryan Ollos <ryano@…>, 14 years ago

These improvements you made are great … really helps with the clarity of the documentation. Thanks!

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.