@excom/nucleus-quark-highlighter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/chunked-rush-logs/nucleus-quark-highlighter.apply-exports.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/nucleus-quark-highlighter.build_package-metas.chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/all.log +1 -0
- package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/state.json +3 -0
- package/.rush/temp/operation/build_package-metas/all.log +1 -0
- package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_package-metas/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +31 -0
- package/.vscodeignore +10 -0
- package/LICENSE.md +1 -0
- package/icons/marketplace-icon.png +0 -0
- package/icons/marketplace-icon.svg +6 -0
- package/icons/quark-file.svg +3 -0
- package/package.json +127 -0
- package/quark.configuration.json +35 -0
- package/rush-logs/nucleus-quark-highlighter.apply-exports.cache.log +1 -0
- package/rush-logs/nucleus-quark-highlighter.apply-exports.log +1 -0
- package/rush-logs/nucleus-quark-highlighter.build_package-metas.cache.log +1 -0
- package/rush-logs/nucleus-quark-highlighter.build_package-metas.log +1 -0
- package/scripts/build-extension.mjs +24 -0
- package/scripts/package-vsix.mjs +53 -0
- package/shiki.mjs +35 -0
- package/src/extension.ts +107 -0
- package/support/docs/README.md +76 -0
- package/support/package-meta.json +44 -0
- package/syntaxes/html-custom-elements.tmLanguage.json +82 -0
- package/syntaxes/quark.tmLanguage.json +1454 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shortName": "nucleus-quark-highlighter",
|
|
3
|
+
"package": {
|
|
4
|
+
"name": "@excom/nucleus-quark-highlighter",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "VS Code syntax highlighting for Quark sheets and Nucleus-style HTML",
|
|
7
|
+
"peerDependencies": {},
|
|
8
|
+
"excom": {
|
|
9
|
+
"packageType": "tool"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
"./shiki": "./shiki.mjs",
|
|
13
|
+
"./syntaxes/*": "./syntaxes/*"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"demos": {},
|
|
17
|
+
"readme": "<h1 id=\"md-nucleus-quark-highlighter\">nucleus-quark-highlighter</h1>\n<p>Quark sheets and Nucleus-style HTML, highlighted and formatted in VS Code / Cursor — the same grammar that colors every code block on this site.</p>\n<p>The <strong>Nucleus & Quark Syntax Highlighter</strong> extension adds a Quark language for <code>.quark</code> files, highlights Quark inside <code><quark-sheet></code> in HTML, and gives custom elements and dashed attributes their own color so Adapters and their state stand apart from native markup. Tags, custom tags, attributes and custom attributes share one palette in both grammars, so a sheet and the markup it orchestrates read the same way.</p>\n<include-content data-language=\"html\"><template><provider-fetch src-url=\"/api/todos\" should-fetch>\n <ul></ul>\n <quark-sheet>\n provider-fetch[is-success] {\n $todos: prop(\"provision\").body;\n ul { content: iterate($todos); }\n }\n </quark-sheet>\n</provider-fetch></template></include-content>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Quark language</strong> <code>.quark</code> files with CSS-familiar highlighting, folding, bracket matching and <code>/* */</code> comments; Quark's at-rules — <code>@use</code>, <code>@scope</code>, <code>@on</code> with its event list, <code>@dispatch</code> / <code>@command</code>, <code>@view-transition</code>, <code>@delay</code>, <code>@warn</code> / <code>@debug</code> / <code>@error</code> — color their names, options groups, durations, messages and blocks</li>\n<li><strong>Quark's language, nothing else</strong> Quark is not SCSS and not a CSS superset: every other at-rule (<code>@media</code>, <code>@mixin</code>, <code>@if</code>, <code>@keyframes</code>, …) and <code>%placeholder</code> selectors are colored as errors, because Quark's parser rejects them</li>\n<li><strong>Inline sheets</strong> Quark inside <code><quark-sheet></code> in HTML is highlighted as Quark</li>\n<li><strong>Custom elements stand out</strong> Dashed tags / dashed attributes get their own color in HTML and in Quark selectors; a dashed tag keeps that color wherever it appears in a selector — attribute-qualified, inside <code>:is()</code> / <code>:not()</code> / <code>:has()</code>, or before a pseudo-class or pseudo-element</li>\n<li><strong>Format Document</strong> <code>.quark</code> files format with <code>@excom/quark-formatter</code> (<code>Shift+Alt+F</code>)</li>\n<li><strong>Format inline sheets</strong> <code>Quark: Format <quark-sheet> blocks</code> formats every sheet in the open HTML file</li>\n<li><strong>File icon</strong> <code>.quark</code> files carry the Quark icon in the explorer and tabs</li>\n<li><strong>Shiki grammar</strong> <code>@excom/nucleus-quark-highlighter/shiki</code> highlights Quark / Nucleus HTML in docs and static sites</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p>Install <strong>Nucleus & Quark Syntax Highlighter</strong> from the editor's Extensions view, or from the registries directly:</p>\n<ul>\n<li><strong>VS Code</strong> — <a href=\"https://marketplace.visualstudio.com/items?itemName=excom-dev.nucleus-quark-highlighter\">Visual Studio Marketplace</a>, or <code>ext install excom-dev.nucleus-quark-highlighter</code> in Quick Open</li>\n<li><strong>Cursor / VSCodium / Windsurf</strong> — <a href=\"https://open-vsx.org/extension/excom-dev/nucleus-quark-highlighter\">Open VSX</a></li>\n</ul>\n<p>To install a build by hand, download <code>nucleus-quark-highlighter-<version>.vsix</code> from the <a href=\"https://github.com/excom-dev/nucleus/releases\">GitHub releases</a> and run <code>code --install-extension <file></code> (<code>cursor --install-extension</code> in Cursor).</p>\n<p>For docs sites and build tooling the grammar is also on npm:</p>\n<include-content data-language=\"bash\"><template>npm install @excom/nucleus-quark-highlighter</template></include-content>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Open a <code>.quark</code> file and the language mode is <strong>Quark</strong>. Open any HTML file and <code><quark-sheet></code> bodies, custom elements and dashed attributes are colored without further setup.</p>\n<h3 id=\"md-formatting\">Formatting</h3>\n<ul>\n<li><strong><code>.quark</code> files</strong> — Format Document (<code>Shift+Alt+F</code>, or format-on-save) reformats the whole file</li>\n<li><strong>Inline sheets in HTML</strong> — run <strong>Quark: Format <code><quark-sheet></code> blocks</strong> from the Command Palette; every sheet body in the active file is formatted and re-indented one level past its tag</li>\n</ul>\n<p>Inline sheets need the command because VS Code's HTML formatter only formats the <code><style></code> / <code><script></code> bodies it knows about and offers no hook for custom tags. A sheet that does not parse is left untouched and the reason appears in the status bar.</p>\n<h3 id=\"md-shortcuts\">Shortcuts</h3>\n<p><code>Cmd+/</code> (<code>Ctrl+/</code>) and <code>Shift+Alt+A</code> both toggle <code>/* */</code> comments — Quark has no <code>//</code> line comments, so a sheet stays tokenizable by a CSS engine.</p>\n<h3 id=\"md-highlighting-with-shiki\">Highlighting with Shiki</h3>\n<p>The extension's TextMate grammars are exported for <a href=\"https://shiki.style\">Shiki</a>:</p>\n<include-content data-language=\"js\"><template>import { createHighlighter } from \"shiki\";\nimport { shikiLangs } from \"@excom/nucleus-quark-highlighter/shiki\";\n\nconst highlighter = await createHighlighter({\n themes: [\"github-light\", \"github-dark\"],\n langs: [\"html\", \"css\", ...shikiLangs],\n});\n\nhighlighter.codeToHtml(source, { lang: \"quark\", theme: \"github-dark\" });</template></include-content>\n<p><code>quark</code> highlights standalone sheets. <code>html-custom-elements</code> is an injection: once registered, every <code>html</code> block gets custom-element / dashed-attribute coloring and Quark highlighting inside <code><quark-sheet></code>. Load <code>css</code> alongside them; the Quark grammar embeds it.</p>\n",
|
|
18
|
+
"docs": {
|
|
19
|
+
"readme": "<h1 id=\"md-nucleus-quark-highlighter\">nucleus-quark-highlighter</h1>\n<p>Quark sheets and Nucleus-style HTML, highlighted and formatted in VS Code / Cursor — the same grammar that colors every code block on this site.</p>\n<p>The <strong>Nucleus & Quark Syntax Highlighter</strong> extension adds a Quark language for <code>.quark</code> files, highlights Quark inside <code><quark-sheet></code> in HTML, and gives custom elements and dashed attributes their own color so Adapters and their state stand apart from native markup. Tags, custom tags, attributes and custom attributes share one palette in both grammars, so a sheet and the markup it orchestrates read the same way.</p>\n<include-content data-language=\"html\"><template><provider-fetch src-url=\"/api/todos\" should-fetch>\n <ul></ul>\n <quark-sheet>\n provider-fetch[is-success] {\n $todos: prop(\"provision\").body;\n ul { content: iterate($todos); }\n }\n </quark-sheet>\n</provider-fetch></template></include-content>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Quark language</strong> <code>.quark</code> files with CSS-familiar highlighting, folding, bracket matching and <code>/* */</code> comments; Quark's at-rules — <code>@use</code>, <code>@scope</code>, <code>@on</code> with its event list, <code>@dispatch</code> / <code>@command</code>, <code>@view-transition</code>, <code>@delay</code>, <code>@warn</code> / <code>@debug</code> / <code>@error</code> — color their names, options groups, durations, messages and blocks</li>\n<li><strong>Quark's language, nothing else</strong> Quark is not SCSS and not a CSS superset: every other at-rule (<code>@media</code>, <code>@mixin</code>, <code>@if</code>, <code>@keyframes</code>, …) and <code>%placeholder</code> selectors are colored as errors, because Quark's parser rejects them</li>\n<li><strong>Inline sheets</strong> Quark inside <code><quark-sheet></code> in HTML is highlighted as Quark</li>\n<li><strong>Custom elements stand out</strong> Dashed tags / dashed attributes get their own color in HTML and in Quark selectors; a dashed tag keeps that color wherever it appears in a selector — attribute-qualified, inside <code>:is()</code> / <code>:not()</code> / <code>:has()</code>, or before a pseudo-class or pseudo-element</li>\n<li><strong>Format Document</strong> <code>.quark</code> files format with <code>@excom/quark-formatter</code> (<code>Shift+Alt+F</code>)</li>\n<li><strong>Format inline sheets</strong> <code>Quark: Format <quark-sheet> blocks</code> formats every sheet in the open HTML file</li>\n<li><strong>File icon</strong> <code>.quark</code> files carry the Quark icon in the explorer and tabs</li>\n<li><strong>Shiki grammar</strong> <code>@excom/nucleus-quark-highlighter/shiki</code> highlights Quark / Nucleus HTML in docs and static sites</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p>Install <strong>Nucleus & Quark Syntax Highlighter</strong> from the editor's Extensions view, or from the registries directly:</p>\n<ul>\n<li><strong>VS Code</strong> — <a href=\"https://marketplace.visualstudio.com/items?itemName=excom-dev.nucleus-quark-highlighter\">Visual Studio Marketplace</a>, or <code>ext install excom-dev.nucleus-quark-highlighter</code> in Quick Open</li>\n<li><strong>Cursor / VSCodium / Windsurf</strong> — <a href=\"https://open-vsx.org/extension/excom-dev/nucleus-quark-highlighter\">Open VSX</a></li>\n</ul>\n<p>To install a build by hand, download <code>nucleus-quark-highlighter-<version>.vsix</code> from the <a href=\"https://github.com/excom-dev/nucleus/releases\">GitHub releases</a> and run <code>code --install-extension <file></code> (<code>cursor --install-extension</code> in Cursor).</p>\n<p>For docs sites and build tooling the grammar is also on npm:</p>\n<include-content data-language=\"bash\"><template>npm install @excom/nucleus-quark-highlighter</template></include-content>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Open a <code>.quark</code> file and the language mode is <strong>Quark</strong>. Open any HTML file and <code><quark-sheet></code> bodies, custom elements and dashed attributes are colored without further setup.</p>\n<h3 id=\"md-formatting\">Formatting</h3>\n<ul>\n<li><strong><code>.quark</code> files</strong> — Format Document (<code>Shift+Alt+F</code>, or format-on-save) reformats the whole file</li>\n<li><strong>Inline sheets in HTML</strong> — run <strong>Quark: Format <code><quark-sheet></code> blocks</strong> from the Command Palette; every sheet body in the active file is formatted and re-indented one level past its tag</li>\n</ul>\n<p>Inline sheets need the command because VS Code's HTML formatter only formats the <code><style></code> / <code><script></code> bodies it knows about and offers no hook for custom tags. A sheet that does not parse is left untouched and the reason appears in the status bar.</p>\n<h3 id=\"md-shortcuts\">Shortcuts</h3>\n<p><code>Cmd+/</code> (<code>Ctrl+/</code>) and <code>Shift+Alt+A</code> both toggle <code>/* */</code> comments — Quark has no <code>//</code> line comments, so a sheet stays tokenizable by a CSS engine.</p>\n<h3 id=\"md-highlighting-with-shiki\">Highlighting with Shiki</h3>\n<p>The extension's TextMate grammars are exported for <a href=\"https://shiki.style\">Shiki</a>:</p>\n<include-content data-language=\"js\"><template>import { createHighlighter } from \"shiki\";\nimport { shikiLangs } from \"@excom/nucleus-quark-highlighter/shiki\";\n\nconst highlighter = await createHighlighter({\n themes: [\"github-light\", \"github-dark\"],\n langs: [\"html\", \"css\", ...shikiLangs],\n});\n\nhighlighter.codeToHtml(source, { lang: \"quark\", theme: \"github-dark\" });</template></include-content>\n<p><code>quark</code> highlights standalone sheets. <code>html-custom-elements</code> is an injection: once registered, every <code>html</code> block gets custom-element / dashed-attribute coloring and Quark highlighting inside <code><quark-sheet></code>. Load <code>css</code> alongside them; the Quark grammar embeds it.</p>\n"
|
|
20
|
+
},
|
|
21
|
+
"installation": {
|
|
22
|
+
"name": "@excom/nucleus-quark-highlighter",
|
|
23
|
+
"shortName": "nucleus-quark-highlighter",
|
|
24
|
+
"version": "0.1.0",
|
|
25
|
+
"description": "VS Code syntax highlighting for Quark sheets and Nucleus-style HTML",
|
|
26
|
+
"packageType": "tool",
|
|
27
|
+
"install": {
|
|
28
|
+
"npm": "npm install @excom/nucleus-quark-highlighter"
|
|
29
|
+
},
|
|
30
|
+
"imports": {
|
|
31
|
+
"js": "import { /* … */ } from \"@excom/nucleus-quark-highlighter\";"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": []
|
|
34
|
+
},
|
|
35
|
+
"elementApis": [],
|
|
36
|
+
"exportedFiles": {
|
|
37
|
+
"./shiki": {
|
|
38
|
+
"default": "./shiki.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./syntaxes/*": {
|
|
41
|
+
"default": "./syntaxes/*"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeName": "injection.html.custom-elements",
|
|
3
|
+
"injectionSelector": "L:text.html.derivative -comment, L:text.html.basic -comment",
|
|
4
|
+
"patterns": [
|
|
5
|
+
{
|
|
6
|
+
"name": "meta.embedded.block.quark",
|
|
7
|
+
"begin": "(<)(quark-sheet)\\b([^>]*)(>)",
|
|
8
|
+
"beginCaptures": {
|
|
9
|
+
"1": { "name": "punctuation.definition.tag.begin.html" },
|
|
10
|
+
"2": { "name": "entity.name.class.custom-element.html" },
|
|
11
|
+
"3": {
|
|
12
|
+
"patterns": [
|
|
13
|
+
{ "include": "meta.tag.inline.custom-element.start.html" },
|
|
14
|
+
{ "include": "#custom-attribute-k-v" },
|
|
15
|
+
{ "include": "#custom-attribute-k" },
|
|
16
|
+
{ "include": "text.html.basic#attribute" }
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"4": { "name": "punctuation.definition.tag.end.html" }
|
|
20
|
+
},
|
|
21
|
+
"end": "(</)(quark-sheet)(>)",
|
|
22
|
+
"endCaptures": {
|
|
23
|
+
"1": { "name": "punctuation.definition.tag.begin.html" },
|
|
24
|
+
"2": { "name": "entity.name.class.custom-element.html" },
|
|
25
|
+
"3": { "name": "punctuation.definition.tag.end.html" }
|
|
26
|
+
},
|
|
27
|
+
"contentName": "source.quark",
|
|
28
|
+
"patterns": [{ "include": "source.quark" }]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "meta.tag.inline.custom-element",
|
|
32
|
+
"begin": "(?i)(<)(?!quark-sheet)([a-z0-9]+-[a-z0-9-]+)\\s*",
|
|
33
|
+
"beginCaptures": {
|
|
34
|
+
"1": { "name": "punctuation.definition.tag.begin.html" },
|
|
35
|
+
"2": { "name": "entity.name.class.custom-element.html" }
|
|
36
|
+
},
|
|
37
|
+
"end": "(>)",
|
|
38
|
+
"endCaptures": {
|
|
39
|
+
"1": { "name": "punctuation.definition.tag.end.html" }
|
|
40
|
+
},
|
|
41
|
+
"patterns": [
|
|
42
|
+
{ "include": "meta.tag.inline.custom-element.start.html" },
|
|
43
|
+
{ "include": "#custom-attribute-k-v" },
|
|
44
|
+
{ "include": "#custom-attribute-k" },
|
|
45
|
+
{ "include": "text.html.basic#attribute" }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"match": "(?i)((</)(?!quark-sheet)([a-z0-9]+-[a-z0-9-]+)\\b(>))",
|
|
50
|
+
"captures": {
|
|
51
|
+
"1": { "name": "meta.tag.inline.custom-element.end.html" },
|
|
52
|
+
"2": { "name": "punctuation.definition.tag.begin.html" },
|
|
53
|
+
"3": { "name": "entity.name.class.custom-element.html" },
|
|
54
|
+
"4": { "name": "punctuation.definition.tag.end.html" }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"repository": {
|
|
59
|
+
"custom-attribute-k-v": {
|
|
60
|
+
"name": "entity.other.attribute-name.custom-attribute-k-v.html",
|
|
61
|
+
"begin": "([a-zA-Z0-9]+-[a-zA-Z0-9-]*)(?==)",
|
|
62
|
+
"beginCaptures": {
|
|
63
|
+
"1": { "name": "variable.other.constant.attribute-name.custom-attribute.html" }
|
|
64
|
+
},
|
|
65
|
+
"end": "((=)(\"[^\"]*\"|'[^']*'))",
|
|
66
|
+
"endCaptures": {
|
|
67
|
+
"1": { "name": "meta.attribute.html" },
|
|
68
|
+
"2": { "name": "punctuation.separator.key-value.html" },
|
|
69
|
+
"3": { "name": "keyword.operator.quantifier.regexp.custom-attribute.html" }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"custom-attribute-k": {
|
|
73
|
+
"name": "entity.other.attribute-name.custom-attribute-k.html",
|
|
74
|
+
"begin": "([a-zA-Z0-9]+-[a-zA-Z0-9-]*)(?=\\s|>)",
|
|
75
|
+
"beginCaptures": {
|
|
76
|
+
"1": { "name": "variable.other.constant.attribute-name.custom-attribute.html" }
|
|
77
|
+
},
|
|
78
|
+
"end": "\\b"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"uuid": "custom-elements-highlighter"
|
|
82
|
+
}
|