on master help sign in
Add AsciiDoc syntax.
dd48d29Markus Thömmes
.gitmodules+3
@@ -100,3 +100,6 @@
100[submodule "assets/syntaxes/HTML (Twig)"]
100[submodule "assets/syntaxes/HTML (Twig)"]
101 path = assets/syntaxes/HTML (Twig)
101 path = assets/syntaxes/HTML (Twig)
102 url = https://github.com/Anomareh/PHP-Twig.tmbundle.git
102 url = https://github.com/Anomareh/PHP-Twig.tmbundle.git
103+[submodule "assets/syntaxes/AsciiDoc"]
104+ path = assets/syntaxes/AsciiDoc
105+ url = https://github.com/SublimeText/AsciiDoc.git
assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/AsciiDocnew file+1

Submodule changed.

assets/syntaxes/AsciiDoc.sublime-syntaxnew file+283
@@ -0,0 +1,283 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: AsciiDoc
5+comment: |
6+ A very early hack. Mostly ripped from other syntaxes.
7+ Only the very basic stuff is working.
8+file_extensions:
9+ - adoc
10+ - asciidoc
11+ - asc
12+scope: text.html.asciidoc
13+contexts:
14+ main:
15+ - include: heading_inline
16+ - include: heading-block
17+ - include: heading-blockattr
18+ - match: \$\$(?!\$)
19+ push:
20+ - meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc
21+ - match: \$\$(?!\$)
22+ pop: true
23+ - match: \+\+\+(?!\+)
24+ push:
25+ - meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc
26+ - match: \+\+\+(?!\+)
27+ pop: true
28+ - match: (//).*$\n?
29+ scope: comment.line.double-slash.asciidoc
30+ - match: |-
31+ (?x)^
32+ (?= ([/+-.*_=]{4,})\s*$
33+ | ([ \t]{1,})
34+ | [=]{1,6}\s*+
35+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
36+ )
37+ push:
38+ - meta_scope: meta.block-level.asciidoc
39+ - match: |-
40+ (?x)^
41+ (?! \1
42+ | ([ \t]{1,})
43+ | [=]{1,6}\s*+
44+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
45+ )
46+ pop: true
47+ - include: block_quote
48+ - include: block_raw
49+ - include: heading_inline
50+ - include: heading-block
51+ - include: separator
52+ - match: '^[ ]{0,3}([*+-])(?=\s)'
53+ captures:
54+ 1: punctuation.definition.list_item.asciidoc
55+ push:
56+ - meta_scope: markup.list.unnumbered.asciidoc
57+ - match: ^(?=\S)
58+ captures:
59+ 1: punctuation.definition.list_item.asciidoc
60+ pop: true
61+ - include: list-paragraph
62+ - match: '^[ ]{0,3}[0-9]+(\.)(?=\s)'
63+ captures:
64+ 1: punctuation.definition.list_item.asciidoc
65+ push:
66+ - meta_scope: markup.list.numbered.asciidoc
67+ - match: ^(?=\S)
68+ captures:
69+ 1: punctuation.definition.list_item.asciidoc
70+ pop: true
71+ - include: list-paragraph
72+ - match: '^([/+-.*_=]){4,}\s*$'
73+ push:
74+ - meta_scope: comment.block.asciidoc
75+ - match: '^\1{4,}\s*$'
76+ pop: true
77+ - match: '^([/+.]){4,}\s*$'
78+ comment: asciidoc formatting is disabled inside certain blocks.
79+ push:
80+ - meta_scope: meta.disable-asciidoc
81+ - match: '^[/+.]{4,}\s*$'
82+ pop: true
83+ - match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)'
84+ push:
85+ - meta_scope: meta.paragraph.asciidoc
86+ - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n'
87+ pop: true
88+ - include: inline
89+ - include: scope:text.html.basic
90+ - match: '^(={3,})(?=[ \t]*$)'
91+ scope: markup.heading.0.asciidoc
92+ captures:
93+ 1: punctuation.definition.heading.asciidoc
94+ - match: '^(-{3,})(?=[ \t]*$)'
95+ scope: markup.heading.1.asciidoc
96+ captures:
97+ 1: punctuation.definition.heading.asciidoc
98+ - match: '^(~{3,})(?=[ \t]*$)'
99+ scope: markup.heading.2.asciidoc
100+ captures:
101+ 1: punctuation.definition.heading.asciidoc
102+ - match: '^(\^{3,})(?=[ \t]*$)'
103+ scope: markup.heading.3.asciidoc
104+ captures:
105+ 1: punctuation.definition.heading.asciidoc
106+ - match: '^(\+{3,})(?=[ \t]*$)'
107+ scope: markup.heading.4.asciidoc
108+ captures:
109+ 1: punctuation.definition.heading.asciidoc
110+ attribute-entry:
111+ - match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$'
112+ scope: variable.other
113+ attribute-reference:
114+ - match: "{[-_. A-Za-z0-9]+}"
115+ scope: variable.other
116+ attribute-reference-predefined:
117+ - match: "{(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)}"
118+ scope: support.variable
119+ block_quote:
120+ - match: '^([/+-.*_=]){4,}\s*$'
121+ push:
122+ - meta_scope: comment.block.asciidoc
123+ - match: '^\1{4,}\s*$'
124+ pop: true
125+ block_raw:
126+ - match: '\G([ ]{4}|\t).*$\n?'
127+ scope: markup.raw.block.asciidoc
128+ bracket:
129+ - match: '<(?![a-z/?\$!])'
130+ comment: |
131+ asciidoc will convert this for us. We match it so that the
132+ HTML grammar will not mark it up as invalid.
133+ scope: meta.other.valid-bracket.asciidoc
134+ character-replacements:
135+ - match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<=
136+ scope: constant.character.asciidoc
137+ escape:
138+ - match: '\\[-`*_#+.!(){}\[\]\\>:]'
139+ scope: constant.character.escape.asciidoc
140+ heading:
141+ - match: '(?m)^(\S+)$([=-~^+])+\s*$'
142+ scope: markup.heading.asciidoc
143+ captures:
144+ 1: punctuation.definition.heading.asciidoc
145+ heading-block:
146+ - match: ^\.(\w.*)$
147+ scope: markup.heading.asciidoc
148+ captures:
149+ 1: punctuation.definition.heading.asciidoc
150+ heading-blockattr:
151+ - match: '^\[\[?(\w.*)\]$'
152+ scope: markup.heading.asciidoc
153+ captures:
154+ 1: punctuation.definition.heading.asciidoc
155+ heading_inline:
156+ - match: '\G(={1,6})(?!=)\s*(?=\S)'
157+ captures:
158+ 1: punctuation.definition.heading.asciidoc
159+ push:
160+ - meta_scope: markup.heading.asciidoc
161+ - meta_content_scope: entity.name.section.asciidoc
162+ - match: \s*(=*)$\n?
163+ captures:
164+ 1: punctuation.definition.heading.asciidoc
165+ pop: true
166+ - include: inline
167+ inline:
168+ - include: line-break
169+ - include: line-page-break
170+ - include: line-ruler
171+ - include: escape
172+ - include: passthrough-macro-trippleplus-inline
173+ - include: passthrough-macro-doubledollar-inline
174+ - include: character-replacements
175+ - include: bracket
176+ - include: raw
177+ - include: text-quote-single
178+ - include: text-quote-double
179+ - include: text-quote-other
180+ - include: text-bold-unconstrained
181+ - include: text-italic-unconstrained
182+ - include: text-monospace-unconstrained
183+ - include: text-unquoted-unconstrained
184+ - include: text-bold
185+ - include: text-italic
186+ - include: text-monospace
187+ - include: text-unquoted
188+ - include: attribute-entry
189+ - include: attribute-reference-predefined
190+ - include: attribute-reference
191+ line-break:
192+ - match: (?<=\S)\s+\+$
193+ scope: constant.character.escape.asciidoc
194+ line-page-break:
195+ - match: "^<{3,}$"
196+ scope: constant.character.escape.asciidoc
197+ line-ruler:
198+ - match: "^'{3,}$"
199+ scope: constant.character.escape.asciidoc
200+ list-paragraph:
201+ - match: \G\s+(?=\S)
202+ push:
203+ - meta_scope: meta.paragraph.list.asciidoc
204+ - match: ^\s*$
205+ pop: true
206+ - include: inline
207+ passthrough-macro-doubledollar-inline:
208+ - match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)'
209+ scope: comment.block.passthrough.asciidoc
210+ passthrough-macro-trippleplus-inline:
211+ - match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)'
212+ scope: comment.block.passthrough.asciidoc
213+ raw:
214+ - match: '(`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
215+ scope: markup.raw.inline.asciidoc
216+ captures:
217+ 1: punctuation.definition.raw.asciidoc
218+ 2: punctuation.definition.raw.asciidoc
219+ separator:
220+ - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?'
221+ scope: meta.separator.asciidoc
222+ text-bold:
223+ - match: (?<!\w)(\*)(?=\S)
224+ captures:
225+ 1: punctuation.definition.bold.asciidoc
226+ push:
227+ - meta_scope: markup.bold.asciidoc
228+ - match: (?<=\S)(\1)(?!\w)
229+ captures:
230+ 1: punctuation.definition.bold.asciidoc
231+ pop: true
232+ text-bold-unconstrained:
233+ - match: (\*\*)(?=\S)
234+ captures:
235+ 1: punctuation.definition.bold.asciidoc
236+ push:
237+ - meta_scope: markup.bold.asciidoc
238+ - match: (?<=\S)(\1)
239+ captures:
240+ 1: punctuation.definition.bold.asciidoc
241+ pop: true
242+ text-italic:
243+ - match: (?<!\w)('|_)(?=\S)
244+ captures:
245+ 1: punctuation.definition.italic.asciidoc
246+ push:
247+ - meta_scope: markup.italic.asciidoc
248+ - match: (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w)
249+ captures:
250+ 1: punctuation.definition.italic.asciidoc
251+ pop: true
252+ text-italic-unconstrained:
253+ - match: (__)(?=\S)
254+ captures:
255+ 1: punctuation.definition.italic.asciidoc
256+ push:
257+ - meta_scope: markup.italic.asciidoc
258+ - match: (?<=\S)(\1)
259+ captures:
260+ 1: punctuation.definition.italic.asciidoc
261+ pop: true
262+ text-monospace:
263+ - match: '(?<!\w)([\+`])[^\+]*(\1)(?!\w)'
264+ scope: string.interpolated.asciidoc
265+ text-monospace-unconstrained:
266+ - match: (\+\+).*(\1)
267+ scope: string.interpolated.asciidoc
268+ text-quote-double:
269+ - match: '(?<!\w)(?:\[.*\])?``(?!`).*''''(?!'')(?!\w)'
270+ scope: string.quoted.double.asciidoc
271+ text-quote-other:
272+ - match: '(?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w)'
273+ scope: string.quoted.single.asciidoc
274+ text-quote-single:
275+ - match: '(?<!\w)(?:\[.*\])?`(?!`).*''(?!'')(?!\w)'
276+ comment: "TODO: Sub- and Superscript are really unconstrained"
277+ scope: string.quoted.single.asciidoc
278+ text-unquoted:
279+ - match: (?<!\w)(#).*(\1)(?!\w)
280+ scope: string.unquoted.asciidoc
281+ text-unquoted-unconstrained:
282+ - match: (##).*(\1)
283+ scope: string.unquoted.asciidoc