on master help sign in
Updated AsciiDoc syntax submodule
268c096Ryan Tolboom
.gitmodules+3−3
@@ -94,9 +94,6 @@
94[submodule "assets/themes/sublime-snazzy"]
94[submodule "assets/themes/sublime-snazzy"]
95 path = assets/themes/sublime-snazzy
95 path = assets/themes/sublime-snazzy
96 url = https://github.com/greggb/sublime-snazzy
96 url = https://github.com/greggb/sublime-snazzy
97−[submodule "assets/syntaxes/AsciiDoc"]
98− path = assets/syntaxes/02_Extra/AsciiDoc
99− url = https://github.com/SublimeText/AsciiDoc.git
100[submodule "assets/syntaxes/Assembly (ARM)"]
97[submodule "assets/syntaxes/Assembly (ARM)"]
101 path = assets/syntaxes/02_Extra/Assembly (ARM)
98 path = assets/syntaxes/02_Extra/Assembly (ARM)
102 url = https://github.com/tvi/Sublime-ARM-Assembly
99 url = https://github.com/tvi/Sublime-ARM-Assembly
@@ -185,3 +182,6 @@
185[submodule "assets/syntaxes/02_Extra/QML"]
182[submodule "assets/syntaxes/02_Extra/QML"]
186 path = assets/syntaxes/02_Extra/QML
183 path = assets/syntaxes/02_Extra/QML
187 url = https://github.com/skozlovf/Sublime-QML
184 url = https://github.com/skozlovf/Sublime-QML
185+[submodule "assets/syntaxes/02_Extra/AsciiDoc"]
186+ path = assets/syntaxes/02_Extra/AsciiDoc
187+ url = https://github.com/asciidoctor/sublimetext-asciidoc.git
assets/syntaxes/02_Extra/AsciiDoc+1−1

Submodule changed.

assets/syntaxes/02_Extra/AsciiDoc.sublime-syntax+937−223
@@ -1,283 +1,997 @@
1%YAML 1.2
1%YAML 1.2
2---
2---
3# http://www.sublimetext.com/docs/3/syntax.html
3# http://www.sublimetext.com/docs/3/syntax.html
4−name: AsciiDoc
4+name: AsciiDoc (Asciidoctor)
5−comment: |
6− A very early hack. Mostly ripped from other syntaxes.
7− Only the very basic stuff is working.
8file_extensions:
5file_extensions:
9 - adoc
6 - adoc
7+ - ad
10 - asciidoc
8 - asciidoc
11− - asc
12−scope: text.html.asciidoc
9+scope: text.asciidoc
13contexts:
10contexts:
14 main:
11 main:
15− - include: heading_inline
12+ - include: lists
16− - include: heading-block
13+ - include: blocks
17− - include: heading-blockattr
14+ - include: section_titles
15+ - include: lines
16+ - include: inline
17+ - include: characters
18+ attribute_entry:
18− - match: \$\$(?!\$)
19+ - match: |-
20+ (?x)
21+ ^(:) # opening delimiter
22+ (!)? # bang symbol (unset attribute)
23+ ([A-Za-z0-9_][A-Za-z0-9_-]*) # attribute name
24+ (!)? # bang symbol (unset attribute)
25+ (:) # closing delimiter
26+ (?:\s+|(?=$))
27+ comment: |
28+ An attribute entry.
29+
30+ Examples:
31+ :my-attribute: value
32+ :sectnums!:
33+ :!sectnums:
34+ captures:
35+ 1: punctuation.definition.attributeentry.attrname.begin.asciidoc
36+ 2: punctuation.definition.attributeentry.unset.asciidoc
37+ 3: support.variable.attribute.asciidoc
38+ 4: punctuation.definition.attributeentry.unset.asciidoc
39+ 5: punctuation.definition.attributeentry.attrname.end.asciidoc
19 push:
40 push:
20− - meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc
41+ - meta_scope: meta.attributeentry.asciidoc
42+ - meta_content_scope: meta.attributeentry.value.asciidoc
21− - match: \$\$(?!\$)
43+ - match: $\n?
22 pop: true
44 pop: true
45+ - include: characters
46+ attribute_list_line:
47+ - match: '^(\[)[^\[\]]*(\])\s*$\n?'
48+ comment: "Attribute list as paragraph: single brackets. No need for special treatment of escape; follows literal block, section template as being a more general regex."
49+ scope: support.variable.attributelist.asciidoc
50+ captures:
51+ 1: punctuation.definition.attributelistline.begin.asciidoc
52+ 2: punctuation.definition.attributelistline.end.asciidoc
53+ attribute_reference:
23− - match: \+\+\+(?!\+)
54+ - match: "({)([A-Za-z0-9_][A-Za-z0-9_-]*)(})"
55+ comment: |
56+ Examples:
57+ {my-attribute}
58+ scope: variable.other
59+ captures:
60+ 1: constant.character.attributes.reference.begin.asciidoc
61+ 2: support.variable.attribute.asciidoc
62+ 3: constant.character.attributes.reference.end.asciidoc
63+ biblio_anchor:
64+ - match: '(?<!\[)(\[\[\[).*?(\]\]\])(?!\])'
65+ comment: |
66+ Bibliography anchor
67+
68+ Examples:
69+ [[[Lorem ipsum]]]
70+ scope: storage.type.reference.biblioanchor.asciidoc
71+ captures:
72+ 1: punctuation.definition.biblioanchor.begin.asciidoc
73+ 2: punctuation.definition.biblioanchor.end.asciidoc
74+ block_admonition_label:
75+ - match: ^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):(?=\s+)
76+ comment: |
77+ Label of an admonition block.
78+
79+ Examples:
80+ NOTE: This is a admonition block.
81+ WARNING: Be aware of them!
82+ scope: support.constant.admonitionword.asciidoc
83+ block_comment:
84+ - match: '^(/{4,})\s*$\n?'
85+ comment: |
86+ Examples:
87+ ////
88+ A multi-line comment.
89+ Notice it's a delimited block.
90+ ////
91+ captures:
92+ 0: punctuation.definition.comment.begin.asciidoc
24 push:
93 push:
25− - meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc
94+ - meta_scope: comment.block.asciidoc
95+ - meta_content_scope: meta.block.comment.content.asciidoc
26− - match: \+\+\+(?!\+)
96+ - match: ^\1\s*$\n?
97+ captures:
98+ 0: punctuation.definition.comment.end.asciidoc
27 pop: true
99 pop: true
100+ - include: macro
101+ block_example:
28− - match: (//).*$\n?
102+ - match: '^(={4,})\s*$\n?'
29− scope: comment.line.double-slash.asciidoc
103+ comment: |
30− - match: |-
104+ Examples:
31− (?x)^
105+ ====
32− (?= ([/+-.*_=]{4,})\s*$
106+ Lorem ipsum.
33− | ([ \t]{1,})
107+ ====
34− | [=]{1,6}\s*+
108+
35− | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
109+ Note: Might need to add more includes, but these are the ones that arise in
36− )
110+ practice for me.
111+ captures:
112+ 0: constant.delimiter.example.begin.asciidoc
37 push:
113 push:
114+ - meta_scope: string.unquoted.block.example.asciidoc
38− - meta_scope: meta.block-level.asciidoc
115+ - meta_content_scope: meta.block.example.content.asciidoc
39− - match: |-
116+ - match: ^\1\s*$\n?
40− (?x)^
117+ captures:
41− (?! \1
118+ 0: constant.delimiter.example.end.asciidoc
42− | ([ \t]{1,})
43− | [=]{1,6}\s*+
44− | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
45− )
46 pop: true
119 pop: true
47− - include: block_quote
120+ - include: lists
48− - include: block_raw
121+ - include: block_listing
49− - include: heading_inline
122+ - include: lines
50− - include: heading-block
123+ - include: inline
51− - include: separator
124+ - include: characters
125+ block_id:
126+ - match: '^(\[\[)([^\[].*)(\]\])\s*$\n?'
127+ comment: |
128+ A block id (i.e. anchor).
129+
130+ Examples:
131+ [[myid]]
132+ Lorem ipsum dolor.
133+ scope: meta.tag.blockid.asciidoc
134+ captures:
135+ 1: punctuation.definition.blockid.begin.asciidoc
136+ 2: markup.underline.blockid.id.asciidoc
137+ 3: punctuation.definition.blockid.end.asciidoc
138+ block_listing:
52− - match: '^[ ]{0,3}([*+-])(?=\s)'
139+ - match: '^(\-{4,})\s*$\n?'
140+ comment: |
141+ Examples:
142+ ----
143+ Lorem ipsum.
144+ ----
53− captures:
145+ captures:
54− 1: punctuation.definition.list_item.asciidoc
146+ 0: constant.delimiter.listing.begin.asciidoc
55 push:
147 push:
56− - meta_scope: markup.list.unnumbered.asciidoc
148+ - meta_scope: meta.embedded.block.listing.asciidoc
149+ - meta_content_scope: source.block.listing.content.asciidoc
57− - match: ^(?=\S)
150+ - match: ^\1\s*$\n?
58 captures:
151 captures:
59− 1: punctuation.definition.list_item.asciidoc
152+ 0: constant.delimiter.listing.end.asciidoc
60 pop: true
153 pop: true
61− - include: list-paragraph
154+ - include: inline_callout
155+ block_literal:
62− - match: '^[ ]{0,3}[0-9]+(\.)(?=\s)'
156+ - match: '^(\.{4,})\s*$\n?'
157+ comment: |
158+ Examples:
159+ ....
160+ Lorem ipsum.
161+ ....
63 captures:
162 captures:
64− 1: punctuation.definition.list_item.asciidoc
163+ 0: constant.delimiter.block.literal.begin.asciidoc
65 push:
164 push:
66− - meta_scope: markup.list.numbered.asciidoc
165+ - meta_scope: string.literal.block.delimited.asciidoc
166+ - meta_content_scope: meta.block.literal.content.asciidoc
67− - match: ^(?=\S)
167+ - match: ^\1\s*$\n?
68 captures:
168 captures:
69− 1: punctuation.definition.list_item.asciidoc
169+ 0: constant.delimiter.block.literal.end.asciidoc
70 pop: true
170 pop: true
71− - include: list-paragraph
171+ - include: inline_callout
172+ block_open:
72− - match: '^([/+-.*_=]){4,}\s*$'
173+ - match: ^\-\-\s*$\n?
174+ comment: |
175+ Examples:
176+ --
177+ Lorem ipsum
178+ --
179+ Note: Might need to check on these includes.
180+ captures:
181+ 0: constant.delimiter.block.open.begin.asciidoc
73 push:
182 push:
74− - meta_scope: comment.block.asciidoc
183+ - meta_scope: meta.block.open.asciidoc
184+ - meta_content_scope: meta.block.open.content.asciidoc
75− - match: '^\1{4,}\s*$'
185+ - match: ^\-\-\s*$\n?
186+ captures:
187+ 0: constant.delimiter.block.open.end.asciidoc
76 pop: true
188 pop: true
189+ - include: lists
190+ - include: block_comment
191+ - include: block_listing
192+ - include: block_pass
193+ - include: lines
194+ - include: inline
195+ - include: characters
196+ block_page_break:
197+ - match: '^<{3,}$\n?'
198+ comment: |
199+ A page break.
200+
201+ Examples:
202+ <<<
203+ <<<<<
204+ scope: meta.separator.pagebreak.asciidoc
205+ block_pass:
77− - match: '^([/+.]){4,}\s*$'
206+ - match: '^(\+{4,})\s*$\n?'
78− comment: asciidoc formatting is disabled inside certain blocks.
207+ captures:
208+ 0: constant.delimiter.block.passthrough.begin.asciidoc
79 push:
209 push:
80− - meta_scope: meta.disable-asciidoc
210+ - meta_scope: meta.embedded.block.passthrough.asciidoc
211+ - meta_content_scope: text.xml.block.passthrough.content.asciidoc
81− - match: '^[/+.]{4,}\s*$'
212+ - match: ^\1\s*$\n?
213+ captures:
214+ 0: constant.delimiter.block.passthrough.end.asciidoc
82 pop: true
215 pop: true
216+ - include: scope:text.xml
217+ block_quote:
83− - match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)'
218+ - match: '^(_{4,})\s*$\n?'
219+ comment: |
220+ Examples:
221+ ____
222+ Lorem ipsum
223+ ____
224+
225+ Note: Might need to add more includes, but these are the ones that arise for me in practice.
226+ captures:
227+ 0: constant.delimiter.block.quote.begin.asciidoc
84 push:
228 push:
85− - meta_scope: meta.paragraph.asciidoc
229+ - meta_scope: markup.quote.block.asciidoc
230+ - meta_content_scope: meta.block.quote.content.asciidoc
86− - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n'
231+ - match: ^\1\s*$\n?
232+ captures:
233+ 0: constant.delimiter.block.quote.end.asciidoc
87 pop: true
234 pop: true
235+ - include: lines
88 - include: inline
236 - include: inline
89− - include: scope:text.html.basic
237+ - include: characters
238+ block_sidebar:
90− - match: '^(={3,})(?=[ \t]*$)'
239+ - match: '^(\*{4,})\s*$\n?'
91− scope: markup.heading.0.asciidoc
240+ comment: |
92− captures:
241+ Examples:
93− 1: punctuation.definition.heading.asciidoc
242+ ****
94− - match: '^(-{3,})(?=[ \t]*$)'
243+ Lorem ipsum
95− scope: markup.heading.1.asciidoc
244+ ****
245+
246+ Note: Might need to add more includes, but these are the ones that arise
247+ for me in practice.
248+ captures:
249+ 0: constant.delimiter.block.sidebar.begin.asciidoc
250+ push:
251+ - meta_scope: string.quoted.block.sidebar.asciidoc
252+ - meta_content_scope: meta.block.sidebar.content.asciidoc
253+ - match: ^\1\s*$\n?
96 captures:
254 captures:
97− 1: punctuation.definition.heading.asciidoc
255+ 0: constant.delimiter.block.sidebar.end.asciidoc
98− - match: '^(~{3,})(?=[ \t]*$)'
256+ pop: true
99− scope: markup.heading.2.asciidoc
257+ - include: lists
258+ - include: block_comment
259+ - include: block_listing
260+ - include: lines
261+ - include: inline
262+ - include: characters
263+ block_source_fenced:
264+ - match: ^(```)(\w+)?\s*$\n?
265+ comment: |
266+ Fenced code block (ala Markdown)
267+
268+ Examples:
269+ ```rb
270+ puts 'Hello world!'
271+ ```
272+ captures:
273+ 0: constant.delimiter.listing.begin.asciidoc
274+ push:
275+ - meta_scope: meta.embedded.block.listing.asciidoc
276+ - meta_content_scope: source.block.listing.content.asciidoc
277+ - match: ^\1\s*$\n?
100 captures:
278 captures:
279+ 0: constant.delimiter.listing.end.asciidoc
280+ pop: true
281+ - include: inline_callout
282+ block_thematic_break:
283+ - match: '^''{3,}$\n?'
284+ comment: |
285+ A thematic break (aka horizontal rule).
286+
287+ Examples:
288+ '''
289+ ''''''
290+ scope: meta.separator.ruler.asciidoc
291+ block_title:
292+ - match: ^(\.)\w.*$\n?
293+ comment: |
294+ Title of a block.
295+
296+ Examples:
297+ .My title
298+ Lorem ipsum dolor.
299+ scope: markup.heading.block.asciidoc
300+ captures:
101− 1: punctuation.definition.heading.asciidoc
301+ 1: punctuation.definition.blockheading.asciidoc
302+ blocks:
303+ - include: block_literal
304+ - include: block_comment
305+ - include: block_listing
306+ - include: block_source_fenced
307+ - include: block_sidebar
308+ - include: block_pass
309+ - include: block_quote
310+ - include: block_example
311+ - include: block_open
312+ characters:
313+ - include: attribute_reference
314+ - include: entity_number
315+ - include: entity_name
316+ - include: escape
317+ - include: replacement
318+ - include: macro_pass
319+ - include: macro
320+ - include: xref
321+ - include: biblio_anchor
322+ - include: indexterm_triple
323+ - include: indexterm_double
324+ colist_item_marker:
102− - match: '^(\^{3,})(?=[ \t]*$)'
325+ - match: ^(\s*((<)\d+?(>)))\s+(?=\S)
326+ comment: |
327+ Marker of a callout list item.
328+
329+ Examples:
330+ <1> a callout
331+ <42> another callout
332+ scope: markup.list.numbered.callout.asciidoc
333+ captures:
334+ 1: string.unquoted.list.callout.asciidoc
335+ 2: constant.numeric.callout.asciidoc
336+ 3: punctuation.definition.calloutlistnumber.begin.asciidoc
337+ 4: punctuation.definition.calloutlistnumber.end.asciidoc
338+ dlist_item_label:
339+ - match: '^\s*(?=.*:{2,4}(?:\s|$))'
340+ comment: |
341+ Label of a definition (labeled) list item.
342+
343+ Examples:
344+ Label level 1:: lorem ipsum
345+ Label level 2::: dolor sit amet
346+ Label level 3:::: consectetur
347+ Label level 1::
348+ lorem ipsum
349+ Another label :: lorem ipsum
350+ Last::label:: dolor sit amet
351+
352+ Note: This rule is not strictly correct, because Asciidoctor allows
353+ double colon followed by a space inside a label, i.e. it matches the
354+ *last* double colon, not the first. I don't know how to do that
355+ *effectively.
356+ push:
103− scope: markup.heading.3.asciidoc
357+ - meta_scope: markup.list.labeled.asciidoc
358+ - meta_content_scope: meta.list.label.asciidoc
359+ - match: '(:{2,4})(?:\s|$\n?)'
104 captures:
360 captures:
105− 1: punctuation.definition.heading.asciidoc
361+ 1: constant.labeledlist.separator.asciidoc
362+ pop: true
363+ - include: inline
364+ - include: characters
365+ emphasis:
106− - match: '^(\+{3,})(?=[ \t]*$)'
366+ - match: |-
107− scope: markup.heading.4.asciidoc
367+ (?x)
368+ (\[[^\]]*?\])? # might be preceded by an attributes list
369+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
370+ (_)(?=\S) # delimiter underscore that must be followed by a nonspace character
371+ comment: |
372+ Emphasized (italic) text (constrained variant).
373+
374+ Examples:
375+ _Lorem ipsum_ dolor
376+ [red]_Lorem ipsum_ dolor
377+ captures:
378+ 1: support.variable.attributelist.asciidoc
379+ 2: punctuation.definition.italic.single.begin.asciidoc
380+ push:
381+ - meta_scope: markup.italic.single.asciidoc
382+ - meta_content_scope: meta.italicinner.single.asciidoc
383+ - match: |-
384+ (?x)
385+ (?<=\S)(_) # delimiter underscore that must be preceded by a nonspace character
386+ (?!\w) # ...and followed by a nonword character
108 captures:
387 captures:
109− 1: punctuation.definition.heading.asciidoc
388+ 1: punctuation.definition.italic.single.end.asciidoc
110− attribute-entry:
389+ pop: true
111− - match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$'
390+ - include: strong_double
112− scope: variable.other
391+ - include: monospaced_double
113− attribute-reference:
392+ - include: mark_double
114− - match: "{[-_. A-Za-z0-9]+}"
393+ - include: strong
115− scope: variable.other
394+ - include: monospaced
116− attribute-reference-predefined:
395+ - include: mark
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)}"
396+ - include: superscript
397+ - include: subscript
398+ - include: characters
399+ emphasis_double:
400+ - match: |-
401+ (?x)
402+ (\[[^\]]*?\])? # might start with attribute list
403+ (?<!\\) # must not be preceded by escape
404+ (__)
405+ comment: |
406+ Emphasized (italic) text (unconstrained variant).
407+
408+ Examples:
409+ Lo__re__m __ipsum dolor__.
410+ Lo[red]__re__m
411+ captures:
118− scope: support.variable
412+ 1: support.variable.attributelist.asciidoc
119− block_quote:
413+ 2: punctuation.definition.italic.double.begin.asciidoc
120− - match: '^([/+-.*_=]){4,}\s*$'
121 push:
414 push:
122− - meta_scope: comment.block.asciidoc
415+ - meta_scope: markup.italic.double.asciidoc
416+ - meta_content_scope: meta.italicinner.double.asciidoc
123− - match: '^\1{4,}\s*$'
417+ - match: __
418+ captures:
419+ 0: punctuation.definition.italic.double.end.asciidoc
124 pop: true
420 pop: true
125− block_raw:
421+ - include: strong_double
422+ - include: monospaced_double
423+ - include: mark_double
424+ - include: strong
425+ - include: monospaced
426+ - include: mark
427+ - include: superscript
428+ - include: subscript
429+ - include: characters
430+ entity_name:
126− - match: '\G([ ]{4}|\t).*$\n?'
431+ - match: '(?<!\\)&([a-zA-Z][a-zA-Z0-9]*);'
127− scope: markup.raw.block.asciidoc
432+ comment: |
128− bracket:
433+ Character entity reference
129− - match: '<(?![a-z/?\$!])'
434+
435+ Examples:
436+ &nbsp;
437+ &sup2;
438+ scope: constant.character.entity.xml.asciidoc
439+ entity_number:
440+ - match: '(?<!\\)&#(x?[0-9a-fA-f]{2,4});'
130− comment: |
441+ comment: |
131− asciidoc will convert this for us. We match it so that the
442+ Numeric character reference
132− HTML grammar will not mark it up as invalid.
443+
133− scope: meta.other.valid-bracket.asciidoc
444+ Examples:
134− character-replacements:
445+ &#x278a;
135− - match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<=
446+ &#182;
136− scope: constant.character.asciidoc
447+ scope: constant.character.entity.asciidoc
137 escape:
448 escape:
138− - match: '\\[-`*_#+.!(){}\[\]\\>:]'
449+ - match: '\\(?=[-`*_#+.!(){}\[\]\\>:])'
450+ comment: |
451+ List of special characters that may be escaped.
452+
453+ Note: I do not really know if this is a good list, adopted wholesale from
454+ original bundle.
139 scope: constant.character.escape.asciidoc
455 scope: constant.character.escape.asciidoc
140− heading:
456+ indexterm_double:
141− - match: '(?m)^(\S+)$([=-~^+])+\s*$'
457+ - match: '(?<!\()(\({2})([^\(\s].*?)(\){2})(?!\))'
142− scope: markup.heading.asciidoc
458+ comment: |
459+ Double parenthesis indexterm.
460+
461+ Examples:
462+ ((Arthur))
463+ scope: variable.other.indexterm.double.asciidoc
143 captures:
464 captures:
144− 1: punctuation.definition.heading.asciidoc
465+ 1: constant.character.indexterm.double.begin.asciidoc
145− heading-block:
466+ 3: constant.character.indexterm.double.end.asciidoc
467+ indexterm_triple:
146− - match: ^\.(\w.*)$
468+ - match: '(?<!\()(\({3})([^\(].*?)(\){3})(?!\))'
147− scope: markup.heading.asciidoc
469+ comment: |
470+ Triple parenthesis indexterm.
471+
472+ Examples:
473+ (((Sword, Broadsword, Excalibur)))
474+ scope: variable.other.indexterm.triple.asciidoc
148 captures:
475 captures:
149− 1: punctuation.definition.heading.asciidoc
476+ 1: constant.character.indexterm.triple.begin.asciidoc
150− heading-blockattr:
477+ 3: constant.character.indexterm.triple.end.asciidoc
478+ inline:
479+ - include: passthrough
480+ - include: strong_double
481+ - include: emphasis_double
482+ - include: monospaced_double
483+ - include: mark_double
484+ - include: strong
485+ - include: emphasis
486+ - include: monospaced
487+ - include: mark
488+ - include: superscript
489+ - include: subscript
490+ inline_break:
151− - match: '^\[\[?(\w.*)\]$'
491+ - match: (?<=\s)\+$\n?
492+ comment: |
493+ Line hard break with a plus sign (+).
494+
495+ Examples:
496+ Rubies are red, +
497+ Topazes are blue.
498+ scope: constant.linebreak.asciidoc
499+ inline_callout:
500+ - match: (?<!\\)(<)\d+(>)
501+ comment: |
502+ Callout label
503+
504+ Examples:
505+ <1>
506+ <42>
152− scope: markup.heading.asciidoc
507+ scope: constant.other.callout.asciidoc
153 captures:
508 captures:
154− 1: punctuation.definition.heading.asciidoc
509+ 1: punctuation.definition.callout.begin.asciidoc
155− heading_inline:
510+ 2: punctuation.definition.callout.end.asciidoc
511+ inline_comment:
156− - match: '\G(={1,6})(?!=)\s*(?=\S)'
512+ - match: '^(//)([^/\n].*|)$\n?'
513+ comment: |
514+ Inline comment.
515+
516+ Examples:
517+ // This is just a comment!
518+ scope: comment.line.double-slash.asciidoc
157 captures:
519 captures:
158− 1: punctuation.definition.heading.asciidoc
520+ 1: punctuation.definition.comment.line.asciidoc
521+ 2: meta.line.comment.content.asciidoc
522+ lines:
523+ - include: inline_comment
524+ - include: list_continuation
525+ - include: inline_break
526+ - include: block_page_break
527+ - include: block_thematic_break
528+ - include: block_title
529+ - include: block_id
530+ - include: section_template
531+ - include: attribute_list_line
532+ - include: attribute_entry
533+ list_continuation:
534+ - match: ^\+\s*$\n?
535+ scope: constant.listcontinuation.asciidoc
536+ lists:
537+ - include: block_admonition_label
538+ - include: ulist_item_marker
539+ - include: olist_item_marker
540+ - include: dlist_item_label
541+ - include: colist_item_marker
542+ macro:
543+ - match: |-
544+ (?x)
545+ (?:
546+ ((?:https?|mailto|ftp|file) # specify separately so we can mark them as links that TextMate opens
547+ ?:{1} # inline only
548+ \S*) # (others such as image are partial URLs and/or TextMate cannot handle them)
549+ |
550+ (([a-zA-Z0-9][a-zA-Z0-9_]*)
551+ (:{1,2})
552+ (\S*))
553+ )
554+ (?:(\[)([^\]]*)(\]))
555+ comment: |
556+ Note: There are other macro notations, but I match only those that end in
557+ square brackets.
558+ scope: meta.macro.asciidoc
559+ captures:
560+ 1: markup.underline.link.macro.asciidoc
561+ 3: keyword.control.name.macro.asciidoc
562+ 4: constant.character.separator.macro.asciidoc
563+ 5: markup.underline.target.macro.asciidoc
564+ 6: constant.character.attributes.macro.begin.asciidoc
565+ 7: variable.parameter.attributes.macro.asciidoc
566+ 8: constant.character.attributes.macro.end.asciidoc
567+ macro_pass:
568+ - match: |-
569+ (?x)
570+ (pass)
571+ (:{1,2})
572+ (\S*)
573+ (\[)(?=[^\]]*\])
574+ comment: |
575+ Passthrough macro
576+
577+ Examples:
578+ pass:[Lorem ipsum]
579+ pass::[Lorem ipsum]
580+ captures:
581+ 1: keyword.control.name.macro.pass.asciidoc
582+ 2: constant.character.separator.macro.asciidoc
583+ 3: markup.underline.target.macro.asciidoc
584+ 4: constant.character.attributes.macro.begin.asciidoc
159 push:
585 push:
160− - meta_scope: markup.heading.asciidoc
586+ - meta_scope: meta.macro.pass.asciidoc
161− - meta_content_scope: entity.name.section.asciidoc
587+ - meta_content_scope: variable.parameter.attributes.macro.pass.asciidoc
162− - match: \s*(=*)$\n?
588+ - match: '\]'
163 captures:
589 captures:
164− 1: punctuation.definition.heading.asciidoc
590+ 0: constant.character.attributes.macro.end.asciidoc
165 pop: true
591 pop: true
166− - include: inline
592+ - include: scope:text.xml
167− inline:
593+ mark:
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,}$"
594+ - match: |-
196− scope: constant.character.escape.asciidoc
595+ (?x)
197− line-ruler:
596+ (\[[^\]]*?\])? # might start with attribute list (darned well better or why are we here)
198− - match: "^'{3,}$"
597+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
199− scope: constant.character.escape.asciidoc
598+ (\#)(?=\S) # delimiter hash that must be followed by a nonspace character
200− list-paragraph:
599+ comment: |
201− - match: \G\s+(?=\S)
600+ Marked text (constrained variant).
601+
602+ Examples:
603+ #Lorem ipsum# dolor
604+ [red]#Lorem ipsum# dolor
605+ captures:
606+ 1: support.variable.attributelist.asciidoc
607+ 2: punctuation.definition.string.unquoted.single.begin.asciidoc
202 push:
608 push:
203− - meta_scope: meta.paragraph.list.asciidoc
609+ - meta_scope: string.other.unquoted.single.asciidoc
610+ - meta_content_scope: string.unquoted.unquotedinner.single.asciidoc
204− - match: ^\s*$
611+ - match: |-
612+ (?x)
613+ (?<=\S)(\#) # delimiter hash that must be preceded by a nonspace character
614+ (?!\w) # ...and followed by a nonword character
615+ captures:
616+ 1: punctuation.definition.string.unquoted.single.end.asciidoc
205 pop: true
617 pop: true
206− - include: inline
618+ - include: strong_double
207− passthrough-macro-doubledollar-inline:
619+ - include: emphasis_double
620+ - include: monospaced_double
621+ - include: strong
622+ - include: emphasis
623+ - include: monospaced
624+ - include: superscript
625+ - include: subscript
626+ - include: characters
627+ mark_double:
208− - match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)'
628+ - match: |-
209− scope: comment.block.passthrough.asciidoc
629+ (?x)
210− passthrough-macro-trippleplus-inline:
630+ (\[[^\]]*?\])? # might start with an attribute list (indeed, that is its purpose)
631+ (?<!\\) # must not be preceded by escape
632+ (\#\#)
633+ comment: |
634+ Marked text (unconstrained variant).
635+
636+ Examples:
637+ Lo##re##m ##ipsum dolor##.
638+ Lo[red]##re##m
639+ captures:
640+ 1: support.variable.attributelist.asciidoc
641+ 2: punctuation.definition.string.unquoted.double.begin.asciidoc
642+ push:
643+ - meta_scope: string.other.unquoted.double.asciidoc
644+ - meta_content_scope: string.unquoted.unquotedinner.double.asciidoc
645+ - match: '\#\#'
646+ captures:
647+ 0: punctuation.definition.string.unquoted.double.end.asciidoc
648+ pop: true
649+ - include: strong_double
650+ - include: emphasis_double
651+ - include: monospaced_double
652+ - include: strong
653+ - include: emphasis
654+ - include: monospaced
655+ - include: superscript
656+ - include: subscript
657+ - include: characters
658+ monospaced:
211− - match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)'
659+ - match: |-
212− scope: comment.block.passthrough.asciidoc
660+ (?x)
213− raw:
661+ (\[[^\]]*?\])? # might start with attributes list
214− - match: '(`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
662+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
215− scope: markup.raw.inline.asciidoc
663+ (`)(?=\S) # delimiter backtick that must be followed by a nonspace character
664+ comment: |
665+ Monospaced text (constrained variant).
666+
667+ Examples:
668+ `Lorem ipsum` dolor
669+ [red]`Lorem ipsum` dolor
216− captures:
670+ captures:
217− 1: punctuation.definition.raw.asciidoc
671+ 1: support.variable.attributelist.asciidoc
218− 2: punctuation.definition.raw.asciidoc
672+ 2: punctuation.definition.literal.single.begin.asciidoc
219− separator:
673+ push:
220− - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?'
674+ - meta_scope: string.other.literal.single.asciidoc
221− scope: meta.separator.asciidoc
675+ - meta_content_scope: meta.literalinner.single.asciidoc
222− text-bold:
676+ - match: |-
223− - match: (?<!\w)(\*)(?=\S)
677+ (?x)
678+ (?<=\S)(`) # delimiter backtick that must be preceded by a nonspace character
679+ (?!\w) # ...and followed by a nonword character
680+ captures:
681+ 1: punctuation.definition.literal.single.end.asciidoc
682+ pop: true
683+ - include: strong_double
684+ - include: emphasis_double
685+ - include: mark_double
686+ - include: strong
687+ - include: emphasis
688+ - include: mark
689+ - include: superscript
690+ - include: subscript
691+ - include: characters
692+ monospaced_double:
693+ - match: |-
694+ (?x)
695+ (\[[^\]]*?\])? # might start with attribute list
696+ (?<!\\) # must not be preceded by escape
697+ (``)
698+ comment: |
699+ Monospaced text (unconstrained variant).
700+
701+ Examples:
702+ Lo``re``m ``ipsum dolor``.
703+ Lo[red]``re``m
704+ captures:
705+ 1: support.variable.attributelist.asciidoc
706+ 2: punctuation.definition.literal.double.begin.asciidoc
707+ push:
708+ - meta_scope: string.other.literal.double.asciidoc
709+ - meta_content_scope: meta.literalinner.double.asciidoc
710+ - match: "``"
711+ captures:
712+ 0: punctuation.definition.literal.double.end.asciidoc
713+ pop: true
714+ - include: strong_double
715+ - include: emphasis_double
716+ - include: mark_double
717+ - include: strong
718+ - include: emphasis
719+ - include: mark
720+ - include: superscript
721+ - include: subscript
722+ - include: characters
723+ olist_item_marker:
724+ - match: '^(\s*(\.{1,5}))\s+(?=\S)'
725+ comment: |
726+ Marker of an ordered (numbered) list item.
727+
728+ Examples:
729+ . level 1
730+ .. level 2
731+ ... level 3
732+ .... level 4
733+ ..... level 5
734+
735+ Note: The space distinguishes it from a block title.
736+ scope: markup.list.numbered.dotted.asciidoc
224− captures:
737+ captures:
225− 1: punctuation.definition.bold.asciidoc
738+ 1: string.unquoted.list.dotted.asciidoc
739+ 2: constant.numeric.list.dot.asciidoc
740+ passthrough:
741+ - match: (\+\+\+|\$\$)
742+ comment: |
743+ Inline triple-plus and double dolar passthrough.
744+
745+ Examples:
746+ Lo+++re++++m +++ipsum dolor+++.
747+ Lo$$re$$m $$ipsum dolor$$.
748+
749+ Note: Must be dead first among the inlines, so as to take priority.
750+ captures:
751+ 1: constant.character.passthru.begin.asciidoc
226 push:
752 push:
227− - meta_scope: markup.bold.asciidoc
753+ - meta_scope: meta.passthru.inline.asciidoc
754+ - meta_content_scope: variable.parameter.passthruinner.asciidoc
228− - match: (?<=\S)(\1)(?!\w)
755+ - match: \1
229 captures:
756 captures:
230− 1: punctuation.definition.bold.asciidoc
757+ 0: constant.character.passthru.end.asciidoc
231 pop: true
758 pop: true
232− text-bold-unconstrained:
759+ replacement:
760+ - match: |-
761+ (?x)
762+ (?<!\\) # must not be escaped
763+ (
764+ \(C\)
765+ | \(TM\)
766+ | \(R\)
767+ | ((?<!\-)\-\-(?!\-)) # exactly two, and even this may not rule out all that I want to
768+ | ((?<!\.)\.\.\.(?!\.)) # exactly three
769+ | \->
770+ | <\-
771+ | =>
772+ | <=
773+ )
774+ scope: constant.character.replacement.asciidoc
775+ section_template:
233− - match: (\*\*)(?=\S)
776+ - match: |-
777+ (?x)^
778+ (\[) # in square brackets
779+ (template\s*=\s*)?(")? # might start with template-equals and might have template name in quotes
780+ (
781+ sect\d|abstract|preface|colophon|dedication|glossary|bibliography|synopsis|appendix|index # fixed list of known templates
782+ )
783+ (".*(\])|(\])) # either close the quote (and perhaps go on) and close the bracket, or close the bracket immediately
784+ \s*$\n?
785+ comment: fixed list of known template names
786+ scope: variable.parameter.sectiontemplate.asciidoc
234 captures:
787 captures:
235− 1: punctuation.definition.bold.asciidoc
788+ 1: punctuation.definition.sectiontemplate.begin.asciidoc
789+ 4: meta.tag.sectiontemplate.asciidoc
790+ 6: punctuation.definition.sectiontemplate.end.asciidoc
791+ 7: punctuation.definition.sectiontemplate.end.asciidoc
792+ section_titles:
793+ - include: title_level_5
794+ - include: title_level_4
795+ - include: title_level_3
796+ - include: title_level_2
797+ - include: title_level_1
798+ - include: title_level_0
799+ strong:
800+ - match: |-
801+ (?x)
802+ (\[[^\]]*?\])? # might start with an attributes list
803+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
804+ (\*)(?=\S) # delimiter star that must be followed by a nonspace character
805+ comment: |
806+ Strong (bold) text (constrained variant).
807+
808+ Examples:
809+ *Lorem ipsum* dolor
810+ [red]*Lorem ipsum* dolor
811+ captures:
812+ 1: support.variable.attributelist.asciidoc
813+ 2: punctuation.definition.bold.single.begin.asciidoc
236 push:
814 push:
237− - meta_scope: markup.bold.asciidoc
815+ - meta_scope: markup.bold.single.asciidoc
816+ - meta_content_scope: meta.boldinner.single.asciidoc
238− - match: (?<=\S)(\1)
817+ - match: |-
818+ (?x)
819+ (?<=\S)(\*) # delimiter star that must be preceded by a nonspace character
820+ (?!\w) # ...and followed by a nonword character
239 captures:
821 captures:
240− 1: punctuation.definition.bold.asciidoc
822+ 1: punctuation.definition.bold.single.end.asciidoc
241 pop: true
823 pop: true
242− text-italic:
824+ - include: emphasis_double
825+ - include: monospaced_double
826+ - include: mark_double
827+ - include: emphasis
828+ - include: monospaced
829+ - include: mark
830+ - include: superscript
831+ - include: subscript
832+ - include: characters
833+ strong_double:
243− - match: (?<!\w)('|_)(?=\S)
834+ - match: |-
835+ (?x)
836+ (\[[^\]]*?\])? # might start with an attribute list
837+ (?<!\\) # must not be preceded by escape
838+ (\*\*)
839+ comment: |
840+ Strong (bold) text (unconstrained variant).
841+
842+ Examples:
843+ Lo**re**m **ipsum dolor**.
844+ Lo[red]**re**m
244 captures:
845 captures:
846+ 1: support.variable.attributelist.asciidoc
245− 1: punctuation.definition.italic.asciidoc
847+ 2: punctuation.definition.bold.double.begin.asciidoc
246 push:
848 push:
247− - meta_scope: markup.italic.asciidoc
849+ - meta_scope: markup.bold.double.asciidoc
850+ - meta_content_scope: meta.boldinner.double.asciidoc
248− - match: (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w)
851+ - match: \*\*
249 captures:
852 captures:
250− 1: punctuation.definition.italic.asciidoc
853+ 0: punctuation.definition.bold.double.end.asciidoc
251 pop: true
854 pop: true
252− text-italic-unconstrained:
855+ - include: emphasis_double
856+ - include: monospaced_double
857+ - include: mark_double
858+ - include: emphasis
859+ - include: monospaced
860+ - include: mark
861+ - include: superscript
862+ - include: subscript
863+ - include: characters
864+ subscript:
253− - match: (__)(?=\S)
865+ - match: |-
866+ (?x)
867+ (\[[^\]]*?\])? # might start with attribute list
868+ (?<!\\) # must not be preceded by escape
869+ (~)
870+ comment: |
871+ Subscript text.
872+
873+ Examples:
874+ E=mc^2^
875+ E=mc[red]^2^
254 captures:
876 captures:
877+ 1: support.variable.attributelist.asciidoc
255− 1: punctuation.definition.italic.asciidoc
878+ 2: punctuation.definition.string.subscript.begin.asciidoc
256 push:
879 push:
257− - meta_scope: markup.italic.asciidoc
880+ - meta_scope: string.other.subscript.asciidoc
258− - match: (?<=\S)(\1)
881+ - meta_content_scope: meta.subscriptinner.asciidoc
882+ - match: '~' # this tilda a problem if unquoted
259 captures:
883 captures:
260− 1: punctuation.definition.italic.asciidoc
884+ 0: punctuation.definition.string.subscript.end.asciidoc
261 pop: true
885 pop: true
262− text-monospace:
886+ - include: strong_double
263− - match: '(?<!\w)([\+`])[^\+]*(\1)(?!\w)'
887+ - include: emphasis_double
264− scope: string.interpolated.asciidoc
888+ - include: monospaced_double
265− text-monospace-unconstrained:
889+ - include: mark_double
266− - match: (\+\+).*(\1)
890+ - include: strong
267− scope: string.interpolated.asciidoc
891+ - include: emphasis
268− text-quote-double:
892+ - include: monospaced
893+ - include: mark
894+ - include: superscript
895+ - include: characters
896+ superscript:
269− - match: '(?<!\w)(?:\[.*\])?``(?!`).*''''(?!'')(?!\w)'
897+ - match: |-
270− scope: string.quoted.double.asciidoc
898+ (?x)
271− text-quote-other:
899+ (\[[^\]]*?\])? # might start with attribute list
272− - match: '(?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w)'
900+ (?<!\\) # no preceding escape
273− scope: string.quoted.single.asciidoc
901+ (\^)
274− text-quote-single:
902+ comment: |
903+ Superscript text.
904+
905+ Examples:
906+ H~2~O
907+ H[red]~2~O
908+ captures:
909+ 1: support.variable.attributelist.asciidoc
910+ 2: punctuation.definition.string.superscript.begin.asciidoc
911+ push:
912+ - meta_scope: string.other.superscript.asciidoc
913+ - meta_content_scope: meta.superscriptinner.asciidoc
914+ - match: ^
915+ captures:
916+ 0: punctuation.definition.string.superscript.end.asciidoc
917+ pop: true
918+ - include: strong_double
919+ - include: emphasis_double
920+ - include: monospaced_double
921+ - include: mark_double
922+ - include: strong
923+ - include: emphasis
924+ - include: monospaced
925+ - include: mark
926+ - include: subscript
927+ - include: characters
928+ title_level_0:
929+ - match: ^(=) (\w.*)$\n?
930+ scope: markup.heading.level.0.asciidoc
931+ captures:
932+ 1: punctuation.definition.heading.asciidoc
933+ 2: entity.name.section.asciidoc
934+ title_level_1:
935+ - match: ^(==) (\w.*)$\n?
936+ scope: markup.heading.level.1.asciidoc
937+ captures:
938+ 1: punctuation.definition.heading.asciidoc
939+ 2: entity.name.section.asciidoc
940+ title_level_2:
941+ - match: ^(===) (\w.*)$\n?
942+ scope: markup.heading.level.2.asciidoc
943+ captures:
944+ 1: punctuation.definition.heading.asciidoc
945+ 2: entity.name.section.asciidoc
946+ title_level_3:
947+ - match: ^(====) (\w.*)$\n?
948+ scope: markup.heading.level.3.asciidoc
949+ captures:
950+ 1: punctuation.definition.heading.asciidoc
951+ 2: entity.name.section.asciidoc
952+ title_level_4:
953+ - match: ^(=====) (\w.*)$\n?
954+ scope: markup.heading.level.4.asciidoc
955+ captures:
956+ 1: punctuation.definition.heading.asciidoc
957+ 2: entity.name.section.asciidoc
958+ title_level_5:
959+ - match: ^(======) (\w.*)$\n?
960+ scope: markup.heading.level.5.asciidoc
961+ captures:
962+ 1: punctuation.definition.heading.asciidoc
963+ 2: entity.name.section.asciidoc
964+ ulist_item_marker:
965+ - match: '^(\s*(\-|\*{1,5}))\s+(?=\S)'
966+ comment: |
967+ Marker of an unordered (bullet) list item.
968+
969+ Examples:
970+ * level 1
971+ ** level 2
972+ *** level 3
973+ **** level 4
974+ ***** level 5
975+ - level 1
976+ -- level 2
977+ --- level 3
978+ ---- level 4
979+ ----- level 5
980+ scope: markup.list.bulleted.asciidoc
981+ captures:
982+ 1: string.unquoted.list.bullet.asciidoc
983+ 2: constant.numeric.list.bullet.asciidoc
984+ xref:
275− - match: '(?<!\w)(?:\[.*\])?`(?!`).*''(?!'')(?!\w)'
985+ - match: '(?<!<)(<<)([^,]*?)((,\s*)(.*?))?(>>)(?!<)'
276− comment: "TODO: Sub- and Superscript are really unconstrained"
986+ comment: |
987+ Internal cross-reference
988+
989+ Examples:
990+ <<lorem>>
991+ <<lorem, see here>>
277− scope: string.quoted.single.asciidoc
992+ scope: meta.xref.asciidoc
278− text-unquoted:
993+ captures:
279− - match: (?<!\w)(#).*(\1)(?!\w)
994+ 1: constant.character.xref.begin.asciidoc
280− scope: string.unquoted.asciidoc
995+ 2: markup.underline.term.xref.asciidoc
281− text-unquoted-unconstrained:
996+ 5: variable.parameter.xref.asciidoc
282− - match: (##).*(\1)
997+ 6: constant.character.xref.end.asciidoc
283− scope: string.unquoted.asciidoc