| 1 | { |
| 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| 3 | "name": "DLM", |
| 4 | "scopeName": "text.dlm", |
| 5 | "patterns": [ |
| 6 | { "include": "#frontmatter" }, |
| 7 | { "include": "#body" } |
| 8 | ], |
| 9 | "repository": { |
| 10 | "frontmatter": { |
| 11 | "begin": "\\A(---)\\s*$", |
| 12 | "end": "^(---)\\s*$", |
| 13 | "beginCaptures": { "1": { "name": "punctuation.definition.frontmatter.begin.dlm" } }, |
| 14 | "endCaptures": { "1": { "name": "punctuation.definition.frontmatter.end.dlm" } }, |
| 15 | "name": "meta.frontmatter.dlm", |
| 16 | "contentName": "source.yaml", |
| 17 | "patterns": [ |
| 18 | { "include": "#frontmatter-keys" }, |
| 19 | { "include": "source.yaml" } |
| 20 | ] |
| 21 | }, |
| 22 | "frontmatter-keys": { |
| 23 | "patterns": [ |
| 24 | { |
| 25 | "match": "^\\s*(dlm_id|dlm_version|base_model)\\s*:", |
| 26 | "captures": { "1": { "name": "keyword.other.dlm.frontmatter-key" } } |
| 27 | }, |
| 28 | { |
| 29 | "match": "^\\s*(training|export|system_prompt)\\s*:", |
| 30 | "captures": { "1": { "name": "entity.name.tag.dlm.frontmatter-block" } } |
| 31 | } |
| 32 | ] |
| 33 | }, |
| 34 | "body": { |
| 35 | "patterns": [ |
| 36 | { "include": "#section-fence-instruction" }, |
| 37 | { "include": "#section-fence-preference" }, |
| 38 | { "include": "#section-fence-media" }, |
| 39 | { "include": "#dlm-metadata-comment" }, |
| 40 | { "include": "#qa-headers" }, |
| 41 | { "include": "#preference-headers" }, |
| 42 | { "include": "text.html.markdown" } |
| 43 | ] |
| 44 | }, |
| 45 | "section-fence-instruction": { |
| 46 | "match": "^(::instruction(?:#\\w+)?::)\\s*$", |
| 47 | "captures": { "1": { "name": "keyword.control.fence.instruction.dlm" } } |
| 48 | }, |
| 49 | "section-fence-preference": { |
| 50 | "match": "^(::preference(?:#\\w+)?::)\\s*$", |
| 51 | "captures": { "1": { "name": "keyword.control.fence.preference.dlm" } } |
| 52 | }, |
| 53 | "section-fence-media": { |
| 54 | "match": "^(::(image|audio)\\s+[^:]*::)\\s*$", |
| 55 | "captures": { |
| 56 | "1": { "name": "keyword.control.fence.media.dlm" }, |
| 57 | "2": { "name": "entity.name.type.dlm.media-type" } |
| 58 | } |
| 59 | }, |
| 60 | "dlm-metadata-comment": { |
| 61 | "match": "^(<!--\\s*dlm-auto-(?:harvest|mined|synth):.+-->)\\s*$", |
| 62 | "captures": { "1": { "name": "comment.block.dlm.metadata" } } |
| 63 | }, |
| 64 | "qa-headers": { |
| 65 | "match": "^(###\\s+[QA])\\s*$", |
| 66 | "captures": { "1": { "name": "markup.heading.qa.dlm" } } |
| 67 | }, |
| 68 | "preference-headers": { |
| 69 | "match": "^(###\\s+(?:Prompt|Chosen|Rejected))\\s*$", |
| 70 | "captures": { "1": { "name": "markup.heading.preference.dlm" } } |
| 71 | } |
| 72 | } |
| 73 | } |