{ "name": "reStructuredText", "scopeName": "text.restructuredtext", "fileTypes": [ "rst", "rest" ], "patterns": [ { "include": "#all" } ], "repository": { "all": { "patterns": [ { "include": "#escape" }, { "include": "#line-blocks" }, { "include": "#tables" }, { "include": "#headings" }, { "include": "#substitution-definition" }, { "include": "#directives" }, { "include": "#raw-blocks" }, { "include": "#inlines" }, { "include": "#tag-name" }, { "include": "#doctests" }, { "include": "#domains" }, { "include": "#comments" } ] }, "inlines": { "patterns": [ { "include": "#escape" }, { "include": "#emphasis" }, { "include": "#link-definition" }, { "include": "#substitution" }, { "include": "#literal" }, { "include": "#interpreted-line" }, { "include": "#anonymous-link" }, { "include": "#link-reference" }, { "include": "#interpreted-block" }, { "include": "#link-text" }, { "include": "#footnotes" }, { "include": "#citations" } ] }, "escape": { "match": "\\\\.", "name": "constant.character.escape.backslash.restructuredtext" }, "uri": { "name": "string.other.uri.restructuredtext", "match": "\\S+", "captures": { "0": { "name": "markup.link.underline.restructuredtext" } } }, "length": { "name": "constant.numeric.length.restructuredtext", "match": "[\\d.]+\\s*(?i:(em|ex|px|in|cm|mm|pt|pc)|(%))?", "captures": { "1": { "name": "keyword.other.${1:/downcase}-unit.restructuredtext" }, "2": { "name": "keyword.other.percentile-unit.restructuredtext" } } }, "headings": { "name": "markup.heading.restructuredtext", "match": "^[-=~`#\"^+*:.'_]{3,}\\s*$", "captures": { "0": { "name": "punctuation.definition.heading.restructuredtext" } } }, "line-blocks": { "name": "meta.line-block.restructuredtext", "begin": "^(\\s*)(\\|)(?!.*?(?<=\\S)\\|)", "end": "^(?=\\s*$\\n?)", "beginCaptures": { "2": { "name": "punctuation.separator.line-block.restructuredtext" } }, "patterns": [ { "match": "^\\s*(\\|)", "captures": { "0": { "name": "punctuation.separator.line-block.restructuredtext" } } }, { "include": "#inlines" } ] }, "emphasis": { "patterns": [ { "name": "markup.bold.restructuredtext", "match": "(\\*\\*)[^\\*\\s][^*]*(\\*\\*)", "captures": { "1": { "name": "punctuation.definition.bold.restructuredtext" }, "2": { "name": "punctuation.definition.bold.restructuredtext" } } }, { "name": "markup.italic.restructuredtext", "match": "(?)(`_)", "captures": { "1": { "name": "punctuation.definition.link.restructuredtext" }, "2": { "name": "string.other.link.title.restructuredtext" }, "3": { "name": "punctuation.definition.location.restructuredtext" }, "4": { "name": "markup.underline.link.restructuredtext" }, "5": { "name": "punctuation.definition.location.restructuredtext" }, "6": { "name": "punctuation.definition.link.restructuredtext" } } }, "citations": { "patterns": [ { "name": "meta.link.citation.def.restructuredtext", "match": "^(\\.\\.)\\s+((\\[)[A-z][A-z0-9]*(\\]))(_)\\s+(.*)", "captures": { "1": { "name": "punctuation.definition.link.restructuredtext" }, "2": { "name": "constant.other.citation.link.restructuredtext" }, "3": { "name": "punctuation.definition.constant.restructuredtext" }, "4": { "name": "punctuation.definition.constant.restructuredtext" }, "5": { "name": "punctuation.definition.constant.restructuredtext" }, "6": { "name": "string.other.citation.restructuredtext" } } }, { "name": "meta.link.citation.restructuredtext", "match": "((\\[)[A-z][A-z0-9_-]*(\\]))(_)", "captures": { "1": { "name": "constant.other.citation.link.restructuredtext" }, "2": { "name": "punctuation.definition.constant.restructuredtext" }, "3": { "name": "punctuation.definition.constant.restructuredtext" }, "4": { "name": "punctuation.definition.constant.restructuredtext" } } } ] }, "comments": { "patterns": [ { "name": "comment.block.empty-start.double-dot.restructuredtext", "begin": "^(\\.\\.)[\\t ]*$\\n?", "end": "^(?<=\\G)\\s*$\\n?|^(?=\\S)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.restructuredtext" } }, "patterns": [ { "begin": "^(\\s+).*?\\S+\\s*$\\n", "end": "^\\s*$\\n|^(?=\\S)" } ] }, { "name": "comment.block.empty-start.double-dot.restructuredtext", "begin": "^([\\t ]*)(\\.\\.)[\\t ]*$\\n?", "end": "^(?!\\1\\s*\\S)|^(?>>)\\s+(.*)$\\n", "end": "^\\s*$|^(?=\\1>>> )|^(?=>>>)|^(?!\\1)\\s+\\S", "contentName": "markup.raw.restructuredtext", "beginCaptures": { "2": { "name": "punctuation.separator.prompt.doctest.restructuredtext" }, "3": { "patterns": [ { "include": "source.python" } ] } } }, "tables": { "patterns": [ { "name": "meta.table.grid-table.restructuredtext", "contentName": "markup.other.table.restructuredtext", "begin": "(?=((\\+-[+-]+))|((\\+=[+=]+))\\s*$)", "end": "^\\s*$", "patterns": [ { "include": "#table-borders" }, { "include": "#inlines" } ] }, { "name": "punctuation.definition.table.simple-divider.restructuredtext", "match": "(?x)\n^\\s*-{2,}\\s+-{2,}(?:\\s+-{2,})*\\s*$\n|\n^\\s*={2,}\\s+={2,}(?:\\s+={2,})*\\s*$" } ] }, "table-borders": { "patterns": [ { "begin": "\\+(?=-+(?=\\+|$))", "end": "(?=\\+(?=-)|$)|\\+(?=\\s|$)", "contentName": "punctuation.definition.table.row-divider.restructuredtext", "beginCaptures": { "0": { "name": "punctuation.definition.table.joint.restructuredtext" } }, "endCaptures": { "0": { "name": "punctuation.definition.table.joint.restructuredtext" } } }, { "begin": "\\+(?==+(?=\\+|$))", "end": "(?=\\+(?==)|$)|\\+\\s*$", "contentName": "punctuation.definition.table.header.row-divider.restructuredtext", "beginCaptures": { "0": { "name": "punctuation.definition.table.joint.restructuredtext" } }, "endCaptures": { "0": { "name": "punctuation.definition.table.joint.restructuredtext" } } }, { "match": "\\|", "name": "punctuation.definition.table.header.column-divider.restructuredtext" } ] }, "tag-name": { "name": "entity.name.tag.restructuredtext", "match": "(:)[A-Za-z][\\w\\s=.]*(:)", "captures": { "1": { "name": "punctuation.definition.field.restructuredtext" }, "2": { "name": "punctuation.definition.field.restructuredtext" } } }, "substitution": { "name": "support.variable.substitution.restructuredtext", "match": "(?