summaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/templates.py
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-05-20 07:58:40 +0300
committerrobot-piglet <[email protected]>2024-05-20 08:05:00 +0300
commitbcd5bcc390793791d293d386b2ebefbe683fb4e1 (patch)
treec93e3b8c847237e7e7626f4a07f1b657bb34f04d /contrib/python/Pygments/py3/pygments/lexers/templates.py
parent1a9f1508fe9c8c5927ffebf33197a6108e70501d (diff)
Intermediate changes
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/templates.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/templates.py203
1 files changed, 131 insertions, 72 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/templates.py b/contrib/python/Pygments/py3/pygments/lexers/templates.py
index 5f46a47a81b..4084fbd5033 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/templates.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/templates.py
@@ -4,7 +4,7 @@
Lexers for various template engines' markup.
- :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -62,6 +62,7 @@ class ErbLexer(Lexer):
url = 'https://github.com/ruby/erb'
aliases = ['erb']
mimetypes = ['application/x-ruby-templating']
+ version_added = ''
_block_re = re.compile(r'(<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$)', re.M)
@@ -156,6 +157,7 @@ class SmartyLexer(RegexLexer):
aliases = ['smarty']
filenames = ['*.tpl']
mimetypes = ['application/x-smarty']
+ version_added = ''
flags = re.MULTILINE | re.DOTALL
@@ -212,6 +214,7 @@ class VelocityLexer(RegexLexer):
url = 'https://velocity.apache.org/'
aliases = ['velocity']
filenames = ['*.vm', '*.fhtml']
+ version_added = ''
flags = re.MULTILINE | re.DOTALL
@@ -292,8 +295,10 @@ class VelocityHtmlLexer(DelegatingLexer):
name = 'HTML+Velocity'
aliases = ['html+velocity']
+ version_added = ''
alias_filenames = ['*.html', '*.fhtml']
mimetypes = ['text/html+velocity']
+ url = 'https://velocity.apache.org/'
def __init__(self, **options):
super().__init__(HtmlLexer, VelocityLexer, **options)
@@ -308,8 +313,10 @@ class VelocityXmlLexer(DelegatingLexer):
name = 'XML+Velocity'
aliases = ['xml+velocity']
+ version_added = ''
alias_filenames = ['*.xml', '*.vm']
mimetypes = ['application/xml+velocity']
+ url = 'https://velocity.apache.org/'
def __init__(self, **options):
super().__init__(XmlLexer, VelocityLexer, **options)
@@ -323,8 +330,8 @@ class VelocityXmlLexer(DelegatingLexer):
class DjangoLexer(RegexLexer):
"""
- Generic `django <http://www.djangoproject.com/documentation/templates/>`_
- and `jinja <https://jinja.pocoo.org/jinja/>`_ template lexer.
+ Generic `Django <https://www.djangoproject.com/documentation/templates/>`_
+ and `Jinja <https://jinja.palletsprojects.com>`_ template lexer.
It just highlights django/jinja code between the preprocessor directives,
other data is left untouched by the lexer.
@@ -333,6 +340,8 @@ class DjangoLexer(RegexLexer):
name = 'Django/Jinja'
aliases = ['django', 'jinja']
mimetypes = ['application/x-django-templating', 'application/x-jinja']
+ url = 'https://www.djangoproject.com/documentation/templates'
+ version_added = ''
flags = re.M | re.S
@@ -408,8 +417,6 @@ class MyghtyLexer(RegexLexer):
"""
Generic myghty templates lexer. Code that isn't Myghty
markup is yielded as `Token.Other`.
-
- .. versionadded:: 0.6
"""
name = 'Myghty'
@@ -417,6 +424,7 @@ class MyghtyLexer(RegexLexer):
aliases = ['myghty']
filenames = ['*.myt', 'autodelegate']
mimetypes = ['application/x-myghty']
+ version_added = '0.6'
tokens = {
'root': [
@@ -455,13 +463,13 @@ class MyghtyHtmlLexer(DelegatingLexer):
"""
Subclass of the `MyghtyLexer` that highlights unlexed data
with the `HtmlLexer`.
-
- .. versionadded:: 0.6
"""
name = 'HTML+Myghty'
aliases = ['html+myghty']
mimetypes = ['text/html+myghty']
+ url = 'http://www.myghty.org/'
+ version_added = '0.6'
def __init__(self, **options):
super().__init__(HtmlLexer, MyghtyLexer, **options)
@@ -471,13 +479,13 @@ class MyghtyXmlLexer(DelegatingLexer):
"""
Subclass of the `MyghtyLexer` that highlights unlexed data
with the `XmlLexer`.
-
- .. versionadded:: 0.6
"""
name = 'XML+Myghty'
aliases = ['xml+myghty']
mimetypes = ['application/xml+myghty']
+ url = 'http://www.myghty.org/'
+ version_added = '0.6'
def __init__(self, **options):
super().__init__(XmlLexer, MyghtyLexer, **options)
@@ -487,8 +495,6 @@ class MyghtyJavascriptLexer(DelegatingLexer):
"""
Subclass of the `MyghtyLexer` that highlights unlexed data
with the `JavascriptLexer`.
-
- .. versionadded:: 0.6
"""
name = 'JavaScript+Myghty'
@@ -496,6 +502,8 @@ class MyghtyJavascriptLexer(DelegatingLexer):
mimetypes = ['application/x-javascript+myghty',
'text/x-javascript+myghty',
'text/javascript+mygthy']
+ url = 'http://www.myghty.org/'
+ version_added = '0.6'
def __init__(self, **options):
super().__init__(JavascriptLexer, MyghtyLexer, **options)
@@ -505,13 +513,13 @@ class MyghtyCssLexer(DelegatingLexer):
"""
Subclass of the `MyghtyLexer` that highlights unlexed data
with the `CssLexer`.
-
- .. versionadded:: 0.6
"""
name = 'CSS+Myghty'
aliases = ['css+myghty']
mimetypes = ['text/css+myghty']
+ url = 'http://www.myghty.org/'
+ version_added = '0.6'
def __init__(self, **options):
super().__init__(CssLexer, MyghtyLexer, **options)
@@ -521,14 +529,13 @@ class MasonLexer(RegexLexer):
"""
Generic mason templates lexer. Stolen from Myghty lexer. Code that isn't
Mason markup is HTML.
-
- .. versionadded:: 1.4
"""
name = 'Mason'
url = 'http://www.masonhq.com/'
aliases = ['mason']
filenames = ['*.m', '*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler']
mimetypes = ['application/x-mason']
+ version_added = '1.4'
tokens = {
'root': [
@@ -576,8 +583,6 @@ class MakoLexer(RegexLexer):
"""
Generic mako templates lexer. Code that isn't Mako
markup is yielded as `Token.Other`.
-
- .. versionadded:: 0.7
"""
name = 'Mako'
@@ -585,6 +590,7 @@ class MakoLexer(RegexLexer):
aliases = ['mako']
filenames = ['*.mao']
mimetypes = ['application/x-mako']
+ version_added = '0.7'
tokens = {
'root': [
@@ -643,13 +649,13 @@ class MakoHtmlLexer(DelegatingLexer):
"""
Subclass of the `MakoLexer` that highlights unlexed data
with the `HtmlLexer`.
-
- .. versionadded:: 0.7
"""
name = 'HTML+Mako'
aliases = ['html+mako']
mimetypes = ['text/html+mako']
+ url = 'http://www.makotemplates.org/'
+ version_added = '0.7'
def __init__(self, **options):
super().__init__(HtmlLexer, MakoLexer, **options)
@@ -659,13 +665,13 @@ class MakoXmlLexer(DelegatingLexer):
"""
Subclass of the `MakoLexer` that highlights unlexed data
with the `XmlLexer`.
-
- .. versionadded:: 0.7
"""
name = 'XML+Mako'
aliases = ['xml+mako']
mimetypes = ['application/xml+mako']
+ url = 'http://www.makotemplates.org/'
+ version_added = '0.7'
def __init__(self, **options):
super().__init__(XmlLexer, MakoLexer, **options)
@@ -675,8 +681,6 @@ class MakoJavascriptLexer(DelegatingLexer):
"""
Subclass of the `MakoLexer` that highlights unlexed data
with the `JavascriptLexer`.
-
- .. versionadded:: 0.7
"""
name = 'JavaScript+Mako'
@@ -684,6 +688,8 @@ class MakoJavascriptLexer(DelegatingLexer):
mimetypes = ['application/x-javascript+mako',
'text/x-javascript+mako',
'text/javascript+mako']
+ url = 'http://www.makotemplates.org/'
+ version_added = '0.7'
def __init__(self, **options):
super().__init__(JavascriptLexer, MakoLexer, **options)
@@ -693,13 +699,13 @@ class MakoCssLexer(DelegatingLexer):
"""
Subclass of the `MakoLexer` that highlights unlexed data
with the `CssLexer`.
-
- .. versionadded:: 0.7
"""
name = 'CSS+Mako'
aliases = ['css+mako']
mimetypes = ['text/css+mako']
+ url = 'http://www.makotemplates.org/'
+ version_added = '0.7'
def __init__(self, **options):
super().__init__(CssLexer, MakoLexer, **options)
@@ -734,6 +740,7 @@ class CheetahLexer(RegexLexer):
aliases = ['cheetah', 'spitfire']
filenames = ['*.tmpl', '*.spt']
mimetypes = ['application/x-cheetah', 'application/x-spitfire']
+ version_added = ''
tokens = {
'root': [
@@ -773,6 +780,8 @@ class CheetahHtmlLexer(DelegatingLexer):
name = 'HTML+Cheetah'
aliases = ['html+cheetah', 'html+spitfire', 'htmlcheetah']
mimetypes = ['text/html+cheetah', 'text/html+spitfire']
+ url = 'http://www.cheetahtemplate.org/'
+ version_added = ''
def __init__(self, **options):
super().__init__(HtmlLexer, CheetahLexer, **options)
@@ -787,6 +796,8 @@ class CheetahXmlLexer(DelegatingLexer):
name = 'XML+Cheetah'
aliases = ['xml+cheetah', 'xml+spitfire']
mimetypes = ['application/xml+cheetah', 'application/xml+spitfire']
+ url = 'http://www.cheetahtemplate.org/'
+ version_added = ''
def __init__(self, **options):
super().__init__(XmlLexer, CheetahLexer, **options)
@@ -807,6 +818,8 @@ class CheetahJavascriptLexer(DelegatingLexer):
'application/x-javascript+spitfire',
'text/x-javascript+spitfire',
'text/javascript+spitfire']
+ url = 'http://www.cheetahtemplate.org/'
+ version_added = ''
def __init__(self, **options):
super().__init__(JavascriptLexer, CheetahLexer, **options)
@@ -818,9 +831,10 @@ class GenshiTextLexer(RegexLexer):
"""
name = 'Genshi Text'
- url = 'http://genshi.edgewall.org/'
+ url = 'https://genshi.edgewall.org/'
aliases = ['genshitext']
mimetypes = ['application/x-genshi-text', 'text/x-genshi']
+ version_added = ''
tokens = {
'root': [
@@ -913,14 +927,16 @@ class GenshiMarkupLexer(RegexLexer):
class HtmlGenshiLexer(DelegatingLexer):
"""
- A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
+ A lexer that highlights `genshi <https://genshi.edgewall.org/>`_ and
`kid <http://kid-templating.org/>`_ kid HTML templates.
"""
name = 'HTML+Genshi'
aliases = ['html+genshi', 'html+kid']
+ version_added = ''
alias_filenames = ['*.html', '*.htm', '*.xhtml']
mimetypes = ['text/html+genshi']
+ url = 'https://genshi.edgewall.org/'
def __init__(self, **options):
super().__init__(HtmlLexer, GenshiMarkupLexer, **options)
@@ -936,15 +952,17 @@ class HtmlGenshiLexer(DelegatingLexer):
class GenshiLexer(DelegatingLexer):
"""
- A lexer that highlights `genshi <http://genshi.edgewall.org/>`_ and
+ A lexer that highlights `genshi <https://genshi.edgewall.org/>`_ and
`kid <http://kid-templating.org/>`_ kid XML templates.
"""
name = 'Genshi'
aliases = ['genshi', 'kid', 'xml+genshi', 'xml+kid']
filenames = ['*.kid']
+ version_added = ''
alias_filenames = ['*.xml']
mimetypes = ['application/x-genshi', 'application/x-kid']
+ url = 'https://genshi.edgewall.org/'
def __init__(self, **options):
super().__init__(XmlLexer, GenshiMarkupLexer, **options)
@@ -966,10 +984,12 @@ class JavascriptGenshiLexer(DelegatingLexer):
name = 'JavaScript+Genshi Text'
aliases = ['js+genshitext', 'js+genshi', 'javascript+genshitext',
'javascript+genshi']
+ version_added = ''
alias_filenames = ['*.js']
mimetypes = ['application/x-javascript+genshi',
'text/x-javascript+genshi',
'text/javascript+genshi']
+ url = 'https://genshi.edgewall.org'
def __init__(self, **options):
super().__init__(JavascriptLexer, GenshiTextLexer, **options)
@@ -985,8 +1005,10 @@ class CssGenshiLexer(DelegatingLexer):
name = 'CSS+Genshi Text'
aliases = ['css+genshitext', 'css+genshi']
+ version_added = ''
alias_filenames = ['*.css']
mimetypes = ['text/css+genshi']
+ url = 'https://genshi.edgewall.org'
def __init__(self, **options):
super().__init__(CssLexer, GenshiTextLexer, **options)
@@ -1006,8 +1028,11 @@ class RhtmlLexer(DelegatingLexer):
name = 'RHTML'
aliases = ['rhtml', 'html+erb', 'html+ruby']
filenames = ['*.rhtml']
+ version_added = ''
alias_filenames = ['*.html', '*.htm', '*.xhtml']
mimetypes = ['text/html+ruby']
+ url = 'https://github.com/ruby/erb'
+
def __init__(self, **options):
super().__init__(HtmlLexer, ErbLexer, **options)
@@ -1028,8 +1053,10 @@ class XmlErbLexer(DelegatingLexer):
name = 'XML+Ruby'
aliases = ['xml+ruby', 'xml+erb']
+ version_added = ''
alias_filenames = ['*.xml']
mimetypes = ['application/xml+ruby']
+ url = 'https://github.com/ruby/erb'
def __init__(self, **options):
super().__init__(XmlLexer, ErbLexer, **options)
@@ -1048,8 +1075,10 @@ class CssErbLexer(DelegatingLexer):
name = 'CSS+Ruby'
aliases = ['css+ruby', 'css+erb']
+ version_added = ''
alias_filenames = ['*.css']
mimetypes = ['text/css+ruby']
+ url = 'https://github.com/ruby/erb'
def __init__(self, **options):
super().__init__(CssLexer, ErbLexer, **options)
@@ -1066,10 +1095,12 @@ class JavascriptErbLexer(DelegatingLexer):
name = 'JavaScript+Ruby'
aliases = ['javascript+ruby', 'js+ruby', 'javascript+erb', 'js+erb']
+ version_added = ''
alias_filenames = ['*.js']
mimetypes = ['application/x-javascript+ruby',
'text/x-javascript+ruby',
'text/javascript+ruby']
+ url = 'https://github.com/ruby/erb'
def __init__(self, **options):
super().__init__(JavascriptLexer, ErbLexer, **options)
@@ -1088,11 +1119,14 @@ class HtmlPhpLexer(DelegatingLexer):
name = 'HTML+PHP'
aliases = ['html+php']
filenames = ['*.phtml']
+ version_added = ''
alias_filenames = ['*.php', '*.html', '*.htm', '*.xhtml',
'*.php[345]']
mimetypes = ['application/x-php',
'application/x-httpd-php', 'application/x-httpd-php3',
'application/x-httpd-php4', 'application/x-httpd-php5']
+ url = 'https://www.php.net'
+
def __init__(self, **options):
super().__init__(HtmlLexer, PhpLexer, **options)
@@ -1111,8 +1145,10 @@ class XmlPhpLexer(DelegatingLexer):
name = 'XML+PHP'
aliases = ['xml+php']
+ version_added = ''
alias_filenames = ['*.xml', '*.php', '*.php[345]']
mimetypes = ['application/xml+php']
+ url = 'https://www.php.net'
def __init__(self, **options):
super().__init__(XmlLexer, PhpLexer, **options)
@@ -1131,8 +1167,10 @@ class CssPhpLexer(DelegatingLexer):
name = 'CSS+PHP'
aliases = ['css+php']
+ version_added = ''
alias_filenames = ['*.css']
mimetypes = ['text/css+php']
+ url = 'https://www.php.net'
def __init__(self, **options):
super().__init__(CssLexer, PhpLexer, **options)
@@ -1149,10 +1187,12 @@ class JavascriptPhpLexer(DelegatingLexer):
name = 'JavaScript+PHP'
aliases = ['javascript+php', 'js+php']
+ version_added = ''
alias_filenames = ['*.js']
mimetypes = ['application/x-javascript+php',
'text/x-javascript+php',
'text/javascript+php']
+ url = 'https://www.php.net'
def __init__(self, **options):
super().__init__(JavascriptLexer, PhpLexer, **options)
@@ -1171,8 +1211,10 @@ class HtmlSmartyLexer(DelegatingLexer):
name = 'HTML+Smarty'
aliases = ['html+smarty']
+ version_added = ''
alias_filenames = ['*.html', '*.htm', '*.xhtml', '*.tpl']
mimetypes = ['text/html+smarty']
+ url = 'https://www.smarty.net/'
def __init__(self, **options):
super().__init__(HtmlLexer, SmartyLexer, **options)
@@ -1192,8 +1234,10 @@ class XmlSmartyLexer(DelegatingLexer):
name = 'XML+Smarty'
aliases = ['xml+smarty']
+ version_added = ''
alias_filenames = ['*.xml', '*.tpl']
mimetypes = ['application/xml+smarty']
+ url = 'https://www.smarty.net/'
def __init__(self, **options):
super().__init__(XmlLexer, SmartyLexer, **options)
@@ -1213,8 +1257,10 @@ class CssSmartyLexer(DelegatingLexer):
name = 'CSS+Smarty'
aliases = ['css+smarty']
+ version_added = ''
alias_filenames = ['*.css', '*.tpl']
mimetypes = ['text/css+smarty']
+ url = 'https://www.smarty.net/'
def __init__(self, **options):
super().__init__(CssLexer, SmartyLexer, **options)
@@ -1231,10 +1277,12 @@ class JavascriptSmartyLexer(DelegatingLexer):
name = 'JavaScript+Smarty'
aliases = ['javascript+smarty', 'js+smarty']
+ version_added = ''
alias_filenames = ['*.js', '*.tpl']
mimetypes = ['application/x-javascript+smarty',
'text/x-javascript+smarty',
'text/javascript+smarty']
+ url = 'https://www.smarty.net/'
def __init__(self, **options):
super().__init__(JavascriptLexer, SmartyLexer, **options)
@@ -1254,8 +1302,10 @@ class HtmlDjangoLexer(DelegatingLexer):
name = 'HTML+Django/Jinja'
aliases = ['html+django', 'html+jinja', 'htmldjango']
filenames = ['*.html.j2', '*.htm.j2', '*.xhtml.j2', '*.html.jinja2', '*.htm.jinja2', '*.xhtml.jinja2']
+ version_added = ''
alias_filenames = ['*.html', '*.htm', '*.xhtml']
mimetypes = ['text/html+django', 'text/html+jinja']
+ url = 'https://www.djangoproject.com/documentation/templates'
def __init__(self, **options):
super().__init__(HtmlLexer, DjangoLexer, **options)
@@ -1276,8 +1326,10 @@ class XmlDjangoLexer(DelegatingLexer):
name = 'XML+Django/Jinja'
aliases = ['xml+django', 'xml+jinja']
filenames = ['*.xml.j2', '*.xml.jinja2']
+ version_added = ''
alias_filenames = ['*.xml']
mimetypes = ['application/xml+django', 'application/xml+jinja']
+ url = 'https://www.djangoproject.com/documentation/templates'
def __init__(self, **options):
super().__init__(XmlLexer, DjangoLexer, **options)
@@ -1298,8 +1350,10 @@ class CssDjangoLexer(DelegatingLexer):
name = 'CSS+Django/Jinja'
aliases = ['css+django', 'css+jinja']
filenames = ['*.css.j2', '*.css.jinja2']
+ version_added = ''
alias_filenames = ['*.css']
mimetypes = ['text/css+django', 'text/css+jinja']
+ url = 'https://www.djangoproject.com/documentation/templates'
def __init__(self, **options):
super().__init__(CssLexer, DjangoLexer, **options)
@@ -1318,6 +1372,7 @@ class JavascriptDjangoLexer(DelegatingLexer):
aliases = ['javascript+django', 'js+django',
'javascript+jinja', 'js+jinja']
filenames = ['*.js.j2', '*.js.jinja2']
+ version_added = ''
alias_filenames = ['*.js']
mimetypes = ['application/x-javascript+django',
'application/x-javascript+jinja',
@@ -1325,6 +1380,7 @@ class JavascriptDjangoLexer(DelegatingLexer):
'text/x-javascript+jinja',
'text/javascript+django',
'text/javascript+jinja']
+ url = 'https://www.djangoproject.com/documentation/templates'
def __init__(self, **options):
super().__init__(JavascriptLexer, DjangoLexer, **options)
@@ -1361,13 +1417,13 @@ class JspRootLexer(RegexLexer):
class JspLexer(DelegatingLexer):
"""
Lexer for Java Server Pages.
-
- .. versionadded:: 0.7
"""
name = 'Java Server Page'
aliases = ['jsp']
filenames = ['*.jsp']
mimetypes = ['application/x-jsp']
+ url = 'https://projects.eclipse.org/projects/ee4j.jsp'
+ version_added = '0.7'
def __init__(self, **options):
super().__init__(XmlLexer, JspRootLexer, **options)
@@ -1384,13 +1440,13 @@ class JspLexer(DelegatingLexer):
class EvoqueLexer(RegexLexer):
"""
For files using the Evoque templating system.
-
- .. versionadded:: 1.1
"""
name = 'Evoque'
aliases = ['evoque']
filenames = ['*.evoque']
mimetypes = ['application/x-evoque']
+ url = 'https://gizmojo.org/templating'
+ version_added = '1.1'
flags = re.DOTALL
@@ -1442,13 +1498,13 @@ class EvoqueHtmlLexer(DelegatingLexer):
"""
Subclass of the `EvoqueLexer` that highlights unlexed data with the
`HtmlLexer`.
-
- .. versionadded:: 1.1
"""
name = 'HTML+Evoque'
aliases = ['html+evoque']
filenames = ['*.html']
mimetypes = ['text/html+evoque']
+ url = 'https://gizmojo.org/templating'
+ version_added = '1.1'
def __init__(self, **options):
super().__init__(HtmlLexer, EvoqueLexer, **options)
@@ -1461,13 +1517,13 @@ class EvoqueXmlLexer(DelegatingLexer):
"""
Subclass of the `EvoqueLexer` that highlights unlexed data with the
`XmlLexer`.
-
- .. versionadded:: 1.1
"""
name = 'XML+Evoque'
aliases = ['xml+evoque']
filenames = ['*.xml']
mimetypes = ['application/xml+evoque']
+ url = 'https://gizmojo.org/templating'
+ version_added = '1.1'
def __init__(self, **options):
super().__init__(XmlLexer, EvoqueLexer, **options)
@@ -1484,6 +1540,9 @@ class ColdfusionLexer(RegexLexer):
aliases = ['cfs']
filenames = []
mimetypes = []
+ url = 'https://www.adobe.com/products/coldfusion-family.html'
+ version_added = ''
+
flags = re.IGNORECASE
tokens = {
@@ -1532,6 +1591,7 @@ class ColdfusionMarkupLexer(RegexLexer):
aliases = ['cf']
filenames = []
mimetypes = []
+ url = 'https://www.adobe.com/products/coldfusion-family.html'
tokens = {
'root': [
@@ -1578,6 +1638,8 @@ class ColdfusionHtmlLexer(DelegatingLexer):
aliases = ['cfm']
filenames = ['*.cfm', '*.cfml']
mimetypes = ['application/x-coldfusion']
+ url = 'https://www.adobe.com/products/coldfusion-family.html'
+ version_added = ''
def __init__(self, **options):
super().__init__(HtmlLexer, ColdfusionMarkupLexer, **options)
@@ -1586,13 +1648,13 @@ class ColdfusionHtmlLexer(DelegatingLexer):
class ColdfusionCFCLexer(DelegatingLexer):
"""
Coldfusion markup/script components
-
- .. versionadded:: 2.0
"""
name = 'Coldfusion CFC'
aliases = ['cfc']
filenames = ['*.cfc']
mimetypes = []
+ url = 'https://www.adobe.com/products/coldfusion-family.html'
+ version_added = '2.0'
def __init__(self, **options):
super().__init__(ColdfusionHtmlLexer, ColdfusionLexer, **options)
@@ -1601,13 +1663,13 @@ class ColdfusionCFCLexer(DelegatingLexer):
class SspLexer(DelegatingLexer):
"""
Lexer for Scalate Server Pages.
-
- .. versionadded:: 1.4
"""
name = 'Scalate Server Page'
aliases = ['ssp']
filenames = ['*.ssp']
mimetypes = ['application/x-ssp']
+ url = 'https://scalate.github.io/scalate/'
+ version_added = '1.4'
def __init__(self, **options):
super().__init__(XmlLexer, JspRootLexer, **options)
@@ -1647,14 +1709,14 @@ class TeaTemplateRootLexer(RegexLexer):
class TeaTemplateLexer(DelegatingLexer):
"""
- Lexer for `Tea Templates <http://teatrove.org/>`_.
-
- .. versionadded:: 1.5
+ Lexer for Tea Templates.
"""
name = 'Tea'
aliases = ['tea']
filenames = ['*.tea']
mimetypes = ['text/x-tea']
+ url = 'https://github.com/teatrove/teatrove'
+ version_added = '1.5'
def __init__(self, **options):
super().__init__(XmlLexer, TeaTemplateRootLexer, **options)
@@ -1674,17 +1736,17 @@ class LassoHtmlLexer(DelegatingLexer):
`HtmlLexer`.
Nested JavaScript and CSS is also highlighted.
-
- .. versionadded:: 1.6
"""
name = 'HTML+Lasso'
aliases = ['html+lasso']
+ version_added = '1.6'
alias_filenames = ['*.html', '*.htm', '*.xhtml', '*.lasso', '*.lasso[89]',
'*.incl', '*.inc', '*.las']
mimetypes = ['text/html+lasso',
'application/x-httpd-lasso',
'application/x-httpd-lasso[89]']
+ url = 'https://www.lassosoft.com'
def __init__(self, **options):
super().__init__(HtmlLexer, LassoLexer, **options)
@@ -1700,15 +1762,15 @@ class LassoXmlLexer(DelegatingLexer):
"""
Subclass of the `LassoLexer` which highlights unhandled data with the
`XmlLexer`.
-
- .. versionadded:: 1.6
"""
name = 'XML+Lasso'
aliases = ['xml+lasso']
+ version_added = '1.6'
alias_filenames = ['*.xml', '*.lasso', '*.lasso[89]',
'*.incl', '*.inc', '*.las']
mimetypes = ['application/xml+lasso']
+ url = 'https://www.lassosoft.com'
def __init__(self, **options):
super().__init__(XmlLexer, LassoLexer, **options)
@@ -1724,14 +1786,14 @@ class LassoCssLexer(DelegatingLexer):
"""
Subclass of the `LassoLexer` which highlights unhandled data with the
`CssLexer`.
-
- .. versionadded:: 1.6
"""
name = 'CSS+Lasso'
aliases = ['css+lasso']
+ version_added = '1.6'
alias_filenames = ['*.css']
mimetypes = ['text/css+lasso']
+ url = 'https://www.lassosoft.com'
def __init__(self, **options):
options['requiredelimiters'] = True
@@ -1750,16 +1812,16 @@ class LassoJavascriptLexer(DelegatingLexer):
"""
Subclass of the `LassoLexer` which highlights unhandled data with the
`JavascriptLexer`.
-
- .. versionadded:: 1.6
"""
name = 'JavaScript+Lasso'
aliases = ['javascript+lasso', 'js+lasso']
+ version_added = '1.6'
alias_filenames = ['*.js']
mimetypes = ['application/x-javascript+lasso',
'text/x-javascript+lasso',
'text/javascript+lasso']
+ url = 'https://www.lassosoft.com'
def __init__(self, **options):
options['requiredelimiters'] = True
@@ -1776,13 +1838,12 @@ class HandlebarsLexer(RegexLexer):
Highlights only the Handlebars template tags (stuff between `{{` and `}}`).
Everything else is left for a delegating lexer.
-
- .. versionadded:: 2.0
"""
name = "Handlebars"
url = 'https://handlebarsjs.com/'
aliases = ['handlebars']
+ version_added = '2.0'
tokens = {
'root': [
@@ -1851,14 +1912,14 @@ class HandlebarsHtmlLexer(DelegatingLexer):
"""
Subclass of the `HandlebarsLexer` that highlights unlexed data with the
`HtmlLexer`.
-
- .. versionadded:: 2.0
"""
name = "HTML+Handlebars"
aliases = ["html+handlebars"]
filenames = ['*.handlebars', '*.hbs']
mimetypes = ['text/html+handlebars', 'text/x-handlebars-template']
+ url = 'https://handlebarsjs.com/'
+ version_added = '2.0'
def __init__(self, **options):
super().__init__(HtmlLexer, HandlebarsLexer, **options)
@@ -1870,14 +1931,14 @@ class YamlJinjaLexer(DelegatingLexer):
`YamlLexer`.
Commonly used in Saltstack salt states.
-
- .. versionadded:: 2.0
"""
name = 'YAML+Jinja'
aliases = ['yaml+jinja', 'salt', 'sls']
filenames = ['*.sls', '*.yaml.j2', '*.yml.j2', '*.yaml.jinja2', '*.yml.jinja2']
mimetypes = ['text/x-yaml+jinja', 'text/x-sls']
+ url = 'https://jinja.palletsprojects.com'
+ version_added = '2.0'
def __init__(self, **options):
super().__init__(YamlLexer, DjangoLexer, **options)
@@ -1886,13 +1947,12 @@ class YamlJinjaLexer(DelegatingLexer):
class LiquidLexer(RegexLexer):
"""
Lexer for Liquid templates.
-
- .. versionadded:: 2.0
"""
name = 'liquid'
url = 'https://www.rubydoc.info/github/Shopify/liquid'
aliases = ['liquid']
filenames = ['*.liquid']
+ version_added = '2.0'
tokens = {
'root': [
@@ -2095,13 +2155,13 @@ class TwigLexer(RegexLexer):
It just highlights Twig code between the preprocessor directives,
other data is left untouched by the lexer.
-
- .. versionadded:: 2.0
"""
name = 'Twig'
aliases = ['twig']
mimetypes = ['application/x-twig']
+ url = 'https://twig.symfony.com'
+ version_added = '2.0'
flags = re.M | re.S
@@ -2130,7 +2190,7 @@ class TwigLexer(RegexLexer):
Other, Comment.Preproc, Text, Keyword, Text,
Comment.Preproc)),
# filter blocks
- (r'(\{%%)(-?\s*)(filter)(\s+)(%s)' % _ident_inner,
+ (rf'(\{{%)(-?\s*)(filter)(\s+)({_ident_inner})',
bygroups(Comment.Preproc, Text, Keyword, Text, Name.Function),
'tag'),
(r'(\{%)(-?\s*)([a-zA-Z_]\w*)',
@@ -2138,9 +2198,9 @@ class TwigLexer(RegexLexer):
(r'\{', Other),
],
'varnames': [
- (r'(\|)(\s*)(%s)' % _ident_inner,
+ (rf'(\|)(\s*)({_ident_inner})',
bygroups(Operator, Text, Name.Function)),
- (r'(is)(\s+)(not)?(\s*)(%s)' % _ident_inner,
+ (rf'(is)(\s+)(not)?(\s*)({_ident_inner})',
bygroups(Keyword, Text, Keyword, Text, Name.Function)),
(r'(?i)(true|false|none|null)\b', Keyword.Pseudo),
(r'(in|not|and|b-and|or|b-or|b-xor|is'
@@ -2176,14 +2236,14 @@ class TwigHtmlLexer(DelegatingLexer):
"""
Subclass of the `TwigLexer` that highlights unlexed data with the
`HtmlLexer`.
-
- .. versionadded:: 2.0
"""
name = "HTML+Twig"
aliases = ["html+twig"]
filenames = ['*.twig']
mimetypes = ['text/html+twig']
+ url = 'https://twig.symfony.com'
+ version_added = '2.0'
def __init__(self, **options):
super().__init__(HtmlLexer, TwigLexer, **options)
@@ -2196,13 +2256,12 @@ class Angular2Lexer(RegexLexer):
Highlights only the Angular template tags (stuff between `{{` and `}}` and
special attributes: '(event)=', '[property]=', '[(twoWayBinding)]=').
Everything else is left for a delegating lexer.
-
- .. versionadded:: 2.1
"""
name = "Angular2"
url = 'https://angular.io/guide/template-syntax'
aliases = ['ng2']
+ version_added = '2.1'
tokens = {
'root': [
@@ -2256,13 +2315,13 @@ class Angular2HtmlLexer(DelegatingLexer):
"""
Subclass of the `Angular2Lexer` that highlights unlexed data with the
`HtmlLexer`.
-
- .. versionadded:: 2.0
"""
name = "HTML + Angular2"
aliases = ["html+ng2"]
filenames = ['*.ng2']
+ url = 'https://angular.io/guide/template-syntax'
+ version_added = '2.0'
def __init__(self, **options):
super().__init__(HtmlLexer, Angular2Lexer, **options)
@@ -2271,13 +2330,13 @@ class Angular2HtmlLexer(DelegatingLexer):
class SqlJinjaLexer(DelegatingLexer):
"""
Templated SQL lexer.
-
- .. versionadded:: 2.13
"""
name = 'SQL+Jinja'
aliases = ['sql+jinja']
filenames = ['*.sql', '*.sql.j2', '*.sql.jinja2']
+ url = 'https://jinja.palletsprojects.com'
+ version_added = '2.13'
def __init__(self, **options):
super().__init__(SqlLexer, DjangoLexer, **options)