|
| 1 | +%YAML 1.2 |
| 2 | +--- |
| 3 | +# http://www.sublimetext.com/docs/3/syntax.html |
| 4 | +name: Zettelkasten-Results |
| 5 | +file_extensions: |
| 6 | + - md |
| 7 | + - mdown |
| 8 | + - markdown |
| 9 | + - markdn |
| 10 | +scope: text.html.markdown.multimarkdown.custom |
| 11 | +contexts: |
| 12 | + main: |
| 13 | + - match: (?=(?<!\s)---(\s*coffee|\s*json)?\n$) |
| 14 | + push: front-matter |
| 15 | + - match: "" |
| 16 | + set: body |
| 17 | + front-matter: |
| 18 | + - match: ^\s*---\s*$ |
| 19 | + with_prototype: |
| 20 | + - include: scope:source.yaml#prototype |
| 21 | + push: |
| 22 | + - meta_scope: markup.raw.yaml.front-matter |
| 23 | + - meta_content_scope: source.yaml |
| 24 | + - match: ^\s*---\s* |
| 25 | + pop: true |
| 26 | + - include: scope:source.yaml |
| 27 | + - match: ^\s*---\s*coffee\s*$ |
| 28 | + push: |
| 29 | + - meta_scope: markup.raw.coffee.front-matter |
| 30 | + - meta_content_scope: source.coffee |
| 31 | + - match: ^\s*---\s* |
| 32 | + pop: true |
| 33 | + - include: scope:source.coffee |
| 34 | + - match: ^\s*---\s*json\s*$ |
| 35 | + push: |
| 36 | + - meta_scope: markup.raw.json.front-matter |
| 37 | + - meta_content_scope: source.json |
| 38 | + - match: ^\s*---\s* |
| 39 | + pop: true |
| 40 | + - include: scope:source.json |
| 41 | + - match: "" |
| 42 | + pop: true |
| 43 | + set: body |
| 44 | + body: |
| 45 | + - match: |- |
| 46 | + (?x)^ |
| 47 | + (?= [ ]{,3}>. |
| 48 | + | ([ ]{4}|\t)(?!$) |
| 49 | + | [#]{1,6}\s*+ |
| 50 | + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ |
| 51 | + ) |
| 52 | + comment: | |
| 53 | + We could also use an empty end match and set |
| 54 | + applyEndPatternLast, but then we must be sure that the begin |
| 55 | + pattern will only match stuff matched by the sub-patterns. |
| 56 | + push: |
| 57 | + - meta_scope: meta.block-level.markdown |
| 58 | + - match: |- |
| 59 | + (?x)^ |
| 60 | + (?! [ ]{,3}>. |
| 61 | + | ([ ]{4}|\t) |
| 62 | + | [#]{1,6}\s*+ |
| 63 | + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ |
| 64 | + ) |
| 65 | + pop: true |
| 66 | + - include: block_quote |
| 67 | + - include: block_raw |
| 68 | + - include: heading |
| 69 | + - include: separator |
| 70 | + - match: '' |
| 71 | + push: scope:text.html.markdown.multimarkdown |
| 72 | + with_prototype: |
| 73 | + # [^footnotes] |
| 74 | + - match: '(\[)(\^)([^]]*)(\])' |
| 75 | + captures: |
| 76 | + '1': punctuation.definition.footnote.begin.markdown |
| 77 | + '2': support.function.footnote.markdown |
| 78 | + '3': support.function.footnote.markdown |
| 79 | + '4': punctuation.definition.footnote.begin.markdown |
| 80 | + # [#key]: values , ... for autobib insertion mmd style |
| 81 | + - match: '(\[)(#)([^]]*)(\])(:)([ ]*)(.*)' |
| 82 | + captures: |
| 83 | + '1': punctuation.definition.constant.markdown |
| 84 | + '2': constant.other.reference.link.markdown |
| 85 | + '3': constant.other.reference.link.markdown |
| 86 | + '4': punctuation.definition.constant.markdown |
| 87 | + '5': punctuation.separator.key-value.markdown |
| 88 | + '6': meta.link.reference.def.markdown |
| 89 | + '7': markup.underline.link.markdown |
| 90 | + # [@pandoc] and [see @pandoc] |
| 91 | + - match: '(\[[a-zA-Z:\. ]*)(@)([^]]*)(\])' |
| 92 | + captures: |
| 93 | + '1': punctuation.definition.footnote.begin.markdown |
| 94 | + '2': constant.other.reference.link.markdown |
| 95 | + '3': constant.other.reference.link.markdown |
| 96 | + '4': punctuation.definition.footnote.begin.markdown |
| 97 | + - match: '([\s]+|^)(@)([\S]+)' |
| 98 | + captures: |
| 99 | + '1': text.html.markdown.multimarkdown.custom |
| 100 | + '2': constant.other.reference.link.markdown |
| 101 | + '3': constant.other.reference.link.markdown |
| 102 | + # all sorts of #tags |
| 103 | + - match: '(\s)(#+([^#\W]|[-§]|:[a-zA-Z0-9])+)' # better real just tags matching |
| 104 | + captures: |
| 105 | + '1': markup.zettel.space |
| 106 | + '2': markup.zettel.tag markup.italic |
| 107 | + # a [201701010202] note link |
| 108 | + - match: '([\[]?\[)([0-9.]{12,18})([^]]*)(\][\]]?)' |
| 109 | + captures: |
| 110 | + '1': punctuation.definition.footnote.begin.markdown |
| 111 | + '2': markup.zettel.link |
| 112 | + '3': markup.zettel.linktitle #constant.other.reference.link.markdown |
| 113 | + '4': punctuation.definition.footnote.begin.markdown |
| 114 | + # olds school §201701010202 note link |
| 115 | + - match: '(§)([0-9]{12,14})' |
| 116 | + captures: |
| 117 | + '1': punctuation.definition.footnote.begin.markdown |
| 118 | + '2': markup.zettel.link |
| 119 | + # todo |
| 120 | + - match: '(?i)(todo:)' |
| 121 | + captures: |
| 122 | + '1': string.unquoted.plain.out.yaml |
| 123 | + # image links {attrs} |
| 124 | + - match: '(!\[)(.*)(\])(\()(.*)(\))(\{)?([^\}]*)(\})?' |
| 125 | + captures: |
| 126 | + '1': meta.image.inline.markdown punctuation.definition.image.begin.markdown |
| 127 | + '2': meta.image.inline.description.markdown |
| 128 | + '3': meta.image.inline.markdown punctuation.definition.image.end.markdown |
| 129 | + '4': meta.image.inline.markdown punctuation.definition.metadata.begin.markdown |
| 130 | + '5': meta.image.inline.markdown markup.underline.link.image.markdown |
| 131 | + '6': meta.image.inline.markdown punctuation.definition.metadata.end.markdown |
| 132 | + '7': meta.image.inline.markdown punctuation.definition.imageattr.begin.markdown |
| 133 | + '8': meta.image.inline.markdown.imageattr |
| 134 | + '9': meta.image.inline.markdown punctuation.definition.imageattr.end.markdown |
| 135 | + |
0 commit comments