Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Snippets/Table.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<content><![CDATA[

.${1:Table Caption}
[cols="$2",opts="${3:autowidth}"]
[cols="$2"]
|===
| $4
| $3
|===

]]></content>
$0]]></content>
<tabTrigger>|=</tabTrigger>
<scope>text.asciidoc</scope>
</snippet>
94 changes: 85 additions & 9 deletions Syntaxes/Asciidoctor.YAML-tmLanguage
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [PackageDev] target_format: plist, ext: tmLanguage
# -*- mode: YAML -*-

name: AsciiDoc (Asciidoctor)
name: Aspec
scopeName: text.asciidoc
fileTypes: [adoc, ad, asciidoc]
uuid: A2AE6D21-3F08-4978-ADF3-55B5AD580921
Expand All @@ -25,13 +25,17 @@ repository:
- include: '#block_literal'
- include: '#block_comment'
- include: '#custom_block'
- include: '#table_block'
- include: '#block_listing'
- include: '#block_source_fenced'
- include: '#block_sidebar'
- include: '#block_pass'
- include: '#block_quote'
- include: '#block_example'
- include: '#block_open'
- include: '#colconfig'
- include: '#role'
- include: '#inline_math'

block_comment:
comment: |
Expand Down Expand Up @@ -65,6 +69,57 @@ repository:
'3': {name: variable.parameter.sourcelang.asciidoc}
'4': {name: markup.underline.block.asciidoc}

colconfig:
name: markup.underline.block.id.def.asciidoc
match: |
(?x)^
(\[)
(cols="(.+)"(.+)?)
(\s*\])
\s*$\n?
captures:
'1': {name: markup.underline.block.asciidoc}
'2': {name: markup.underline.block.asciidoc}
'3': {name: variable.parameter.sourcelang.asciidoc}
'4': {name: markup.underline.block.asciidoc}

role:
name: markup.underline.block.id.def.asciidoc
match: |
(?x)^
(\[)
(\..+)
(\s*\])
\s*$\n?
captures:
'1': {name: markup.underline.block.asciidoc}
'2': {name: markup.underline.block.asciidoc}
'4': {name: markup.underline.block.asciidoc}

table_block:
comment: |
A Cool Table
Examples:
|===
| thing | two
|===

name: table.block.asciidoc
begin: (^\|={3,})\s*$\n?
beginCaptures:
'0': {name: variable.parameter.table.delimiter.asciidoc}
end: ^\1\s*$\n?
endCaptures:
'0': {name: variable.parameter.table.delimiter.asciidoc}
patterns:
- include: '#colconfig'
- include: '#block_listing'
- include: '#lines'
- include: '#inline'
- include: '#characters'
- include: '#table_pipe'
- include: '#inline_math'

block_example:
comment: |
Examples:
Expand Down Expand Up @@ -246,6 +301,20 @@ repository:
'1': {name: punctuation.definition.callout.begin.asciidoc}
'2': {name: punctuation.definition.callout.end.asciidoc}

inline_math:
comment: |
Callout label

Examples:
<1>
<42>
name: constant.other.callout.asciidoc
match: (\$)(.+?)(\$)
captures:
'1': {name: punctuation.definition.math.begin.asciidoc}
'2': {name: markup.underline.block.asciidoc}
'3': {name: punctuation.definition.math.end.asciidoc}


#-----------------------------------------------------------------------------#
# C H A R A C T E R S #
Expand All @@ -265,6 +334,7 @@ repository:
- include: '#indexterm_triple'
- include: '#indexterm_double'


attribute_reference:
comment: |
Examples:
Expand Down Expand Up @@ -444,6 +514,13 @@ repository:
- include: '#superscript'
- include: '#subscript'

table_pipe:
comment: default table separator
name: markup.table.pipe.asciidoc
match: ((\d\*)?\.?(>|^|<)?(\w+|\d+)?\|)
captures:
'1': {name: variable.parameter.table.delimiter.asciidoc}

strong_double:
comment: |
Strong (bold) text (unconstrained variant).
Expand Down Expand Up @@ -896,7 +973,6 @@ repository:
'6': {name: variable.parameter.reqversion.id.asciidoc}
'7': {name: markup.underline.block.id.asciidoc}


inline_break:
comment: |
Line hard break with a plus sign (+).
Expand Down Expand Up @@ -939,7 +1015,7 @@ repository:
(\[) # in square brackets
(template\s*=\s*)?(")? # might start with template-equals and might have template name in quotes
(
sect\d|abstract|preface|colophon|dedication|glossary|bibliography|synopsis|appendix|index # fixed list of known templates
sect\d|abstract|discrete|preface|colophon|dedication|glossary|bibliography|synopsis|appendix|index # fixed list of known templates
)
(".*(\])|(\])) # either close the quote (and perhaps go on) and close the bracket, or close the bracket immediately
\s*$\n?
Expand Down Expand Up @@ -1080,42 +1156,42 @@ repository:

title_level_0:
name: markup.heading.level.0.asciidoc
match: ^(=) (`?\w.*)$\n?
match: ^(=) (.+)
captures:
'1': {name: punctuation.definition.heading.asciidoc}
'2': {name: entity.name.section.asciidoc}

title_level_1:
name: markup.heading.level.1.asciidoc
match: ^(==) (`?\w.*)$\n?
match: ^(==) (.+)
captures:
'1': {name: punctuation.definition.heading.asciidoc}
'2': {name: entity.name.section.asciidoc}

title_level_2:
name: markup.heading.level.2.asciidoc
match: ^(===) (`?\w.*)$\n?
match: ^(===) (.+)
captures:
'1': {name: punctuation.definition.heading.asciidoc}
'2': {name: entity.name.section.asciidoc}

title_level_3:
name: markup.heading.level.3.asciidoc
match: ^(====) (`?\w.*)$\n?
match: ^(====) (.+)
captures:
'1': {name: punctuation.definition.heading.asciidoc}
'2': {name: entity.name.section.asciidoc}

title_level_4:
name: markup.heading.level.4.asciidoc
match: ^(=====) (`?\w.*)$\n?
match: ^(=====) (.+)
captures:
'1': {name: punctuation.definition.heading.asciidoc}
'2': {name: entity.name.section.asciidoc}

title_level_5:
name: markup.heading.level.5.asciidoc
match: ^(======) (`?\w.*)$\n?
match: ^(======) (.+)
captures:
'1': {name: punctuation.definition.heading.asciidoc}
'2': {name: entity.name.section.asciidoc}
Loading