]> luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/django.js
Initial commit.
[flow-web.git] / static / highlight / es / languages / django.js
1 /*! `django` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar = (function () {
3 'use strict';
4
5 /*
6 Language: Django
7 Description: Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
8 Requires: xml.js
9 Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
10 Contributors: Ilya Baryshev <baryshev@gmail.com>
11 Website: https://www.djangoproject.com
12 Category: template
13 */
14
15 /** @type LanguageFn */
16 function django(hljs) {
17 const FILTER = {
18 begin: /\|[A-Za-z]+:?/,
19 keywords: { name:
20 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags '
21 + 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands '
22 + 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode '
23 + 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort '
24 + 'dictsortreversed default_if_none pluralize lower join center default '
25 + 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first '
26 + 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize '
27 + 'localtime utc timezone' },
28 contains: [
29 hljs.QUOTE_STRING_MODE,
30 hljs.APOS_STRING_MODE
31 ]
32 };
33
34 return {
35 name: 'Django',
36 aliases: [ 'jinja' ],
37 case_insensitive: true,
38 subLanguage: 'xml',
39 contains: [
40 hljs.COMMENT(/\{%\s*comment\s*%\}/, /\{%\s*endcomment\s*%\}/),
41 hljs.COMMENT(/\{#/, /#\}/),
42 {
43 className: 'template-tag',
44 begin: /\{%/,
45 end: /%\}/,
46 contains: [
47 {
48 className: 'name',
49 begin: /\w+/,
50 keywords: { name:
51 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for '
52 + 'endfor ifnotequal endifnotequal widthratio extends include spaceless '
53 + 'endspaceless regroup ifequal endifequal ssi now with cycle url filter '
54 + 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif '
55 + 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix '
56 + 'plural get_current_language language get_available_languages '
57 + 'get_current_language_bidi get_language_info get_language_info_list localize '
58 + 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone '
59 + 'verbatim' },
60 starts: {
61 endsWithParent: true,
62 keywords: 'in by as',
63 contains: [ FILTER ],
64 relevance: 0
65 }
66 }
67 ]
68 },
69 {
70 className: 'template-variable',
71 begin: /\{\{/,
72 end: /\}\}/,
73 contains: [ FILTER ]
74 }
75 ]
76 };
77 }
78
79 return django;
80
81 })();
82 ;
83 export default hljsGrammar;