Last active
December 31, 2015 12:49
-
-
Save WMeldon/7988517 to your computer and use it in GitHub Desktop.
API Blueprint linter for ST.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from .base_linter import BaseLinter | |
CONFIG = { | |
'language': 'ApiBlueprint', | |
'executable': 'snowcrash', | |
'lint_args': ['-v'] | |
} | |
class Linter(BaseLinter): | |
def parse_errors(self, view, errors, lines, errorUnderlines, violationUnderlines, warningUnderlines, errorMessages, violationMessages, warningMessages): | |
for line in errors.splitlines(): | |
match = re.match(r'(?P<type>.+):\s*\((?P<code>\d+)\)(?P<error>.+?)(?::|$)(?P<pos>\d+)?(?:.*)', line) | |
if match: | |
error_type, error_code, error, pos = match.group('type'), match.group('code'), match.group('error'), match.group('pos') | |
if error_type == 'warning': | |
messages = warningMessages | |
underlines = warningUnderlines | |
line, column = view.rowcol((int(pos))) | |
line += 1 | |
else: | |
messages = errorMessages | |
underlines = errorUnderlines | |
line, column = view.rowcol((int(pos))) | |
line += 1 | |
self.add_message(line, lines, error, messages) | |
self.underline_range(view, line, column, underlines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>mdown</string> | |
<string>markdown</string> | |
<string>markdn</string> | |
<string>md.hbs</string> | |
<string>md</string> | |
<string>apib</string> | |
</array> | |
<key>foldingStartMarker</key> | |
<string>(?x) | |
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> | |
|<!--(?!.*-->) | |
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) | |
)</string> | |
<key>foldingStopMarker</key> | |
<string>(?x) | |
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> | |
|^\s*--> | |
|(^|\s)\} | |
)</string> | |
<key>keyEquivalent</key> | |
<string>^~M</string> | |
<key>name</key> | |
<string>ApiBlueprint</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>(?<!\s)---\n$</string> | |
<key>end</key> | |
<string>^---\s</string> | |
<key>name</key> | |
<string>markup.raw.yaml.front-matter</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.yaml</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(?x)^ | |
(?= [ ]{,3}>. | |
| ([ ]{4}|\t)(?!$) | |
| [#]{1,6}\s*+ | |
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ | |
)</string> | |
<key>comment</key> | |
<string> | |
We could also use an empty end match and set | |
applyEndPatternLast, but then we must be sure that the begin | |
pattern will only match stuff matched by the sub-patterns. | |
</string> | |
<key>end</key> | |
<string>(?x)^ | |
(?! [ ]{,3}>. | |
| ([ ]{4}|\t) | |
| [#]{1,6}\s*+ | |
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ | |
)</string> | |
<key>name</key> | |
<string>meta.block-level.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#block_quote</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#block_raw</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#heading</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#separator</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(c)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.c</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(cpp)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.c++</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(coffee|coffeescript)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.coffee</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(css)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.css</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(ejs|underscore|lodash)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.ejs</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(diff)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.diff</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(go|golang)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.go</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(hbs|handlebars|html|html5)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.basic</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>text.html.handlebars</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(java)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.java</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(javascript|js)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.js</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(json)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.json</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(less)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.css.less</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(md|markdown)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.markdown</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(obj(?:ective\-|)c)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.objc</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(obj(?:ective\-|)c\+\+)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.objc++</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(perl)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.perl</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(python)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.python</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(ruby)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.ruby</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(sass)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.sass</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(scss)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.scss</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(shell|bash)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.shell</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(sql|ddl|dml)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.sql</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(styl)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.stylus</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(swig|liquid)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.swig</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(xml)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.xml</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(yaml)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.yaml</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(```|~~~)\s*(\w*)\s*$</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.fenced.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>variable.language.fenced.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\1)\n</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>^[ ]{0,3}([*+-])(?=\s)</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.list_item.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>^(?=\S)</string> | |
<key>name</key> | |
<string>markup.list.unnumbered.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#list-paragraph</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>^[ ]{0,3}([0-9]+)(\.)(?=\s)</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.list_item.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>^(?=\S)</string> | |
<key>name</key> | |
<string>markup.list.numbered.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#list-paragraph</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)</string> | |
<key>comment</key> | |
<string> | |
Markdown formatting is disabled inside block-level tags. | |
</string> | |
<key>end</key> | |
<string>(?<=^</\1>$\n)</string> | |
<key>name</key> | |
<string>meta.disable-markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.handlebars</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)</string> | |
<key>comment</key> | |
<string>Same rule but for one line disables.</string> | |
<key>end</key> | |
<string>$\n?</string> | |
<key>name</key> | |
<string>meta.disable-markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.handlebars</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.markdown</string> | |
</dict> | |
<key>10</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>11</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.title.markdown</string> | |
</dict> | |
<key>12</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>13</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>constant.other.reference.link.markdown</string> | |
</dict> | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.separator.key-value.markdown</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
<key>6</key> | |
<dict> | |
<key>name</key> | |
<string>markup.underline.link.markdown</string> | |
</dict> | |
<key>7</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
<key>8</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.title.markdown</string> | |
</dict> | |
<key>9</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(?x: | |
\s* # Leading whitespace | |
(\[)(.+?)(\])(:) # Reference name | |
[ \t]* # Optional whitespace | |
(<?)(\S+?)(>?) # The url | |
[ \t]* # Optional whitespace | |
(?: | |
((\().+?(\))) # Match title in quotes… | |
| ((").+?(")) # or in parens. | |
)? # Title is optional | |
\s* # Optional whitespace | |
$ | |
)</string> | |
<key>name</key> | |
<string>meta.link.reference.def.markdown</string> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>^(?=\S)(?![=-]{3,}(?=$))</string> | |
<key>end</key> | |
<string>^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#)</string> | |
<key>name</key> | |
<string>meta.paragraph.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>text.html.handlebars</string> | |
</dict> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.heading.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>^(={3,})(?=[ \t]*$)</string> | |
<key>name</key> | |
<string>markup.heading.1.markdown</string> | |
</dict> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.heading.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>^(-{3,})(?=[ \t]*$)</string> | |
<key>name</key> | |
<string>markup.heading.2.markdown</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
<key>repository</key> | |
<dict> | |
<key>ampersand</key> | |
<dict> | |
<key>comment</key> | |
<string> | |
Markdown will convert this for us. We match it so that the | |
HTML grammar will not mark it up as invalid. | |
</string> | |
<key>match</key> | |
<string>&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)</string> | |
<key>name</key> | |
<string>meta.other.valid-ampersand.markdown</string> | |
</dict> | |
<key>block_quote</key> | |
<dict> | |
<key>begin</key> | |
<string>\G[ ]{,3}(>)(?!$)[ ]?</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.blockquote.markdown</string> | |
</dict> | |
</dict> | |
<key>comment</key> | |
<string> | |
We terminate the block quote when seeing an empty line, a | |
separator or a line with leading > characters. The latter is | |
to “reset” the quote level for quoted lines. | |
</string> | |
<key>end</key> | |
<string>(?x)^ | |
(?= \s*$ | |
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ | |
| [ ]{,3}>. | |
)</string> | |
<key>name</key> | |
<string>markup.quote.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>(?x)\G | |
(?= [ ]{,3}>. | |
)</string> | |
<key>end</key> | |
<string>^</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#block_quote</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>applyEndPatternLast</key> | |
<integer>1</integer> | |
<key>begin</key> | |
<string>(?x)\G | |
(?= ([ ]{4}|\t) | |
| [#]{1,6}\s*+ | |
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ | |
)</string> | |
<key>end</key> | |
<string>^</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#block_raw</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#heading</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#separator</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(?x)\G | |
(?! $ | |
| [ ]{,3}>. | |
| ([ ]{4}|\t) | |
| [#]{1,6}\s*+ | |
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ | |
)</string> | |
<key>end</key> | |
<string>$|(?<=\n)</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#inline</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
</dict> | |
<key>block_raw</key> | |
<dict> | |
<key>match</key> | |
<string>\G([ ]{4}|\t).*$\n?</string> | |
<key>name</key> | |
<string>markup.raw.block.markdown</string> | |
</dict> | |
<key>bold</key> | |
<dict> | |
<key>begin</key> | |
<string>(?x) | |
(\*\*|__)(?=\S) # Open | |
(?= | |
( | |
<[^>]*+> # HTML tags | |
| (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> | |
# Raw | |
| \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes | |
| \[ | |
( | |
(?<square> # Named group | |
[^\[\]\\] # Match most chars | |
| \\. # Escaped chars | |
| \[ \g<square>*+ \] # Nested brackets | |
)*+ | |
\] | |
( | |
( # Reference Link | |
[ ]? # Optional space | |
\[[^\]]*+\] # Ref name | |
) | |
| ( # Inline Link | |
\( # Opening paren | |
[ \t]*+ # Optional whtiespace | |
<?(.*?)>? # URL | |
[ \t]*+ # Optional whtiespace | |
( # Optional Title | |
(?<title>['"]) | |
(.*?) | |
\k<title> | |
)? | |
\) | |
) | |
) | |
) | |
| (?!(?<=\S)\1). # Everything besides | |
# style closer | |
)++ | |
(?<=\S)\1 # Close | |
) | |
</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.bold.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(?<=\S)(\1)</string> | |
<key>name</key> | |
<string>markup.bold.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>applyEndPatternLast</key> | |
<integer>1</integer> | |
<key>begin</key> | |
<string>(?=<[^>]*?>)</string> | |
<key>end</key> | |
<string>(?<=>)</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.handlebars</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#escape</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#ampersand</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#bracket</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#raw</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#italic</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#image-inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-inet</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-email</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#image-ref</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-ref-literal</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-ref</string> | |
</dict> | |
</array> | |
</dict> | |
<key>bracket</key> | |
<dict> | |
<key>comment</key> | |
<string> | |
Markdown will convert this for us. We match it so that the | |
HTML grammar will not mark it up as invalid. | |
</string> | |
<key>match</key> | |
<string><(?![a-z/?\$!])</string> | |
<key>name</key> | |
<string>meta.other.valid-bracket.markdown</string> | |
</dict> | |
<key>escape</key> | |
<dict> | |
<key>match</key> | |
<string>\\[-`*_#+.!(){}\[\]\\>]</string> | |
<key>name</key> | |
<string>constant.character.escape.markdown</string> | |
</dict> | |
<key>heading</key> | |
<dict> | |
<key>begin</key> | |
<string>\G(#{1,6})(?!#)\s*(?=\S)</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.heading.markdown</string> | |
</dict> | |
</dict> | |
<key>contentName</key> | |
<string>entity.name.section.markdown</string> | |
<key>end</key> | |
<string>\s*(#*)$\n?</string> | |
<key>name</key> | |
<string>markup.heading.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#inline</string> | |
</dict> | |
</array> | |
</dict> | |
<key>image-inline</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>10</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.title.markdown</string> | |
</dict> | |
<key>11</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.markdown</string> | |
</dict> | |
<key>12</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.markdown</string> | |
</dict> | |
<key>13</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.title.markdown</string> | |
</dict> | |
<key>14</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.markdown</string> | |
</dict> | |
<key>15</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.markdown</string> | |
</dict> | |
<key>16</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.metadata.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>invalid.illegal.whitespace.markdown</string> | |
</dict> | |
<key>6</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.metadata.markdown</string> | |
</dict> | |
<key>7</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
<key>8</key> | |
<dict> | |
<key>name</key> | |
<string>markup.underline.link.image.markdown</string> | |
</dict> | |
<key>9</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(?x: | |
\! # Images start with ! | |
(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) | |
# Match the link text. | |
([ ])? # Space not allowed | |
(\() # Opening paren for url | |
(<?)(\S+?)(>?) # The url | |
[ \t]* # Optional whitespace | |
(?: | |
((\().+?(\))) # Match title in parens… | |
| ((").+?(")) # or in quotes. | |
)? # Title is optional | |
\s* # Optional whitespace | |
(\)) | |
)</string> | |
<key>name</key> | |
<string>meta.image.inline.markdown</string> | |
</dict> | |
<key>image-ref</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.markdown</string> | |
</dict> | |
<key>6</key> | |
<dict> | |
<key>name</key> | |
<string>constant.other.reference.link.markdown</string> | |
</dict> | |
<key>7</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>\!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\])</string> | |
<key>name</key> | |
<string>meta.image.reference.markdown</string> | |
</dict> | |
<key>inline</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#escape</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#ampersand</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#bracket</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#raw</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#bold</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#italic</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#line-break</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#image-inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-inet</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-email</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#image-ref</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-ref-literal</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-ref</string> | |
</dict> | |
</array> | |
</dict> | |
<key>italic</key> | |
<dict> | |
<key>begin</key> | |
<string>(?x) | |
(\*|_)(?=\S) # Open | |
(?= | |
( | |
<[^>]*+> # HTML tags | |
| (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> | |
# Raw | |
| \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes | |
| \[ | |
( | |
(?<square> # Named group | |
[^\[\]\\] # Match most chars | |
| \\. # Escaped chars | |
| \[ \g<square>*+ \] # Nested brackets | |
)*+ | |
\] | |
( | |
( # Reference Link | |
[ ]? # Optional space | |
\[[^\]]*+\] # Ref name | |
) | |
| ( # Inline Link | |
\( # Opening paren | |
[ \t]*+ # Optional whtiespace | |
<?(.*?)>? # URL | |
[ \t]*+ # Optional whtiespace | |
( # Optional Title | |
(?<title>['"]) | |
(.*?) | |
\k<title> | |
)? | |
\) | |
) | |
) | |
) | |
| \1\1 # Must be bold closer | |
| (?!(?<=\S)\1). # Everything besides | |
# style closer | |
)++ | |
(?<=\S)\1 # Close | |
) | |
</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.italic.markdown</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(?<=\S)(\1)((?!\1)|(?=\1\1))</string> | |
<key>name</key> | |
<string>markup.italic.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>applyEndPatternLast</key> | |
<integer>1</integer> | |
<key>begin</key> | |
<string>(?=<[^>]*?>)</string> | |
<key>end</key> | |
<string>(?<=>)</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>text.html.handlebars</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#escape</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#ampersand</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#bracket</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#raw</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#bold</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#image-inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-inline</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-inet</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-email</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#image-ref</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-ref-literal</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#link-ref</string> | |
</dict> | |
</array> | |
</dict> | |
<key>line-break</key> | |
<dict> | |
<key>match</key> | |
<string> {2,}$</string> | |
<key>name</key> | |
<string>meta.dummy.line-break</string> | |
</dict> | |
<key>link-email</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>markup.underline.link.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)</string> | |
<key>name</key> | |
<string>meta.link.email.lt-gt.markdown</string> | |
</dict> | |
<key>link-inet</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>markup.underline.link.markdown</string> | |
</dict> | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(<)((?:https?|ftp)://.*?)(>)</string> | |
<key>name</key> | |
<string>meta.link.inet.markdown</string> | |
</dict> | |
<key>link-inline</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>10</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.title.markdown</string> | |
</dict> | |
<key>11</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>12</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>13</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.description.title.markdown</string> | |
</dict> | |
<key>14</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>15</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>16</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.metadata.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.title.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>invalid.illegal.whitespace.markdown</string> | |
</dict> | |
<key>6</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.metadata.markdown</string> | |
</dict> | |
<key>7</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
<key>8</key> | |
<dict> | |
<key>name</key> | |
<string>markup.underline.link.markdown</string> | |
</dict> | |
<key>9</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.link.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(?x: | |
(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) | |
# Match the link text. | |
([ ])? # Space not allowed | |
(\() # Opening paren for url | |
(<?)(.*?)(>?) # The url | |
[ \t]* # Optional whitespace | |
(?: | |
((\().+?(\))) # Match title in parens… | |
| ((").+?(")) # or in quotes. | |
)? # Title is optional | |
\s* # Optional whitespace | |
(\)) | |
)</string> | |
<key>name</key> | |
<string>meta.link.inline.markdown</string> | |
</dict> | |
<key>link-ref</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.title.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.begin.markdown</string> | |
</dict> | |
<key>6</key> | |
<dict> | |
<key>name</key> | |
<string>constant.other.reference.link.markdown</string> | |
</dict> | |
<key>7</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.end.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\])</string> | |
<key>name</key> | |
<string>meta.link.reference.markdown</string> | |
</dict> | |
<key>link-ref-literal</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.markdown</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>string.other.link.title.markdown</string> | |
</dict> | |
<key>4</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.end.markdown</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.begin.markdown</string> | |
</dict> | |
<key>6</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.constant.end.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\])</string> | |
<key>name</key> | |
<string>meta.link.reference.literal.markdown</string> | |
</dict> | |
<key>list-paragraph</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>\G\s+(?=\S)</string> | |
<key>end</key> | |
<string>^\s*$</string> | |
<key>name</key> | |
<string>meta.paragraph.list.markdown</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#inline</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
</dict> | |
<key>raw</key> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.raw.markdown</string> | |
</dict> | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.raw.markdown</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)</string> | |
<key>name</key> | |
<string>markup.raw.inline.markdown</string> | |
</dict> | |
<key>separator</key> | |
<dict> | |
<key>match</key> | |
<string>\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?</string> | |
<key>name</key> | |
<string>meta.separator.markdown</string> | |
</dict> | |
</dict> | |
<key>scopeName</key> | |
<string>text.html.apib</string> | |
<key>uuid</key> | |
<string>dd477cf1-34c4-49d2-ba09-f8445676ccd4</string> | |
</dict> | |
</plist> |
What was needed is to add syntax highlighter to ApiBlueprint module:
$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/ApiBlueprint
$ curl -O https://gist.github.com/WMeldon/7988517/raw/19e3d20459ff4c3ca13bba850a11877eac5e715e/ApiBlueprint.tmLanguage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is what I have done:
Yet I do not see the any lint command for my (arbitrary) file. Does it have to be of a particular extension or how does this work?
I do not get anything listed in https://github.com/SublimeLinter/SublimeLinter#using
However the linter installation seems to work for linking ruby...