#9097 closed enhancement (fixed)
Consider adding keyword `csharp` to list of KNOWN_MIME_TYPES
Reported by: | 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)
Change History (5)
by , 15 years ago
Attachment: | csharp-keyword.patch added |
---|
comment:1 by , 15 years ago
Keywords: | mimetypes added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 by , 15 years ago
Owner: | set to |
---|
comment:4 by , 15 years ago
These improvements you made are great … really helps with the clarity of the documentation. Thanks!
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
andruby
, etc.), so there's no harm in adding one more forcsharp
. 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.