4 # Copyright (c) 2018 Philippe Proulx <pproulx@efficios.com>
6 # This is a Sublime Text 3 syntax definition for the specific subset of
7 # AsciiDoc markup used for EfficiOS projects, namely:
9 # * The LTTng Documentation
10 # * The LTTng man pages
11 # * The Babeltrace man pages
13 # Permission is hereby granted, free of charge, to any person obtaining a copy
14 # of this software and associated documentation files (the "Software"), to deal
15 # in the Software without restriction, including without limitation the rights
16 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 # copies of the Software, and to permit persons to whom the Software is
18 # furnished to do so, subject to the following conditions:
20 # The above copyright notice and this permission notice shall be included in
21 # all copies or substantial portions of the Software.
23 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31 name: EfficiOS AsciiDoc
35 scope: source.eos-adoc
38 - include: comment-start
41 - include: set-adoc-attr
42 - include: man-heading
48 - include: gen-pre-sig
49 - include: admonition-sig
50 - include: admonition-para
51 - include: internal-link-start
52 - include: external-link-start
53 - include: list-bullets
61 - meta_scope: comment.block.eos-adoc
65 - match: '^include::.*$'
66 scope: entity.name.tag.include.eos-adoc
68 - match: '^image::.*$'
69 scope: entity.name.tag.image.eos-adoc
71 - match: '^[A-Z][A-Z -]*$'
72 scope: keyword.control.conditional.heading.eos-adoc
73 push: man-heading-underline
74 man-heading-underline:
76 scope: keyword.control.conditional.heading.eos-adoc
79 scope: keyword.control.conditional.heading.eos-adoc
84 - match: '^\[\[[a-zA-Z0-9_-]+]]$'
85 scope: string.quoted.double.anchor.eos-adoc
91 scope: keyword.control.conditional.heading.eos-adoc
92 set: man-heading-underline
94 - meta_scope: keyword.control.conditional.heading.eos-adoc
98 - match: '^\[role="term"]$'
99 scope: constant.character.eos-adoc
105 - meta_scope: comment.block.term.eos-adoc
108 1: constant.character.escape.prompt.eos-adoc
112 - match: '^\[source,\s*\w+]$'
113 scope: constant.character.source.eos-adoc
118 - include: source-start
123 - meta_scope: comment.block.eos-adoc
127 - match: '^(\*|\.)+ '
128 scope: constant.character.escape.list-bullet.eos-adoc
131 scope: constant.character.escape.dl.eos-adoc
133 - match: '^\[verse]$'
134 scope: constant.character.verse.eos-adoc
136 - match: '^\[role="[^"]+"]$'
137 scope: constant.character.gen-role.eos-adoc
142 - meta_scope: comment.block.gen-pre.eos-adoc
146 - match: '^\[(TIP|WARNING|IMPORTANT|NOTE)]$'
147 scope: constant.character.admonition.eos-adoc
149 - match: '^(TIP|WARNING|IMPORTANT|NOTE):'
150 scope: constant.character.admonition.eos-adoc
153 scope: constant.character.escape.block-sep.eos-adoc
155 - include: external-link-start
156 - include: external-link-expl-start
157 - include: internal-link-start
160 - include: word-macro
161 - include: lttng-docs-opt
162 - include: lttng-docs-path
163 - include: lttng-docs-dir
164 - include: lttng-docs-env
165 - include: lttng-docs-cmd
169 - include: man-genopt
170 - include: man-bt-compcls
171 - include: man-bt-manparam
172 - include: man-bt-manopt
175 - include: code-backtick-start
176 - include: code-plus-start
177 - include: double-emphasis-start
178 - include: emphasis-start
179 - include: emphasis-quote
180 - include: strong-start
181 - include: escape-adoc-start
185 scope: comment.block.nbsp.eos-adoc
187 - match: '(?<!^)--(?!$)'
188 scope: comment.block.em-dash.eos-adoc
190 - match: ':(not|escwc|esccomma|escstar|escdot|bs):'
191 scope: entity.name.tag.not.eos-adoc
193 - match: '(<<)([a-zA-Z0-9_-]+),'
195 1: entity.name.function.link.eos-adoc
196 2: storage.modifier.c
199 - meta_scope: int-link.eos-adoc
201 set: internal-link-text
203 scope: entity.name.function.link.eos-adoc
207 - meta_scope: string.quoted.double.int-link-text.eos-adoc
211 - match: '(https?://.*?)(\[)'
213 1: storage.modifier.c
214 2: entity.name.function.ext-link.eos-adoc
217 - meta_scope: ext-link.eos-adoc
219 scope: entity.name.function.ext-link.eos-adoc
222 external-link-expl-start:
223 - match: '(link:)([^]]+)(\[)'
225 1: entity.name.function.ext-link.eos-adoc
226 2: storage.modifier.c
227 3: entity.name.function.ext-link.eos-adoc
228 push: external-link-expl
230 - meta_scope: ext-link.eos-adoc
232 scope: entity.name.function.ext-link.eos-adoc
236 - match: 'opt:(lttng[a-zA-Z-]*\([a-zA-Z0-9]+\)):(--?[a-zA-Z0-9_-]+)'
237 scope: entity.name.function.opt.eos-adoc
239 1: storage.modifier.c
240 2: storage.modifier.c
242 - match: 'path:\{(.+)}'
243 scope: entity.name.function.path.eos-adoc
245 1: storage.modifier.c
247 - match: 'dir:\{(.+)}'
248 scope: entity.name.function.dir.eos-adoc
250 1: storage.modifier.c
252 - match: 'env:([a-zA-Z0-9_]+)'
253 scope: entity.name.function.env.eos-adoc
255 1: storage.modifier.c
257 - match: 'cmd:([a-zA-Z0-9_-]+)'
258 scope: entity.name.function.cmd.eos-adoc
260 1: storage.modifier.c
262 - match: 'man:([a-zA-Z0-9_.+-]+\([a-zA-Z0-9]+\))'
263 scope: entity.name.function.man.eos-adoc
265 1: storage.modifier.c
267 - match: 'opt(?:ion)?:(--?[a-zA-Z0-9_-]+)'
268 scope: entity.name.function.opt.eos-adoc
270 1: storage.modifier.c
272 - match: 'nlopt(?:ion)?:(--?[a-zA-Z0-9_-]+)'
273 scope: entity.name.function.nlopt.eos-adoc
275 1: storage.modifier.c
277 - match: 'genopt(?:ion)?:(--?[a-zA-Z0-9_-]+)'
278 scope: entity.name.function.genopt.eos-adoc
280 1: storage.modifier.c
282 - match: 'compcls:(src|source|flt|filter|sink)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)'
283 scope: entity.name.function.opt.eos-adoc
285 1: storage.modifier.c
286 2: storage.modifier.c
287 3: storage.modifier.c
289 - match: 'manparam:(src|source|flt|filter|sink)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)'
290 scope: entity.name.function.opt.eos-adoc
292 1: storage.modifier.c
293 2: storage.modifier.c
294 3: storage.modifier.c
295 4: storage.modifier.c
297 - match: 'manopt:([a-zA-Z0-9_.+-]+\([a-zA-Z0-9]+\)):(--?[a-zA-Z0-9_-]+)'
298 scope: entity.name.function.opt.eos-adoc
300 1: storage.modifier.c
301 2: storage.modifier.c
304 scope: constant.character.escape.quotes.eos-adoc
309 - meta_scope: entity.name.function.code.eos-adoc
316 - meta_scope: entity.name.function.code.eos-adoc
322 scope: storage.modifier.c
323 double-emphasis-start:
325 push: double-emphasis
327 - meta_scope: entity.name.function.double-em.eos-adoc
332 - match: '(?<![A-Za-z0-9_])_(?!\s)'
335 - meta_scope: entity.name.function.em.eos-adoc
340 - match: "(?<![A-Za-z0-9_])'[^']+'"
341 scope: entity.name.function.em-quote.eos-adoc
343 - match: '\*\*(?!\s)'
346 - meta_scope: entity.name.function.strong.eos-adoc
347 - match: '(?<!\s)\*\*'
351 - match: '\$\$(?!\s)'
354 - meta_scope: entity.name.function.escape-adoc.eos-adoc
355 - match: '(?<!\s)\$\$'
358 - match: \[\[[a-zA-Z0-9_-]+]]
359 scope: string.quoted.double.anchor.eos-adoc
361 - match: '\{[a-zA-Z0-9_-]+\}'
362 scope: entity.name.tag.eos-adoc
364 - match: '^:([a-zA-Z0-9_-]+):\s+'
366 1: constant.numeric.set-adoc-attr.eos-adoc