Anonymous avatar Anonymous committed ad60c26

[svn] Note lexer mimetypes in docs.

Comments (0)

Files changed (5)

 - more setuptools entrypoints (html formatter etc.)
   see paste script's Commands
 
-- note mimetypes in lexer docs
-
 - pygmentize presets?
 
 - short cmdline options for common ``-O`` options

docs/src/lexers.txt

 
     :Aliases: ``text``
     :Filename patterns: ``*.txt``
+    :Mimetypes: ``text/plain``
 
 
 `RawTokenLexer`
 
     :Aliases: ``raw``
     :Filename patterns: ``*.raw``
+    :Mimetypes: ``application/x-pygments/tokens``
 
 
 Agile languages
 
     :Aliases: ``python``, ``py``
     :Filename patterns: ``*.py``, ``*.pyw``
+    :Mimetypes: ``text/x-python``, ``application/x-python``
 
 
 `PythonConsoleLexer`
 
     :Aliases: ``pycon``
     :Filename patterns: None
+    :Mimetypes: None
 
 
 `RubyLexer`
 
     :Aliases: ``ruby``, ``rb``
     :Filename patterns: ``*.rb``
+    :Mimetypes: ``text/x-ruby``, ``application/x-ruby``
 
 
 `RubyConsoleLexer`
 
     :Aliases: ``rbcon``, ``irb``
     :Filename patterns: None
+    :Mimetypes: None
 
 
 `PerlLexer`
 
     :Aliases: ``perl``, ``pl``
     :Filename patterns: ``*.pl``, ``*.pm``
+    :Mimetypes: ``text/x-perl``, ``application/x-perl``
 
 
 `LuaLexer`
 
     :Aliases: ``lua``
     :Filename patterns: ``*.lua``
+    :Mimetypes: ``text/x-lua``, ``application/x-lua``
+
 
 `SchemeLexer`
 
 
     :Aliases: ``scheme``
     :Filename patterns: ``*.scm``
+    :Mimetypes: ``text/x-scheme``, ``application/x-scheme``
 
 
 Compiled languages
 
     :Aliases: ``c``
     :Filename patterns: ``*.c``, ``*.h``
+    :Mimetypes: ``text/x-chdr``, ``text/x-csrc``
 
 
 `CppLexer`
 
     :Aliases: ``cpp``, ``c++``
     :Filename patterns: ``*.cpp``, ``*.hpp``, ``*.c++``, ``*.h++``
+    :Mimetypes: ``text/x-c++hdr``, ``text/x-c++src``
 
 
 `DelphiLexer`
 
     :Aliases: ``delphi``, ``pas``, ``pascal``, ``objectpascal``
     :Filename patterns: ``*.pas``
+    :Mimetypes: ``text/x-pascal``
 
 
 `JavaLexer`
 
     :Aliases: ``java``
     :Filename patterns: ``*.java``
+    :Mimetypes: ``text/x-java``
 
 
 .NET languages
 
     :Aliases: ``c#``, ``csharp``
     :Filename patterns: ``*.cs``
+    :Mimetypes: ``text/x-csharp``
+
 
 `BooLexer`
 
 
     :Aliases: ``boo``
     :Filename patterns: ``*.boo``
+    :Mimetypes: ``text/x-boo``
+
 
 `VbNetLexer`
 
 
     :Aliases: ``vbnet``, ``vb.net``
     :Filename patterns: ``*.vb``, ``*.bas``
+    :Mimetypes: ``text/x-vbnet``, ``text/x-vba``
 
 
 Web-related languages
 
     :Aliases: ``js``, ``javascript``
     :Filename patterns: ``*.js``
+    :Mimetypes: ``text/x-javascript``, ``application/x-javascript``, ``text/javascript``
 
 
 `CssLexer`
 
     :Aliases: ``css``
     :Filename patterns: ``*.css``
+    :Mimetypes: ``text/css``
 
 
 `HtmlLexer`
 
     :Aliases: ``html``
     :Filename patterns: ``*.html``, ``*.htm``, ``*.xhtml``
+    :Mimetypes: ``text/html``, ``application/xhtml+xml``
 
 
 `PhpLexer`
 
     :Aliases: ``php``, ``php3``, ``php4``, ``php5``
     :Filename patterns: ``*.php``, ``*.php[345]``
+    :Mimetypes: None
 
 
 `XmlLexer`
 
     :Aliases: ``xml``
     :Filename patterns: ``*.xml``
+    :Mimetypes: ``text/xml``, ``application/xml``, ``image/svg+xml``,
+                 ``application/rss+xml``, ``application/atom+xml``,
+                 ``application/xsl+xml``, ``application/xslt+xml``
 
 
 Template languages
 
     :Aliases:   ``html+php``
     :Filename patterns:  ``*.phtml``
+    :Mimetypes: ``text/x-php``, ``application/x-php``,
+                ``application/x-httpd-php``, ``application/x-httpd-php3``,
+                ``application/x-httpd-php4``, ``application/x-httpd-php5``
 
 
 `XmlPhpLexer`
 
     :Aliases: ``sql``
     :Filename patterns: ``*.sql``
+    :Mimetypes: ``text/x-sql``
 
 
 `BrainfuckLexer`
 
     :Aliases: ``brainfuck``
     :Filename patterns: ``*.bf``, ``*.b``
+    :Mimetypes: None
 
 
 `BashLexer`
 
     :Aliases: ``ini``, ``cfg``
     :Filename patterns: ``*.ini``, ``*.cfg``
+    :Mimetypes: None
 
 
 `MakefileLexer`
 
     :Aliases: ``make``, ``makefile``, ``mf``
     :Filename patterns: ``*.mak``, ``Makefile``, ``makefile``
+    :Mimetypes: ``text/x-makefile``
 
 
 `DiffLexer`
 
     :Aliases: ``diff``
     :Filename patterns: ``*.diff``, ``*.patch``
+    :Mimetypes: ``text/x-diff``, ``text/x-patch``
 
 
 `IrcLogsLexer`
 
     :Aliases: ``irc``
     :Filename patterns: None
+    :Mimetypes: None
 
 
 `TexLexer`
 
     :Aliases: ``tex``, ``latex``
     :Filename patterns: ``*.tex``, ``*.aux``, ``*.toc``
+    :Mimetypes: ``text/x-tex``, ``text/x-latex``
 
 
 `GroffLexer`
 
     :Aliases: ``groff``, ``nroff``, ``man``
     :Filename patterns: ``*.[1234567]``, ``*.man``
+    :Mimetypes: ``text/troff``, ``application/x-troff``
 
 
 `ApacheConfLexer`
 
     :Aliases: ``apacheconf``, ``aconf``
     :Filename patterns: ``.htaccess``, ``apache.conf``
+    :Mimetypes: None
 
 
 Iterating over all lexers

pygments/lexers/_mapping.py

     'JavascriptDjangoLexer': ('pygments.lexers.templates', 'JavaScript+Django/Jinja', ('js+django', 'javascript+django', 'js+jinja', 'javascript+jinja'), (), ()),
     'JavascriptErbLexer': ('pygments.lexers.templates', 'JavaScript+Ruby', ('js+erb', 'javascript+erb', 'js+ruby', 'javascript+ruby'), (), ()),
     'JavascriptGenshiLexer': ('pygments.lexers.templates', 'JavaScript+Genshi Text', ('js+genshitext', 'js+genshi', 'javascript+genshitext', 'javascript+genshi'), (), ()),
-    'JavascriptLexer': ('pygments.lexers.web', 'JavaScript', ('js', 'javascript'), ('*.js',), ('application/x-javascript', 'text/x-javascript')),
+    'JavascriptLexer': ('pygments.lexers.web', 'JavaScript', ('js', 'javascript'), ('*.js',), ('application/x-javascript', 'text/x-javascript', 'text/javascript')),
     'JavascriptPhpLexer': ('pygments.lexers.templates', 'JavaScript+PHP', ('js+php', 'javascript+php'), (), ()),
     'JavascriptSmartyLexer': ('pygments.lexers.templates', 'JavaScript+Smarty', ('js+smarty', 'javascript+smarty'), (), ()),
     'LuaLexer': ('pygments.lexers.agile', 'Lua', ('lua',), ('*.lua',), ('text/x-lua', 'application/x-lua')),
     'RhtmlLexer': ('pygments.lexers.templates', 'RHTML', ('rhtml', 'html+erb', 'html+ruby'), ('*.rhtml',), ()),
     'RubyConsoleLexer': ('pygments.lexers.agile', 'Ruby irb session', ('rbcon', 'irb'), (), ()),
     'RubyLexer': ('pygments.lexers.agile', 'Ruby', ('rb', 'ruby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx'), ('text/x-ruby', 'application/x-ruby')),
-    'SchemeLexer': ('pygments.lexers.agile', 'Scheme', ('scheme',), ('*.scm',), ()),
+    'SchemeLexer': ('pygments.lexers.agile', 'Scheme', ('scheme',), ('*.scm',), ('text/x-scheme', 'application/x-scheme')),
     'SmartyLexer': ('pygments.lexers.templates', 'Smarty', ('smarty',), ('*.tpl',), ()),
     'SqlLexer': ('pygments.lexers.other', 'SQL', ('sql',), ('*.sql',), ('text/x-sql',)),
     'TexLexer': ('pygments.lexers.text', 'TeX', ('tex', 'latex'), ('*.tex', '*.aux', '*.toc'), ('text/x-tex', 'text/x-latex')),

pygments/lexers/agile.py

     name = 'Scheme'
     aliases = ['scheme']
     filenames = ['*.scm']
+    mimetypes = ['text/x-scheme', 'application/x-scheme']
 
     # list of known keywords and builtins taken form vim 6.4 scheme.vim
     # syntax file.

pygments/lexers/web.py

     name = 'JavaScript'
     aliases = ['js', 'javascript']
     filenames = ['*.js']
-    mimetypes = ['application/x-javascript', 'text/x-javascript']
+    mimetypes = ['application/x-javascript', 'text/x-javascript', 'text/javascript']
 
     flags = re.DOTALL
     tokens = {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.