textpow 0.10.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +30 -0
- data/{History.txt → History.rdoc} +10 -0
- data/{README.txt → MIT-LICENSE.txt} +0 -30
- data/README.rdoc +82 -0
- data/Rakefile +42 -49
- data/bin/plist2syntax +0 -0
- data/bin/plist2yaml +0 -0
- data/examples/benchmark_js.rb +13 -0
- data/examples/jquery.js +9046 -0
- data/lib/textpow.rb +43 -3
- data/lib/textpow/debug_processor.rb +35 -35
- data/lib/textpow/recording_processor.rb +13 -0
- data/lib/textpow/score_manager.rb +60 -60
- data/lib/textpow/syntax.rb +303 -262
- data/lib/textpow/syntax/broken/markdown.syntax +519 -0
- data/lib/textpow/syntax/broken/php.syntax +1253 -0
- data/lib/textpow/syntax/buggy/nemerle.syntax +74 -0
- data/lib/textpow/syntax/old/YAML.yaml +160 -0
- data/lib/textpow/syntax/old/txt2tags.yaml +139 -0
- data/lib/textpow/syntax/source.actionscript.syntax +97 -0
- data/lib/textpow/syntax/source.active4d.library.syntax +21 -0
- data/lib/textpow/syntax/source.active4d.syntax +276 -0
- data/lib/textpow/syntax/source.ada.syntax +33 -0
- data/lib/textpow/syntax/source.antlr.syntax +151 -0
- data/lib/textpow/syntax/source.apache-config.mod_perl.syntax +50 -0
- data/lib/textpow/syntax/source.apache-config.syntax +191 -0
- data/lib/textpow/syntax/source.applescript.syntax +384 -0
- data/lib/textpow/syntax/source.asp.syntax +70 -0
- data/lib/textpow/syntax/source.asp.vb.net.syntax +129 -0
- data/lib/textpow/syntax/source.c++.qt.syntax +26 -0
- data/lib/textpow/syntax/source.c++.syntax +186 -0
- data/lib/textpow/syntax/source.c-sharp.syntax +59 -0
- data/lib/textpow/syntax/source.c.ragel.syntax +201 -0
- data/lib/textpow/syntax/source.c.syntax +414 -0
- data/lib/textpow/syntax/source.camlp4.ocaml.syntax +36 -0
- data/lib/textpow/syntax/source.cm.syntax +32 -0
- data/lib/textpow/syntax/source.coffee.syntax +216 -0
- data/lib/textpow/syntax/source.context-free.syntax +176 -0
- data/lib/textpow/syntax/source.css.beta.syntax +1925 -0
- data/lib/textpow/syntax/source.css.syntax +195 -0
- data/lib/textpow/syntax/source.d.syntax +142 -0
- data/lib/textpow/syntax/source.diff.syntax +81 -0
- data/lib/textpow/syntax/source.dot.syntax +47 -0
- data/lib/textpow/syntax/source.dylan.syntax +62 -0
- data/lib/textpow/syntax/source.eiffel.syntax +78 -0
- data/lib/textpow/syntax/source.erlang.syntax +922 -0
- data/lib/textpow/syntax/source.fortran.syntax +141 -0
- data/lib/textpow/syntax/source.fscript.syntax +80 -0
- data/lib/textpow/syntax/source.fxscript.syntax +142 -0
- data/lib/textpow/syntax/source.gri.syntax +83 -0
- data/lib/textpow/syntax/source.groovy.groovy.syntax +191 -0
- data/lib/textpow/syntax/source.haskell.syntax +88 -0
- data/lib/textpow/syntax/source.icalendar.syntax +32 -0
- data/lib/textpow/syntax/source.inform.syntax +48 -0
- data/lib/textpow/syntax/source.ini.syntax +55 -0
- data/lib/textpow/syntax/source.io.syntax +81 -0
- data/lib/textpow/syntax/source.java-props.syntax +20 -0
- data/lib/textpow/syntax/source.java.syntax +211 -0
- data/lib/textpow/syntax/source.js.greasemonkey.syntax +34 -0
- data/lib/textpow/syntax/source.js.jquery.syntax +114 -0
- data/lib/textpow/syntax/source.js.mootools.syntax +572 -0
- data/lib/textpow/syntax/source.js.prototype.bracketed.syntax +140 -0
- data/lib/textpow/syntax/source.js.prototype.syntax +72 -0
- data/lib/textpow/syntax/source.js.syntax +256 -0
- data/lib/textpow/syntax/source.js.yui.syntax +176 -0
- data/lib/textpow/syntax/source.json.syntax +136 -0
- data/lib/textpow/syntax/source.lex.syntax +219 -0
- data/lib/textpow/syntax/source.lighttpd-config.syntax +54 -0
- data/lib/textpow/syntax/source.lilypond.syntax +492 -0
- data/lib/textpow/syntax/source.lisp.syntax +61 -0
- data/lib/textpow/syntax/source.logo.syntax +29 -0
- data/lib/textpow/syntax/source.logtalk.syntax +152 -0
- data/lib/textpow/syntax/source.lua.syntax +86 -0
- data/lib/textpow/syntax/source.makefile.syntax +36 -0
- data/lib/textpow/syntax/source.matlab.syntax +142 -0
- data/lib/textpow/syntax/source.mel.syntax +92 -0
- data/lib/textpow/syntax/source.mips.syntax +66 -0
- data/lib/textpow/syntax/source.ml.syntax +121 -0
- data/lib/textpow/syntax/source.modula-3.syntax +47 -0
- data/lib/textpow/syntax/source.nant-build.syntax +53 -0
- data/lib/textpow/syntax/source.objc++.syntax +18 -0
- data/lib/textpow/syntax/source.objc.syntax +233 -0
- data/lib/textpow/syntax/source.ocaml.syntax +764 -0
- data/lib/textpow/syntax/source.ocamllex.syntax +167 -0
- data/lib/textpow/syntax/source.ocamlyacc.syntax +184 -0
- data/lib/textpow/syntax/source.open-gl.syntax +14 -0
- data/lib/textpow/syntax/source.pascal.syntax +77 -0
- data/lib/textpow/syntax/source.pascal.vectorscript.syntax +57 -0
- data/lib/textpow/syntax/source.perl.syntax +1113 -0
- data/lib/textpow/syntax/source.php.cake.syntax +55 -0
- data/lib/textpow/syntax/source.plist.tm-grammar.syntax +708 -0
- data/lib/textpow/syntax/source.postscript.syntax +114 -0
- data/lib/textpow/syntax/source.processing.syntax +106 -0
- data/lib/textpow/syntax/source.prolog.syntax +40 -0
- data/lib/textpow/syntax/source.python.django.syntax +21 -0
- data/lib/textpow/syntax/source.python.syntax +868 -0
- data/lib/textpow/syntax/source.qmake.syntax +114 -0
- data/lib/textpow/syntax/source.quake-config.syntax +32 -0
- data/lib/textpow/syntax/source.r-console.syntax +16 -0
- data/lib/textpow/syntax/source.r.syntax +81 -0
- data/lib/textpow/syntax/source.regexp.oniguruma.syntax +107 -0
- data/lib/textpow/syntax/source.regexp.python.syntax +109 -0
- data/lib/textpow/syntax/source.regexp.syntax +50 -0
- data/lib/textpow/syntax/source.remind.syntax +253 -0
- data/lib/textpow/syntax/source.rez.syntax +80 -0
- data/lib/textpow/syntax/source.ruby.experimental.syntax +145 -0
- data/lib/textpow/syntax/source.ruby.rails.syntax +88 -0
- data/lib/textpow/syntax/source.ruby.syntax +1035 -0
- data/lib/textpow/syntax/source.s5.syntax +69 -0
- data/lib/textpow/syntax/source.sass.syntax +45 -0
- data/lib/textpow/syntax/source.scheme.syntax +347 -0
- data/lib/textpow/syntax/source.scilab.syntax +41 -0
- data/lib/textpow/syntax/source.scss.syntax +527 -0
- data/lib/textpow/syntax/source.shell.syntax +384 -0
- data/lib/textpow/syntax/source.slate.syntax +149 -0
- data/lib/textpow/syntax/source.smarty.syntax +63 -0
- data/lib/textpow/syntax/source.sql.ruby.syntax +18 -0
- data/lib/textpow/syntax/source.sql.syntax +237 -0
- data/lib/textpow/syntax/source.ssh-config.syntax +33 -0
- data/lib/textpow/syntax/source.strings.syntax +39 -0
- data/lib/textpow/syntax/source.swig.syntax +57 -0
- data/lib/textpow/syntax/source.tcl.macports.syntax +163 -0
- data/lib/textpow/syntax/source.tcl.syntax +152 -0
- data/lib/textpow/syntax/source.yaml.syntax +160 -0
- data/lib/textpow/syntax/text.active4d-ini.syntax +50 -0
- data/lib/textpow/syntax/text.bbcode.syntax +287 -0
- data/lib/textpow/syntax/text.bibtex.syntax +151 -0
- data/lib/textpow/syntax/text.blog.html.syntax +41 -0
- data/lib/textpow/syntax/text.blog.markdown.syntax +42 -0
- data/lib/textpow/syntax/text.blog.syntax +27 -0
- data/lib/textpow/syntax/text.blog.textile.syntax +27 -0
- data/lib/textpow/syntax/text.gtdalt.syntax +143 -0
- data/lib/textpow/syntax/text.haml.syntax +88 -0
- data/lib/textpow/syntax/text.html.asp.net.syntax +424 -0
- data/lib/textpow/syntax/text.html.asp.syntax +27 -0
- data/lib/textpow/syntax/text.html.basic.syntax +362 -0
- data/lib/textpow/syntax/text.html.cfm.syntax +119 -0
- data/lib/textpow/syntax/text.html.django.syntax +36 -0
- data/lib/textpow/syntax/text.html.dokuwiki.syntax +204 -0
- data/lib/textpow/syntax/text.html.doxygen.syntax +43 -0
- data/lib/textpow/syntax/text.html.markdown.multimarkdown.syntax +39 -0
- data/lib/textpow/syntax/text.html.mason.syntax +119 -0
- data/lib/textpow/syntax/text.html.mediawiki.syntax +567 -0
- data/lib/textpow/syntax/text.html.mt.syntax +162 -0
- data/lib/textpow/syntax/text.html.ruby.syntax +40 -0
- data/lib/textpow/syntax/text.html.strict.active4d.syntax +311 -0
- data/lib/textpow/syntax/text.html.tcl.syntax +26 -0
- data/lib/textpow/syntax/text.html.textile.syntax +215 -0
- data/lib/textpow/syntax/text.html.tt.syntax +121 -0
- data/lib/textpow/syntax/text.html.twiki.syntax +241 -0
- data/lib/textpow/syntax/text.html.xhtml.1-strict.syntax +4027 -0
- data/lib/textpow/syntax/text.log.latex.syntax +50 -0
- data/lib/textpow/syntax/text.mail.markdown.syntax +118 -0
- data/lib/textpow/syntax/text.man.syntax +17 -0
- data/lib/textpow/syntax/text.moinmoin.syntax +189 -0
- data/lib/textpow/syntax/text.plain.gtd.syntax +22 -0
- data/lib/textpow/syntax/text.plain.release-notes.syntax +46 -0
- data/lib/textpow/syntax/text.plain.syntax +32 -0
- data/lib/textpow/syntax/text.plist.syntax +635 -0
- data/lib/textpow/syntax/text.pmwiki.syntax +113 -0
- data/lib/textpow/syntax/text.restructuredtext.syntax +250 -0
- data/lib/textpow/syntax/text.setext.syntax +147 -0
- data/lib/textpow/syntax/text.subversion-commit.syntax +36 -0
- data/lib/textpow/syntax/text.tabular.csv.syntax +68 -0
- data/lib/textpow/syntax/text.tabular.tsv.syntax +50 -0
- data/lib/textpow/syntax/text.tex.latex.beamer.syntax +41 -0
- data/lib/textpow/syntax/text.tex.latex.haskell.syntax +24 -0
- data/lib/textpow/syntax/text.tex.latex.memoir.syntax +64 -0
- data/lib/textpow/syntax/text.tex.latex.rd.syntax +91 -0
- data/lib/textpow/syntax/text.tex.latex.sweave.syntax +84 -0
- data/lib/textpow/syntax/text.tex.latex.syntax +566 -0
- data/lib/textpow/syntax/text.tex.math.syntax +49 -0
- data/lib/textpow/syntax/text.tex.syntax +86 -0
- data/lib/textpow/syntax/text.txt2tags.syntax +79 -0
- data/lib/textpow/syntax/text.xml.apple-dist.syntax +77 -0
- data/lib/textpow/syntax/text.xml.strict.syntax +92 -0
- data/lib/textpow/syntax/text.xml.syntax +180 -0
- data/lib/textpow/syntax/text.xml.xsl.syntax +60 -0
- data/lib/textpow/version.rb +3 -0
- data/spec/fixtures/objeck.plist +107 -0
- data/spec/fixtures/utf8.txt +1 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/textpow/score_manager_spec.rb +20 -0
- data/spec/textpow/syntax_files_spec.rb +26 -0
- data/spec/textpow/syntax_spec.rb +225 -0
- data/spec/textpow_spec.rb +57 -0
- data/textpow.gemspec +19 -0
- metadata +246 -68
- data/Manifest.txt +0 -13
- data/mm/manual.mm +0 -266
- data/test/test_textpow.rb +0 -25
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
name: HTML (Django)
|
3
|
+
fileTypes: []
|
4
|
+
|
5
|
+
scopeName: text.html.django
|
6
|
+
uuid: F4B0A70C-ECF6-4660-BC26-785216E3CF02
|
7
|
+
foldingStartMarker: (<(?i:(head|table|tr|div|style|script|ul|ol|form|dl))\b.*?>|{% (block|comment|filter|for|if|ifchanged|ifequal|ifnotequal))
|
8
|
+
patterns:
|
9
|
+
- include: text.html.basic
|
10
|
+
comment: Since html is valid in Django templates include the html patterns
|
11
|
+
- name: comment.block.django.template
|
12
|
+
begin: "{% comment %}"
|
13
|
+
end: "{% endcomment %}"
|
14
|
+
- name: variable.other.django.template
|
15
|
+
begin: "{{"
|
16
|
+
end: "}}"
|
17
|
+
- name: meta.scope.django.template.tag
|
18
|
+
captures:
|
19
|
+
"1":
|
20
|
+
name: entity.other.django.tagbraces
|
21
|
+
begin: ({%)
|
22
|
+
end: (%})
|
23
|
+
patterns:
|
24
|
+
- name: keyword.control.django.template
|
25
|
+
match: \b(block|endblock|blocktrans|endblocktrans|plural|debug|extends|filter|firstof|for|endfor|if|include|else|endif|ifchanged|endifchanged|ifequal|endifequal|ifnotequal|endifnotequal|load|now|regroup|ssi|spaceless|templatetag|widthratio)\b
|
26
|
+
- name: keyword.operator.django.template
|
27
|
+
match: \b(and|or|not|in|by|as)\b
|
28
|
+
- name: support.function.filter.django
|
29
|
+
match: \|(add|addslashes|capfirst|center|cut|date|default|default_if_none|dictsort|dictsortreversed|divisibleby|escape|filesizeformat|first|fix_ampersands|floatformat|get_digit|join|length|length_is|linebreaks|linebreaksbr|linenumbers|ljust|lower|make_list|phone2numeric|pluralize|pprint|random|removetags|rjust|slice|slugify|stringformat|striptags|time|timesince|title|truncatewords|unordered_list|upper|urlencode|urlize|urlizetrunc|wordcount|wordwrap|yesno)\b
|
30
|
+
- name: string.other.django.template.tag
|
31
|
+
begin: "'|\""
|
32
|
+
end: "'|\""
|
33
|
+
- name: string.unquoted.django.template.tag
|
34
|
+
match: "[a-zA-Z_]+"
|
35
|
+
foldingStopMarker: (</(?i:(head|table|tr|div|style|script|ul|ol|form|dl))>|{% (endblock|endblocktrans|endcomment|endfilter|endfor|endif|endifchanged|endifequal|endifnotequal) %})
|
36
|
+
keyEquivalent: ^~D
|
@@ -0,0 +1,204 @@
|
|
1
|
+
---
|
2
|
+
name: DokuWiki
|
3
|
+
fileTypes: []
|
4
|
+
|
5
|
+
firstLineMatch: ^\s*={2,}(.*)={2,}\s*$
|
6
|
+
scopeName: text.html.dokuwiki
|
7
|
+
repository:
|
8
|
+
php:
|
9
|
+
patterns:
|
10
|
+
- name: source.php.embedded.dokuwiki
|
11
|
+
begin: (?:^\s*)(?=<\?(?i:php|=)?(?!.*\?>))
|
12
|
+
applyEndPatternLast: 1
|
13
|
+
end: (?<=\?>)(?:\s*$\n)?
|
14
|
+
patterns:
|
15
|
+
- include: source.php
|
16
|
+
comment: match only multi-line PHP with leading whitespace
|
17
|
+
- name: source.php.embedded.dokuwiki
|
18
|
+
begin: (?=<\?(?i:php|=)?)
|
19
|
+
applyEndPatternLast: 1
|
20
|
+
end: (?<=\?>)
|
21
|
+
patterns:
|
22
|
+
- include: source.php
|
23
|
+
- name: source.php.embedded.dokuwiki
|
24
|
+
captures:
|
25
|
+
"1":
|
26
|
+
name: punctuation.definition.tag.dokuwiki
|
27
|
+
"2":
|
28
|
+
name: punctuation.definition.tag.dokuwiki
|
29
|
+
begin: (<)php(>)
|
30
|
+
applyEndPatternLast: 1
|
31
|
+
end: (</)php(>)
|
32
|
+
patterns:
|
33
|
+
- include: source.php
|
34
|
+
inline:
|
35
|
+
patterns:
|
36
|
+
- name: markup.bold.dokuwiki
|
37
|
+
captures:
|
38
|
+
"0":
|
39
|
+
name: punctuation.definition.bold.dokuwiki
|
40
|
+
begin: \*\*
|
41
|
+
end: \*\*
|
42
|
+
patterns:
|
43
|
+
- include: "#inline"
|
44
|
+
- name: markup.italic.dokuwiki
|
45
|
+
captures:
|
46
|
+
"0":
|
47
|
+
name: punctuation.definition.italic.dokuwiki
|
48
|
+
begin: //
|
49
|
+
end: //
|
50
|
+
patterns:
|
51
|
+
- include: "#inline"
|
52
|
+
- name: markup.underline.dokuwiki
|
53
|
+
captures:
|
54
|
+
"0":
|
55
|
+
name: punctuation.definition.underline.dokuwiki
|
56
|
+
begin: __
|
57
|
+
end: __
|
58
|
+
patterns:
|
59
|
+
- include: "#inline"
|
60
|
+
- name: meta.image.inline.dokuwiki
|
61
|
+
captures:
|
62
|
+
"1":
|
63
|
+
name: punctuation.definition.image.dokuwiki
|
64
|
+
"2":
|
65
|
+
name: markup.underline.link.dokuwiki
|
66
|
+
"3":
|
67
|
+
name: punctuation.definition.image.dokuwiki
|
68
|
+
match: (\{\{)(.+?)(\}\})
|
69
|
+
- name: meta.link.dokuwiki
|
70
|
+
captures:
|
71
|
+
"1":
|
72
|
+
name: punctuation.definition.link.dokuwiki
|
73
|
+
"2":
|
74
|
+
name: markup.underline.link.dokuwiki
|
75
|
+
"3":
|
76
|
+
name: punctuation.definition.link.dokuwiki
|
77
|
+
match: (\[\[)(.*?)(\]\])
|
78
|
+
- captures:
|
79
|
+
"1":
|
80
|
+
name: punctuation.definition.link.dokuwiki
|
81
|
+
"2":
|
82
|
+
name: markup.underline.link.interwiki.dokuwiki
|
83
|
+
"3":
|
84
|
+
name: punctuation.definition.link.dokuwiki
|
85
|
+
match: (\[\[)([^\[\]]+\>[^|\]]+)(\]\])
|
86
|
+
- captures:
|
87
|
+
"1":
|
88
|
+
name: markup.underline.link.dokuwiki
|
89
|
+
match: ((https?|telnet|gopher|wais|ftp|ed2k|irc)://[\w/\#~:.?+=&%@!\-;,]+?(?=[.:?\-;,]*[^\w/\#~:.?+=&%@!\-;,]))
|
90
|
+
- name: meta.link.email.dokuwiki
|
91
|
+
captures:
|
92
|
+
"1":
|
93
|
+
name: punctuation.definition.link.dokuwiki
|
94
|
+
"2":
|
95
|
+
name: markup.underline.link.dokuwiki
|
96
|
+
"3":
|
97
|
+
name: punctuation.definition.link.dokuwiki
|
98
|
+
match: (<)([\w0-9\-_.]+?@[\w\-]+\.[\w\-\.]+\.*[\w]+)(\>)
|
99
|
+
uuid: 862D8B02-501E-4205-9DA4-FB7CDA7AE3DA
|
100
|
+
foldingStartMarker: (<(php|html|file|nowiki)>|<code(\s*.*)?>)|/\*\*|\{\s*$
|
101
|
+
patterns:
|
102
|
+
- include: "#php"
|
103
|
+
- include: "#inline"
|
104
|
+
- name: string.quoted.double.dokuwiki
|
105
|
+
endCaptures:
|
106
|
+
"0":
|
107
|
+
name: punctuation.definition.string.end.dokuwiki
|
108
|
+
begin: "\""
|
109
|
+
beginCaptures:
|
110
|
+
"0":
|
111
|
+
name: punctuation.definition.string.begin.dokuwiki
|
112
|
+
end: "\""
|
113
|
+
patterns:
|
114
|
+
- name: constant.character.escape.dokuwiki
|
115
|
+
match: \\.
|
116
|
+
- name: comment.block.documentation.dokuwiki
|
117
|
+
captures:
|
118
|
+
"0":
|
119
|
+
name: punctuation.definition.comment.dokuwiki
|
120
|
+
begin: \(\(
|
121
|
+
end: \)\)
|
122
|
+
- name: markup.heading.dokuwiki
|
123
|
+
captures:
|
124
|
+
"1":
|
125
|
+
name: punctuation.definition.heading.dokuwiki
|
126
|
+
"3":
|
127
|
+
name: punctuation.definition.heading.dokuwiki
|
128
|
+
match: ^\s*(={2,})(.*)(={2,})\s*$\n?
|
129
|
+
- name: keyword.other.notoc.dokuwiki
|
130
|
+
match: ~~NOTOC~~
|
131
|
+
- name: keyword.other.nocache.dokuwiki
|
132
|
+
match: ~~NOCACHE~~
|
133
|
+
- name: meta.separator.dokuwiki
|
134
|
+
match: ^\s*-{4,}\s*$
|
135
|
+
- name: markup.other.paragraph.dokuwiki
|
136
|
+
match: \\\\\s
|
137
|
+
- name: markup.list.unnumbered.dokuwiki
|
138
|
+
captures:
|
139
|
+
"4":
|
140
|
+
name: punctuation.definition.list_item.dokuwiki
|
141
|
+
begin: ^((\t+)|( {2,}))(\*)
|
142
|
+
end: $\n?
|
143
|
+
patterns:
|
144
|
+
- include: "#inline"
|
145
|
+
- name: markup.list.numbered.dokuwiki
|
146
|
+
captures:
|
147
|
+
"4":
|
148
|
+
name: punctuation.definition.list_item.dokuwiki
|
149
|
+
begin: ^((\t+)|( {2,}))(-)
|
150
|
+
end: $\n?
|
151
|
+
patterns:
|
152
|
+
- include: "#inline"
|
153
|
+
- name: markup.other.table.dokuwiki
|
154
|
+
begin: ^[|^]
|
155
|
+
beginCaptures:
|
156
|
+
"0":
|
157
|
+
name: punctuation.definition.table.dokuwiki
|
158
|
+
end: $
|
159
|
+
patterns:
|
160
|
+
- include: "#inline"
|
161
|
+
- name: markup.raw.dokuwiki
|
162
|
+
captures:
|
163
|
+
"1":
|
164
|
+
name: punctuation.definition.tag.dokuwiki
|
165
|
+
"3":
|
166
|
+
name: punctuation.definition.tag.dokuwiki
|
167
|
+
begin: (\<)(file|nowiki)(\>)
|
168
|
+
end: (<\/)(\2)(\>)
|
169
|
+
- name: markup.raw.dokuwiki
|
170
|
+
captures:
|
171
|
+
"0":
|
172
|
+
name: punctuation.definition.raw.dokuwiki
|
173
|
+
begin: (%%|\'\')
|
174
|
+
end: \1
|
175
|
+
- captures:
|
176
|
+
"1":
|
177
|
+
name: punctuation.definition.tag.dokuwiki
|
178
|
+
"2":
|
179
|
+
name: punctuation.definition.tag.dokuwiki
|
180
|
+
begin: (<)html(>)
|
181
|
+
end: (</)html(>)
|
182
|
+
patterns:
|
183
|
+
- include: text.html.basic
|
184
|
+
- name: markup.raw.dokuwiki
|
185
|
+
match: ^((\s\s)|(\t))[^\*\-].*$
|
186
|
+
- name: markup.other.dokuwiki
|
187
|
+
captures:
|
188
|
+
"1":
|
189
|
+
name: punctuation.definition.tag.dokuwiki
|
190
|
+
"3":
|
191
|
+
name: punctuation.definition.tag.dokuwiki
|
192
|
+
begin: (\<)(sub|sup|del)(\>)
|
193
|
+
end: (\</)(\2)(\>)
|
194
|
+
patterns:
|
195
|
+
- include: "#inline"
|
196
|
+
- name: markup.raw.dokuwiki
|
197
|
+
captures:
|
198
|
+
"1":
|
199
|
+
name: punctuation.definition.tag.dokuwiki
|
200
|
+
"2":
|
201
|
+
name: punctuation.definition.tag.dokuwiki
|
202
|
+
begin: (<)code(?:\s+[^>]*)?(>)
|
203
|
+
end: (</)code(>)
|
204
|
+
foldingStopMarker: (</(code|php|html|file|nowiki)>)|\*\*/|^\s*\}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
---
|
2
|
+
name: Doxygen
|
3
|
+
fileTypes:
|
4
|
+
- doxygen
|
5
|
+
scopeName: text.html.doxygen
|
6
|
+
repository:
|
7
|
+
source_doxygen:
|
8
|
+
patterns:
|
9
|
+
- include: "#keywords"
|
10
|
+
- include: text.html.basic
|
11
|
+
keywords:
|
12
|
+
patterns:
|
13
|
+
- name: keyword.control.doxygen
|
14
|
+
captures:
|
15
|
+
"1":
|
16
|
+
name: punctuation.definition.keyword.doxygen
|
17
|
+
match: ([\\@])((a|addindex|addtogroup|anchor|arg|attention|author|b|brief|bug|c|callgraph|callergraph|category|class|code|cond|copydoc|date|def|defgroup|deprecated|dir|dontinclude|dot|dotfile|e|else|elseif|em|endcode|endcond|enddot|endhtmlonly|endif|endlatexonly|endlink|endmanonly|endverbatim|endxmlonly|enum|example|exception|file|fn|hideinitializer|htmlinclude|htmlonly|if|ifnot|image|include|includelineno|ingroup|internal|invariant|interface|latexonly|li|line|link|mainpage|manonly|n|name|namespace|nosubgrouping|note|overload|p|package|page|par|paragraph|param|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|ref|relates|relatesalso|remarks|return|retval|sa|section|see|showinitializer|since|skip|skipline|struct|subpage|subsection|subsubsection|test|throw|todo|typedef|union|until|var|verbatim|verbinclude|version|warning|weakgroup|xmlonly|xrefitem)\b|(\$|\@|\\|\&|\~|\<|\>|\#|\%|f\$|f\[|f\]))
|
18
|
+
uuid: 9725E602-6D7C-4E98-911A-C66802142451
|
19
|
+
patterns:
|
20
|
+
- name: comment.block.doxygen
|
21
|
+
captures:
|
22
|
+
"0":
|
23
|
+
name: punctuation.definition.comment.doxygen
|
24
|
+
begin: \/\*\*\<?
|
25
|
+
end: \*\/
|
26
|
+
patterns:
|
27
|
+
- include: "#source_doxygen"
|
28
|
+
- name: comment.block.doxygen
|
29
|
+
captures:
|
30
|
+
"0":
|
31
|
+
name: punctuation.definition.comment.doxygen
|
32
|
+
begin: \/\*!\<?
|
33
|
+
end: \*\/
|
34
|
+
patterns:
|
35
|
+
- include: "#source_doxygen"
|
36
|
+
- name: comment.line.doxygen
|
37
|
+
begin: \/\/[\/!]\<?
|
38
|
+
beginCaptures:
|
39
|
+
"0":
|
40
|
+
name: punctuation.definition.comment.doxygen
|
41
|
+
end: $\n?
|
42
|
+
patterns:
|
43
|
+
- include: "#source_doxygen"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
name: MultiMarkdown
|
3
|
+
firstLineMatch: ^Format:\s*(?i:complete)\s*$
|
4
|
+
scopeName: text.html.markdown.multimarkdown
|
5
|
+
uuid: F5E04BF4-69A9-45AE-9205-B3F3C2B00130
|
6
|
+
foldingStartMarker: |-
|
7
|
+
(?x)
|
8
|
+
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
|
9
|
+
|<!--(?!.*-->)
|
10
|
+
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
|
11
|
+
)
|
12
|
+
patterns:
|
13
|
+
- name: meta.header.multimarkdown
|
14
|
+
begin: ^([A-Za-z0-9]+)(:)\s*
|
15
|
+
beginCaptures:
|
16
|
+
"1":
|
17
|
+
name: keyword.other.multimarkdown
|
18
|
+
"2":
|
19
|
+
name: punctuation.separator.key-value.multimarkdown
|
20
|
+
end: ^$|^(?=[A-Za-z0-9]+:)
|
21
|
+
patterns:
|
22
|
+
- name: string.unquoted.multimarkdown
|
23
|
+
match: .+
|
24
|
+
comment: |-
|
25
|
+
The reason for not setting scopeName = "string.unquoted"
|
26
|
+
(for the parent rule) is that we do not want
|
27
|
+
newlines to be marked as string.unquoted
|
28
|
+
- name: meta.content.multimarkdown
|
29
|
+
begin: ^(?!=[A-Za-z0-9]+:)
|
30
|
+
end: ^(?=not)possible$
|
31
|
+
patterns:
|
32
|
+
- include: text.html.markdown
|
33
|
+
foldingStopMarker: |-
|
34
|
+
(?x)
|
35
|
+
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
|
36
|
+
|^\s*-->
|
37
|
+
|(^|\s)\}
|
38
|
+
)
|
39
|
+
keyEquivalent: ^~M
|
@@ -0,0 +1,119 @@
|
|
1
|
+
---
|
2
|
+
name: HTML (Mason)
|
3
|
+
fileTypes:
|
4
|
+
- mhtml
|
5
|
+
- autohandler
|
6
|
+
- dhandler
|
7
|
+
scopeName: text.html.mason
|
8
|
+
uuid: 34979B9C-CDDC-483E-93B5-B65C6B15E6B0
|
9
|
+
foldingStartMarker: (<(?i:(head|table|div|style|script|ul|ol|form|dl))\b.*?>|\{)
|
10
|
+
patterns:
|
11
|
+
- name: source.perl.mason.block
|
12
|
+
captures:
|
13
|
+
"1":
|
14
|
+
name: punctuation.section.embedded.perl.mason
|
15
|
+
"2":
|
16
|
+
name: keyword.control
|
17
|
+
begin: (<%(perl|global|once|init|cleanup|requestlocal|requestonce|shared|threadlocal|threadonce|flags)( scope.*?)?>)
|
18
|
+
end: (</%(\2)>)(\s*$\n)?
|
19
|
+
patterns:
|
20
|
+
- include: source.perl
|
21
|
+
- name: source.perl.mason.doc
|
22
|
+
captures:
|
23
|
+
"1":
|
24
|
+
name: keyword.control
|
25
|
+
"2":
|
26
|
+
name: variable.other
|
27
|
+
begin: (<(%text)>)
|
28
|
+
end: (</(%text)>)
|
29
|
+
patterns:
|
30
|
+
- name: comment.block
|
31
|
+
begin: (?<=<%text>)
|
32
|
+
end: (?=</%text>)
|
33
|
+
- name: source.perl.mason.doc
|
34
|
+
captures:
|
35
|
+
"1":
|
36
|
+
name: keyword.control
|
37
|
+
"2":
|
38
|
+
name: variable.other
|
39
|
+
begin: (<(%doc)>)
|
40
|
+
end: (</(%doc)>)
|
41
|
+
patterns:
|
42
|
+
- name: comment.block
|
43
|
+
begin: (?<=<%doc>)
|
44
|
+
end: (?=</%doc>)
|
45
|
+
- name: source.perl.mason.line
|
46
|
+
begin: ^(%)
|
47
|
+
beginCaptures:
|
48
|
+
"1":
|
49
|
+
name: punctuation.section.embedded.perl.mason
|
50
|
+
end: $\n?
|
51
|
+
patterns:
|
52
|
+
- include: source.perl
|
53
|
+
- name: source.mason.component.block
|
54
|
+
endCaptures:
|
55
|
+
"1":
|
56
|
+
name: keyword.control
|
57
|
+
begin: (<&\|)((\w|\.|\:)*)(?!&>)
|
58
|
+
beginCaptures:
|
59
|
+
"1":
|
60
|
+
name: keyword.control
|
61
|
+
"2":
|
62
|
+
name: entity.name.function
|
63
|
+
end: (</&>)
|
64
|
+
patterns:
|
65
|
+
- name: source.mason.nesty
|
66
|
+
begin: (&>)
|
67
|
+
beginCaptures:
|
68
|
+
"1":
|
69
|
+
name: keyword.control
|
70
|
+
end: (?=</&>)
|
71
|
+
patterns:
|
72
|
+
- include: $self
|
73
|
+
- name: source.mason.component
|
74
|
+
endCaptures:
|
75
|
+
"1":
|
76
|
+
name: keyword.control
|
77
|
+
begin: (<&)(.{1,}?)( |,)+
|
78
|
+
beginCaptures:
|
79
|
+
"1":
|
80
|
+
name: keyword.control
|
81
|
+
"2":
|
82
|
+
name: entity.name.function
|
83
|
+
end: (&>)
|
84
|
+
patterns:
|
85
|
+
- include: source.perl
|
86
|
+
- name: source.mason.args
|
87
|
+
captures:
|
88
|
+
"1":
|
89
|
+
name: keyword.control
|
90
|
+
"2":
|
91
|
+
name: variable.other
|
92
|
+
begin: (<%(args.*?)>)
|
93
|
+
end: (</%(\2)>)
|
94
|
+
patterns:
|
95
|
+
- captures:
|
96
|
+
"2":
|
97
|
+
name: string.quoted.single
|
98
|
+
include: source.perl
|
99
|
+
match: (\s*)?(\w*)
|
100
|
+
- name: source.mason.methods
|
101
|
+
captures:
|
102
|
+
"1":
|
103
|
+
name: keyword.control
|
104
|
+
"2":
|
105
|
+
name: variable.other
|
106
|
+
begin: (<%(method|def|closure) .*?>)
|
107
|
+
end: (</%(\2)>)
|
108
|
+
patterns:
|
109
|
+
- include: $self
|
110
|
+
- name: source.mason.substitution
|
111
|
+
captures:
|
112
|
+
"1":
|
113
|
+
name: keyword.control
|
114
|
+
begin: "(<%) "
|
115
|
+
end: (%>)
|
116
|
+
patterns:
|
117
|
+
- include: source.perl
|
118
|
+
- include: text.html.basic
|
119
|
+
foldingStopMarker: (</(?i:(head|table|div|style|script|ul|ol|form|dl))>|\})
|
@@ -0,0 +1,567 @@
|
|
1
|
+
---
|
2
|
+
name: Mediawiki
|
3
|
+
fileTypes:
|
4
|
+
- mediawiki
|
5
|
+
- wikipedia
|
6
|
+
- wiki
|
7
|
+
scopeName: text.html.mediawiki
|
8
|
+
repository:
|
9
|
+
comments:
|
10
|
+
patterns:
|
11
|
+
- name: comment.block.html.mediawiki
|
12
|
+
begin: <!--
|
13
|
+
end: --\s*>
|
14
|
+
patterns:
|
15
|
+
- name: invalid.illegal.bad-comments-or-CDATA.html.mediawiki
|
16
|
+
match: --
|
17
|
+
inline:
|
18
|
+
patterns:
|
19
|
+
- captures:
|
20
|
+
"1":
|
21
|
+
name: constant.other.date-time.mediawiki
|
22
|
+
"2":
|
23
|
+
name: invalid.illegal.too-many-tildes.mediawiki
|
24
|
+
match: (~~~~~)(~{0,2})(?!~)
|
25
|
+
- name: constant.other.signature.mediawiki
|
26
|
+
match: ~~~~?
|
27
|
+
comment: 3 ~s for sig, 4 for sig + timestamp
|
28
|
+
- include: "#link"
|
29
|
+
- include: "#style"
|
30
|
+
- include: "#template"
|
31
|
+
- include: "#block_html"
|
32
|
+
- include: "#comments"
|
33
|
+
template:
|
34
|
+
patterns:
|
35
|
+
- name: meta.template-parameter.mediawiki
|
36
|
+
captures:
|
37
|
+
"1":
|
38
|
+
name: variable.parameter.template.numeric.mediawiki
|
39
|
+
match: "{{{[ ]*([0-9]+)[ ]*}}}"
|
40
|
+
- name: meta.template-parameter.mediawiki
|
41
|
+
captures:
|
42
|
+
"1":
|
43
|
+
name: variable.parameter.template.named.mediawiki
|
44
|
+
match: "{{{[ ]*(.*?)[ ]*}}}"
|
45
|
+
- name: meta.template.parser-function.mediawiki
|
46
|
+
endCaptures:
|
47
|
+
"1":
|
48
|
+
name: punctuation.fix_this_later.template.mediawiki
|
49
|
+
begin: ({{)(?=[ ]*#)
|
50
|
+
beginCaptures:
|
51
|
+
"1":
|
52
|
+
name: punctuation.fix_this_later.template.mediawiki
|
53
|
+
"2":
|
54
|
+
name: meta.function-call.template.mediawiki
|
55
|
+
end: (}})
|
56
|
+
patterns:
|
57
|
+
- include: "#inline"
|
58
|
+
comment: "\n\
|
59
|
+
\t\t\t\t\t\tWhy oh why did mediawiki have to add these??\n\
|
60
|
+
\t\t\t\t\t"
|
61
|
+
- name: meta.template.mediawiki
|
62
|
+
endCaptures:
|
63
|
+
"1":
|
64
|
+
name: punctuation.fix_this_later.template.mediawiki
|
65
|
+
begin: ({{)([^{}\|]+)?
|
66
|
+
beginCaptures:
|
67
|
+
"1":
|
68
|
+
name: punctuation.fix_this_later.template.mediawiki
|
69
|
+
"2":
|
70
|
+
name: meta.function-call.template.mediawiki
|
71
|
+
end: (}})
|
72
|
+
patterns:
|
73
|
+
- include: "#comments"
|
74
|
+
- begin: (\|)\s*(=)
|
75
|
+
contentName: comment.block.template-hack.mediawiki
|
76
|
+
beginCaptures:
|
77
|
+
"1":
|
78
|
+
name: punctuation.fix_this_later.pipe.mediawiki
|
79
|
+
"2":
|
80
|
+
name: punctuation.fix_this_later.equals-sign.mediawiki
|
81
|
+
end: (?=[|}])
|
82
|
+
- begin: (\|)(([^{}\|=]+)(=))?
|
83
|
+
contentName: meta.value.template.mediawiki
|
84
|
+
beginCaptures:
|
85
|
+
"1":
|
86
|
+
name: punctuation.fix_this_later.pipe.mediawiki
|
87
|
+
"2":
|
88
|
+
name: variable.parameter.template.mediawiki
|
89
|
+
"3":
|
90
|
+
name: punctuation.fix_this_later.equals-sign.mediawiki
|
91
|
+
end: (?=[|}])
|
92
|
+
patterns:
|
93
|
+
- include: "#inline"
|
94
|
+
- name: punctuation.fix_this_later.pipe.mediawiki
|
95
|
+
match: \|
|
96
|
+
comment: "\n\
|
97
|
+
\t\t\t\t\t\tI am not sure I really like the scope of\n\
|
98
|
+
\t\t\t\t\t\tmeta.function-call for templates, but it seems like\n\
|
99
|
+
\t\t\t\t\t\tthe closest thing to what a template is really doing,\n\
|
100
|
+
\t\t\t\t\t\twith parameters, etc.\n\
|
101
|
+
\t\t\t\t\t"
|
102
|
+
comment: "\n\
|
103
|
+
\t\t\t\tThis repository item covers templates and parser functions.\n\
|
104
|
+
\t\t\t"
|
105
|
+
entities:
|
106
|
+
patterns:
|
107
|
+
- name: constant.character.entity.html.mediawiki
|
108
|
+
match: "&([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);"
|
109
|
+
- name: invalid.illegal.bad-ampersand.html.mediawiki
|
110
|
+
match: "&"
|
111
|
+
comment: "\n\
|
112
|
+
\t\t\t\tMediawiki supports Unicode, so these should not usually be\n\
|
113
|
+
\t\t\t\tnecessary, but they do show up on pages from time to time.\n\
|
114
|
+
\t\t\t"
|
115
|
+
style_in_link:
|
116
|
+
patterns:
|
117
|
+
- name: markup.bold.mediawiki
|
118
|
+
begin: "'''"
|
119
|
+
end: "'''"
|
120
|
+
patterns:
|
121
|
+
- include: "#style_in_link"
|
122
|
+
- name: markup.italic.mediawiki
|
123
|
+
begin: "''"
|
124
|
+
end: "''"
|
125
|
+
patterns:
|
126
|
+
- include: "#style_in_link"
|
127
|
+
- captures:
|
128
|
+
"1":
|
129
|
+
name: meta.tag.inline.bold.html.mediawiki
|
130
|
+
begin: (<(b|strong)>)
|
131
|
+
contentName: markup.bold.html.mediawiki
|
132
|
+
end: (</\2>)
|
133
|
+
patterns:
|
134
|
+
- include: "#style_in_link"
|
135
|
+
- captures:
|
136
|
+
"1":
|
137
|
+
name: meta.tag.inline.italic.html.mediawiki
|
138
|
+
begin: (<(i|em)>)
|
139
|
+
contentName: markup.italic.html.mediawiki
|
140
|
+
end: (</\2>)
|
141
|
+
patterns:
|
142
|
+
- include: "#style_in_link"
|
143
|
+
- captures:
|
144
|
+
"1":
|
145
|
+
name: meta.tag.inline.strikethrough.html.mediawiki
|
146
|
+
begin: (<(s|strike)>)
|
147
|
+
contentName: markup.other.strikethrough.html.mediawiki
|
148
|
+
end: (</\2>)
|
149
|
+
patterns:
|
150
|
+
- include: "#style_in_link"
|
151
|
+
- captures:
|
152
|
+
"1":
|
153
|
+
name: meta.tag.inline.underline.html.mediawiki
|
154
|
+
begin: (<(u)>)
|
155
|
+
contentName: markup.underline.html.mediawiki
|
156
|
+
end: (</\2>)
|
157
|
+
patterns:
|
158
|
+
- include: "#style_in_link"
|
159
|
+
- captures:
|
160
|
+
"1":
|
161
|
+
name: meta.tag.inline.raw.html.mediawiki
|
162
|
+
begin: (<(tt|code)>)
|
163
|
+
contentName: markup.raw.html.mediawiki
|
164
|
+
end: (</\2>)
|
165
|
+
patterns:
|
166
|
+
- include: "#style_in_link"
|
167
|
+
- captures:
|
168
|
+
"1":
|
169
|
+
name: meta.tag.inline.any.html.mediawiki
|
170
|
+
begin: (<(big|small|sub|sup)>)
|
171
|
+
contentName: markup.other.inline-styles.html.mediawiki
|
172
|
+
end: (</\2>)
|
173
|
+
patterns:
|
174
|
+
- include: "#style_in_link"
|
175
|
+
- include: "#comments"
|
176
|
+
block:
|
177
|
+
patterns:
|
178
|
+
- name: meta.redirect.mediawiki
|
179
|
+
begin: ^\s*(?i)(#redirect)
|
180
|
+
beginCaptures:
|
181
|
+
"1":
|
182
|
+
name: keyword.control.redirect.mediawiki
|
183
|
+
end: \n
|
184
|
+
patterns:
|
185
|
+
- include: "#link"
|
186
|
+
- name: markup.heading.mediawiki
|
187
|
+
match: ^=+\s*$
|
188
|
+
- name: markup.heading.mediawiki
|
189
|
+
begin: ^(=+)(?=.*\1\s*$)
|
190
|
+
end: \1\s*$\n?
|
191
|
+
patterns:
|
192
|
+
- name: invalid.illegal.extra-equals-sign.mediawiki
|
193
|
+
match: (?<=^=|^==|^===|^====|^=====|^======)=+|=(?==*\s*$)
|
194
|
+
- include: "#inline"
|
195
|
+
comment: "\n\
|
196
|
+
\t\t\t\t\t\tThis matches lines which begin and end with some\n\
|
197
|
+
\t\t\t\t\t number of \xE2\x80\x9C=\xE2\x80\x9D marks. If they are mismatched, then\n\
|
198
|
+
\t\t\t\t\t interior \xE2\x80\x9C=\xE2\x80\x9D marks will be treated as invalid.\n\
|
199
|
+
\t\t\t\t "
|
200
|
+
- name: meta.separator.mediawiki
|
201
|
+
match: ^-{4,}[ \t]*($\n)?
|
202
|
+
comment: "\n\
|
203
|
+
\t\t\t\t\t\tA separator is made up of 4 or more -s alone on a\n\
|
204
|
+
\t\t\t\t\t\tline by themselves.\n\
|
205
|
+
\t\t\t\t\t"
|
206
|
+
- name: markup.raw.block.mediawiki
|
207
|
+
begin: ^ (?=\s*\S)
|
208
|
+
end: ^(?=[^ ])
|
209
|
+
patterns:
|
210
|
+
- include: "#inline"
|
211
|
+
comment: "\n\
|
212
|
+
\t\t\t\t\t\tCode blocks start with one space. Wiki text and\n\
|
213
|
+
\t\t\t\t\t\thtml are still interpreted in MediaWiki, unlike in\n\
|
214
|
+
\t\t\t\t\t\tmediawiki.\n\
|
215
|
+
\t\t\t\t\t"
|
216
|
+
- name: markup.list.mediawiki
|
217
|
+
begin: ^([#*:;])
|
218
|
+
end: ^(?!\1)
|
219
|
+
patterns:
|
220
|
+
- include: "#inline"
|
221
|
+
comment: "\n\
|
222
|
+
\t\t\t\t\t\tThis is preliminary. Eventually it would be nice\n\
|
223
|
+
\t\t\t\t\t\tto scope each type of list differently, and even to\n\
|
224
|
+
\t\t\t\t\t\tdo scopes of nested lists. There are 4 main things\n\
|
225
|
+
\t\t\t\t\t\twhich will be scoped as lists:\n\
|
226
|
+
\t\t\t\t\t\t\n\
|
227
|
+
\t\t\t\t\t\t - numbered lists (#)\n\
|
228
|
+
\t\t\t\t\t\t - unnumbered lists (*)\n\
|
229
|
+
\t\t\t\t\t\t - definition lists (; :)\n\
|
230
|
+
\t\t\t\t\t\t - indented paragraphs, as used on talk pages (:)\n\
|
231
|
+
\t\t\t\t\t\t\n\
|
232
|
+
\t\t\t\t\t\tthis last one might not even be scoped as a list in\n\
|
233
|
+
\t\t\t\t\t\tthe ideal case. It is fine as a list for now,\n\
|
234
|
+
\t\t\t\t\t\thowever.\n\
|
235
|
+
\t\t\t\t\t"
|
236
|
+
- include: "#table"
|
237
|
+
- include: "#comments"
|
238
|
+
- name: meta.paragraph.mediawiki
|
239
|
+
begin: ^(?![\t ;*#:=]|----|$)
|
240
|
+
end: ^(?:\s*$|(?=[;*#:=]|----))
|
241
|
+
patterns:
|
242
|
+
- include: "#inline"
|
243
|
+
comment: "\n\
|
244
|
+
\t\t\t\t\t\tAnything that is not a code block, list, header, etc.\n\
|
245
|
+
\t\t\t\t\t\tis a paragraph.\n\
|
246
|
+
\t\t\t\t\t"
|
247
|
+
table:
|
248
|
+
patterns:
|
249
|
+
- name: markup.other.table.mediawiki
|
250
|
+
begin: ^{\|
|
251
|
+
end: ^\|}
|
252
|
+
patterns:
|
253
|
+
- name: markup.other.table.row.mediawiki
|
254
|
+
begin: ^\|-
|
255
|
+
end: ^(?=\|-|\|})
|
256
|
+
patterns:
|
257
|
+
- include: "#inline"
|
258
|
+
comment: "\n\
|
259
|
+
\t\t\t\t\t\t\t\thopefully we can allow selection of a whole\n\
|
260
|
+
\t\t\t\t\t\t\t\ttable row, and possibly later allow things\n\
|
261
|
+
\t\t\t\t\t\t\t\tlike moving a whole row up/down, etc.\n\
|
262
|
+
\t\t\t\t\t\t\t"
|
263
|
+
- include: "#inline"
|
264
|
+
comment: "\n\
|
265
|
+
\t\t\t\t\t\twe are going to have to add the styling capabilities\n\
|
266
|
+
\t\t\t\t\t\tto this section eventually. It is complicated,\n\
|
267
|
+
\t\t\t\t\t\tthough, so I am putting it off.\n\
|
268
|
+
\t\t\t\t\t"
|
269
|
+
block_html:
|
270
|
+
patterns:
|
271
|
+
- captures:
|
272
|
+
"1":
|
273
|
+
name: meta.tag.inline.math.mediawiki
|
274
|
+
begin: (<math>)
|
275
|
+
contentName: source.math.tex.embedded.mediawiki
|
276
|
+
end: (</math>)
|
277
|
+
patterns:
|
278
|
+
- include: text.tex.math
|
279
|
+
- captures:
|
280
|
+
"1":
|
281
|
+
name: meta.tag.inline.ref.mediawiki
|
282
|
+
begin: (<ref>)
|
283
|
+
contentName: meta.reference.content.mediawiki
|
284
|
+
end: (</ref>)
|
285
|
+
patterns:
|
286
|
+
- include: "#inline"
|
287
|
+
- captures:
|
288
|
+
"1":
|
289
|
+
name: meta.tag.inline.ref.mediawiki
|
290
|
+
begin: (<gallery>)
|
291
|
+
contentName: meta.gallery.mediawiki
|
292
|
+
end: (</gallery>)
|
293
|
+
patterns:
|
294
|
+
- name: meta.item.gallery.mediawiki
|
295
|
+
begin: "(?x)\n\
|
296
|
+
\t\t\t\t\t\t\t\t^(?!\\s*\\n)\t\t\t\t# not an empty line\n\
|
297
|
+
\t\t\t\t\t\t\t\t( [ ]*(((i|I)mage)(:)) # spaces, image, colon\n\
|
298
|
+
\t\t\t\t\t\t\t\t ([^\\[\\]|]+) # anything\n\
|
299
|
+
\t\t\t\t\t\t\t\t (?<!\\s)[ ]* # spaces\n\
|
300
|
+
\t\t\t\t\t\t\t\t)?\n\
|
301
|
+
\t\t\t\t\t\t\t"
|
302
|
+
beginCaptures:
|
303
|
+
"6":
|
304
|
+
name: constant.other.wiki-link.image.mediawiki
|
305
|
+
"3":
|
306
|
+
name: constant.other.namespace.image.mediawiki
|
307
|
+
"5":
|
308
|
+
name: punctuation.fix_this_later.colon.mediawiki
|
309
|
+
end: \n
|
310
|
+
patterns:
|
311
|
+
- begin: ^(?!\|)|(\|)
|
312
|
+
contentName: string.other.title.gallery.mediawiki
|
313
|
+
beginCaptures:
|
314
|
+
"1":
|
315
|
+
name: punctuation.fix_this_later.pipe.mediawiki
|
316
|
+
end: \n|(?=\|)
|
317
|
+
patterns:
|
318
|
+
- include: "#inline"
|
319
|
+
- name: punctuation.fix_this_later.pipe.mediawiki
|
320
|
+
match: \|
|
321
|
+
comment: "\n\
|
322
|
+
\t\t\t\tThe available block HTML tags supported are:\n\
|
323
|
+
\t\t\t\t\n\
|
324
|
+
\t\t\t\t * blockquote, center, pre, div, hr, p\n\
|
325
|
+
\t\t\t\t * tables: table, th, tr, td, caption\n\
|
326
|
+
\t\t\t\t * lists: ul, ol, li\n\
|
327
|
+
\t\t\t\t * definition lists: dl, dt, dd\n\
|
328
|
+
\t\t\t\t * headers: h1, h2, h3, h4, h5, h6\n\
|
329
|
+
\t\t\t\t * br\n\
|
330
|
+
\t\t\t"
|
331
|
+
link:
|
332
|
+
patterns:
|
333
|
+
- name: meta.image.wiki.mediawiki
|
334
|
+
endCaptures:
|
335
|
+
"2":
|
336
|
+
name: punctuation.fix_this_later.pipe.mediawiki
|
337
|
+
"3":
|
338
|
+
name: string.other.title.link.wiki-link.mediawiki
|
339
|
+
begin: |-
|
340
|
+
(?x:
|
341
|
+
(\[\[) # opening brackets
|
342
|
+
( [ ]*(((i|I)mage)(:)) # spaces, image, colon
|
343
|
+
([^\[\]|]+) # anything
|
344
|
+
(?<!\s)[ ]* # spaces
|
345
|
+
)
|
346
|
+
)
|
347
|
+
applyEndPatternLast: 1
|
348
|
+
beginCaptures:
|
349
|
+
"6":
|
350
|
+
name: punctuation.fix_this_later.colon.mediawiki
|
351
|
+
"7":
|
352
|
+
name: constant.other.wiki-link.image.mediawiki
|
353
|
+
"1":
|
354
|
+
name: punctuation.fix_this_later.brackets.mediwiki
|
355
|
+
"4":
|
356
|
+
name: constant.other.namespace.image.mediawiki
|
357
|
+
end: |-
|
358
|
+
(?x:
|
359
|
+
((\|)[ ]*( [^\[\]|]+ )[ ]*)? # pipe, spaces, anything, spaces
|
360
|
+
(\]\]) # closing brackets
|
361
|
+
)
|
362
|
+
patterns:
|
363
|
+
- captures:
|
364
|
+
"1":
|
365
|
+
name: punctuation.fix_this_later.pipe.mediawiki
|
366
|
+
"2":
|
367
|
+
name: keyword.control.image.formatting.mediawiki
|
368
|
+
"3":
|
369
|
+
name: keyword.control.image.alignment.mediawiki
|
370
|
+
"4":
|
371
|
+
name: constant.numeric.image.width.mediawiki
|
372
|
+
"5":
|
373
|
+
name: constant.other.unit.mediawiki
|
374
|
+
match: "(?x)\n\
|
375
|
+
\t\t\t\t\t\t\t\t(\\|)[ ]*\n\
|
376
|
+
\t\t\t\t\t\t\t\t( (thumb|thumbnail|frame)\n\
|
377
|
+
\t\t\t\t\t\t\t\t |(right|left|center|none)\n\
|
378
|
+
\t\t\t\t\t\t\t\t |([0-9]+)(px)\n\
|
379
|
+
\t\t\t\t\t\t\t\t)[ ]*\n\
|
380
|
+
\t\t\t\t\t\t\t"
|
381
|
+
- name: punctuation.fix_this_later.pipe.mediawiki
|
382
|
+
match: \|
|
383
|
+
- include: "#style_in_link"
|
384
|
+
- name: meta.link.wiki.mediawiki
|
385
|
+
endCaptures:
|
386
|
+
"2":
|
387
|
+
name: string.other.title.link.wiki-link.mediawiki
|
388
|
+
begin: |-
|
389
|
+
(?x:
|
390
|
+
(\[\[) # opening brackets
|
391
|
+
(:)? # colon to suppress image or category?
|
392
|
+
((\s+):[^\[\]]*(?=\]\]))? # a colon after spaces is invalid
|
393
|
+
[ ]* # spaces
|
394
|
+
( (([^\[\]|]+)(:))? # namespace
|
395
|
+
([^\[\]|]+)(?<!\s)[ ]* # link name
|
396
|
+
)?
|
397
|
+
)
|
398
|
+
beginCaptures:
|
399
|
+
"7":
|
400
|
+
name: constant.other.namespace.mediawiki
|
401
|
+
"8":
|
402
|
+
name: punctuation.fix_this_later.colon.mediawiki
|
403
|
+
"9":
|
404
|
+
name: constant.other.wiki-link.mediawiki
|
405
|
+
"1":
|
406
|
+
name: punctuation.fix_this_later.brackets.mediawiki
|
407
|
+
"2":
|
408
|
+
name: keyword.operator.wiki-link.suppress-image-or-category.mediawiki
|
409
|
+
"4":
|
410
|
+
name: invalid.illegal.whitespace.mediawiki
|
411
|
+
end: |-
|
412
|
+
(?x:
|
413
|
+
(\|[ ]*([^\[\]|]+)[ ]*)? # pipe, spaces, anything, spaces
|
414
|
+
(\]\]) # closing brackets
|
415
|
+
)
|
416
|
+
patterns:
|
417
|
+
- include: "#style_in_link"
|
418
|
+
- name: meta.link.inline.external.mediawiki
|
419
|
+
begin: \[(\S+)\s*(?=[^\]]*\])
|
420
|
+
contentName: string.other.title.link.external.mediawiki
|
421
|
+
beginCaptures:
|
422
|
+
"1":
|
423
|
+
name: markup.underline.link.external.mediawiki
|
424
|
+
end: \]
|
425
|
+
patterns:
|
426
|
+
- include: "#style_in_link"
|
427
|
+
- name: markup.underline.link.external.mediawiki
|
428
|
+
match: ((https?|ftp|file)://|mailto:)[-:@a-zA-Z0-9_.~%+/?=&#]+(?<![.?:])
|
429
|
+
style:
|
430
|
+
patterns:
|
431
|
+
- name: markup.bold.mediawiki
|
432
|
+
begin: "'''"
|
433
|
+
end: "'''"
|
434
|
+
patterns:
|
435
|
+
- include: "#inline"
|
436
|
+
- name: markup.italic.mediawiki
|
437
|
+
begin: "''"
|
438
|
+
end: "''(?!'[^'])"
|
439
|
+
patterns:
|
440
|
+
- include: "#inline"
|
441
|
+
- captures:
|
442
|
+
"1":
|
443
|
+
name: meta.tag.inline.bold.html.mediawiki
|
444
|
+
begin: (<(b|strong)>)
|
445
|
+
contentName: markup.bold.html.mediawiki
|
446
|
+
end: (</\2>)
|
447
|
+
patterns:
|
448
|
+
- include: "#inline"
|
449
|
+
- captures:
|
450
|
+
"1":
|
451
|
+
name: meta.tag.inline.italic.html.mediawiki
|
452
|
+
begin: (<(i|em)>)
|
453
|
+
contentName: markup.italic.html.mediawiki
|
454
|
+
end: (</\2>)
|
455
|
+
patterns:
|
456
|
+
- include: "#inline"
|
457
|
+
- captures:
|
458
|
+
"1":
|
459
|
+
name: meta.tag.inline.strikethrough.html.mediawiki
|
460
|
+
begin: (<(s|strike)>)
|
461
|
+
contentName: markup.other.strikethrough.html.mediawiki
|
462
|
+
end: (</\2>)
|
463
|
+
patterns:
|
464
|
+
- include: "#inline"
|
465
|
+
- captures:
|
466
|
+
"1":
|
467
|
+
name: meta.tag.inline.underline.html.mediawiki
|
468
|
+
begin: (<(u)>)
|
469
|
+
contentName: markup.underline.html.mediawiki
|
470
|
+
end: (</\2>)
|
471
|
+
patterns:
|
472
|
+
- include: "#inline"
|
473
|
+
- captures:
|
474
|
+
"1":
|
475
|
+
name: meta.tag.inline.raw.html.mediawiki
|
476
|
+
begin: (<(tt|code)>)
|
477
|
+
contentName: markup.raw.html.mediawiki
|
478
|
+
end: (</\2>)
|
479
|
+
patterns:
|
480
|
+
- include: "#inline"
|
481
|
+
- captures:
|
482
|
+
"1":
|
483
|
+
name: meta.tag.inline.any.html.mediawiki
|
484
|
+
begin: (<(big|small|sub|sup)>)
|
485
|
+
contentName: markup.other.inline-styles.html.mediawiki
|
486
|
+
end: (</\2>)
|
487
|
+
patterns:
|
488
|
+
- include: "#inline"
|
489
|
+
comment: "\n\
|
490
|
+
\t\t\t\tTODO: We still need to add:\n\n\
|
491
|
+
\t\t\t\t * font\n\
|
492
|
+
\t\t\t\t * ruby, rb, rp, rt\n\
|
493
|
+
\t\t\t\t * cite\n\
|
494
|
+
\t\t\t\t\n\
|
495
|
+
\t\t\t\tinline tags to this section, and make sure that the other\n\
|
496
|
+
\t\t\t\ttags can accept attributes in the tag opening, etc. The\n\
|
497
|
+
\t\t\t\tcurrent implementation is intended to be naive, but covering\n\
|
498
|
+
\t\t\t\tthe majority of uses in mediawiki code.\n\
|
499
|
+
\t\t\t\t\n\
|
500
|
+
\t\t\t\tWe also need to add mediawiki-specific tags:\n\
|
501
|
+
\t\t\t\t\n\
|
502
|
+
\t\t\t\t * nowiki, noinclude, includeonly\n\
|
503
|
+
\t\t\t\t\n\
|
504
|
+
\t\t\t"
|
505
|
+
uuid: 6AF21ADF-316A-47D1-A8B6-1BB38637DE9A
|
506
|
+
foldingStartMarker: ^(=+)
|
507
|
+
patterns:
|
508
|
+
- include: "#block"
|
509
|
+
- include: "#inline"
|
510
|
+
foldingStopMarker: ^.*$(?=\n(=+)|(?!\n))
|
511
|
+
keyEquivalent: ^~M
|
512
|
+
comment: "\n\
|
513
|
+
\t\tThis language grammar tries to handle Mediawiki syntax. Mediawiki\n\
|
514
|
+
\t\tsyntax is a mess. This grammar will likely never quite work right.\n\
|
515
|
+
\t\tThis is unsurprising as Mediawiki itself has never quite worked right.\n\
|
516
|
+
\t\t\n\
|
517
|
+
\t\t\t\t--Jacob\n\
|
518
|
+
\t\t\n\
|
519
|
+
\t\tTODO: lots of fixes still to do:\n\
|
520
|
+
\t\t\n\
|
521
|
+
\t\t 1. Add a bunch of HTML tags. See the #block and #style sections.\n\
|
522
|
+
\t\t 3. Correctly scope all the parser functions and their contents.\n\
|
523
|
+
\t\t This on will be complicated, as there are several: expr, if, etc.\n\
|
524
|
+
\t\t 4. This is probably the biggest one: get all the lists to scope\n\
|
525
|
+
\t\t correctly by type of list. Right now we just scope every list\n\
|
526
|
+
\t\t as a list, and do not worry about what happens beyond that.\n\
|
527
|
+
\t\t Eventually we want to do numbered and unnumbered separately, etc.\n\
|
528
|
+
\t\t 5. Get some kind of folding by heading. Maybe it should just fold\n\
|
529
|
+
\t\t to the next header, no matter which level it is. Then we can\n\
|
530
|
+
\t\t make a contents just by folding everything. Not completely sure\n\
|
531
|
+
\t\t\tthis is possible with current TM folding.\n\
|
532
|
+
\t\t 7. Make sure that illegal things are correctly scoped illegal.\n\
|
533
|
+
\t\t This is non-trivial, and has several parts\n\
|
534
|
+
\t\t \n\
|
535
|
+
\t\t - Bold/italic are based on brain-dead heuristics. I want to\n\
|
536
|
+
\t\t be stricter than Mediawiki on this one. Also, we should\n\
|
537
|
+
\t\t scope as illegal when for instance a new heading starts\n\
|
538
|
+
\t\t before an italic has been closed.\n\
|
539
|
+
\t\t - Templates... these will be pretty tough to do, as they can\n\
|
540
|
+
\t\t be so flexible.\n\
|
541
|
+
\t\t - \n\
|
542
|
+
\t\t\n\
|
543
|
+
\t\t 9. <timeline></timeline> tag. I am really not sure this one is\n\
|
544
|
+
\t\t worth trying to do\n\
|
545
|
+
\t\t10. Figure out a better scope for meta.function-call. Infininight\n\
|
546
|
+
\t\t suggests entity.name.function.call, to be paralleled by\n\
|
547
|
+
\t\t entity.name.function.definition. I am not completly sure I like\n\
|
548
|
+
\t\t that solution, but it is probably better than meta.function-call\n\
|
549
|
+
\t\t\n\
|
550
|
+
\t\t\n\
|
551
|
+
\t\tTODO items not closely related to the grammar:\n\
|
552
|
+
\t\t\n\
|
553
|
+
\t\t 2. Add a drop command for links/images, add keyboard shortcuts for\n\
|
554
|
+
\t\t them too\n\
|
555
|
+
\t\t 3. Make sure all the preference items are sorted out, for instance\n\
|
556
|
+
\t\t smart typing pairs, indent patterns, etc.\n\
|
557
|
+
\t\t 4. Commands to do bold/italic, and maybe things like big/small \n\
|
558
|
+
\t\t 5. \n\
|
559
|
+
\t\t\n\
|
560
|
+
\t\tFINISHED:\n\
|
561
|
+
\t\t 2. Add support for LaTeX math mode inside of <math></math> tags.\n\
|
562
|
+
\t\t 1. Add a command for new list item. This one is trivial\n\
|
563
|
+
\t\t 6. Get the symbol list working on headings. Trivial.\n\
|
564
|
+
\t\t 8. <gallery></gallery> tag. This one adds some complication, but\n\
|
565
|
+
\t\t is worth supporting.\n\
|
566
|
+
\t\t \n\
|
567
|
+
\t"
|