I'm still a bit shaky on exactly what to call these files, but I've gathered the roff, troff, groff, and nroff all pretty much refer to the same format (listed as application/x-troff in Trac). These include manpage source, of which one file exists in the Trac source tree.
Its extension is not matched by the current trac/mimeview/api.py (either of the two identical lines, hrmm), but extensions are specified in the Pygments lexer for it (since http://trac.pocoo.org/changeset/2424). Do you think it is feasible for the renderer's lexers' extensions (which are admittedly in fnmatch style) from Pygments to be overlaid to KNOWN_MIME_TYPES (or otherwise made available to get_mimetype) at runtime? I've patched get_mimetype to do this[1], but I'm slightly wary of putting code to call Pygments in the core, even wrapped with a try/catch block[2]. Opinions? Tim [1]: the fun part is... from pygments import get_lexer_for_filename mimetype = get_lexer_for_filename(filename).mimetypes[0] [2]: if it finds the mimetype is not already in the mapping, it probably needs to make sure something will be findable to render it too, making this kind of messy for new mimetypes. Luckily this particular one already exists. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en -~----------~----~----~----~------~----~------~--~---
