0
This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
highlight_js-rails/vendor/assets/javascripts/highlight_js/languages/django.js
Rogaboru Kujimoshi a52831ccdb Update to 8.0
2014-06-08 21:04:39 +04:00

63 lines
2.3 KiB
JavaScript

/*
Language: Django
Requires: xml.js
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Ilya Baryshev <baryshev@gmail.com>
*/
function(hljs) {
var FILTER = {
className: 'filter',
begin: /\|[A-Za-z]+\:?/,
keywords:
'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +
'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +
'dictsortreversed default_if_none pluralize lower join center default ' +
'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +
'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
'localtime utc timezone',
contains: [
{className: 'argument', begin: /"/, end: /"/},
{className: 'argument', begin: /'/, end: /'/}
]
};
return {
aliases: ['jinja'],
case_insensitive: true,
subLanguage: 'xml', subLanguageMode: 'continuous',
contains: [
{
className: 'template_comment',
begin: /\{%\s*comment\s*%}/, end: /\{%\s*endcomment\s*%}/
},
{
className: 'template_comment',
begin: /\{#/, end: /#}/
},
{
className: 'template_tag',
begin: /\{%/, end: /%}/,
keywords:
'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
'endfor in ifnotequal endifnotequal widthratio extends include spaceless ' +
'endspaceless regroup by as ifequal endifequal ssi now with cycle url filter ' +
'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
'plural get_current_language language get_available_languages ' +
'get_current_language_bidi get_language_info get_language_info_list localize ' +
'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +
'verbatim',
contains: [FILTER]
},
{
className: 'variable',
begin: /\{\{/, end: /}}/,
contains: [FILTER]
}
]
};
}