Compare commits

...

2 Commits

Author SHA1 Message Date
Jak2k (Moved to Codeberg.org) 4ed74de021
add iocaine to "Used By" (#59) 2026-03-23 13:58:05 -07:00
Bram Gotink 18c0ab8f3e
Bump kdl parser (#60)
Simplifies error handling.

Incidentally fixes kdl-org/kdl#558
2026-03-23 13:38:55 -07:00
4 changed files with 16 additions and 35 deletions

8
package-lock.json generated
View File

@ -11,7 +11,7 @@
"devDependencies": {
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-plugin-vite": "^6.0.0-alpha.3",
"@bgotink/kdl": "^0.3.1",
"@bgotink/kdl": "^0.4.0",
"@parcel/packager-raw-url": "^2.13.3",
"@parcel/transformer-webmanifest": "^2.13.3",
"@tailwindcss/typography": "^0.3.1",
@ -339,9 +339,9 @@
}
},
"node_modules/@bgotink/kdl": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/@bgotink/kdl/-/kdl-0.3.1.tgz",
"integrity": "sha512-EQQpjS3RiYNlUymAeO06WUrphzSdmbXzQrJ4s8JAr0Ft5WE67s23i5JaulZ3BO0yHA4tMkUT2cHWEgAq5iJC8Q==",
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@bgotink/kdl/-/kdl-0.4.0.tgz",
"integrity": "sha512-F0uJCjo5FQvFdcGF5QbYVNfcGiRWlocuzyIdQxottZF2+gu6L2xjMGEu9PIpse2hifAca/19vIospgaETCKxIg==",
"dev": true,
"license": "MIT"
},

View File

@ -26,7 +26,7 @@
"shiki": "^1.24.2",
"svgo": "^3.3.2",
"tailwindcss": "^2.0.2",
"@bgotink/kdl": "^0.3.1",
"@bgotink/kdl": "^0.4.0",
"monaco-editor": "^0.52.0",
"monaco-themes": "^0.4.4"
},

View File

@ -103,6 +103,7 @@ of some examples of KDL in the wild (either v1, v2, or both):
* [Niri](https://github.com/YaLTeR/niri) - Scrollable-tiling window manager for Wayland
* [Bikeshed](https://github.com/speced/bikeshed) ([here](https://github.com/speced/bikeshed-boilerplate/blob/main/boilerplate/doctypes.kdl) and [here](https://github.com/speced/bikeshed-data/blob/main/data/manifest.txt)) - Specification pre-processor used by CSS, C++, WHATWG, various W3C working groups, and others.
* [orogene](https://orogene.dev) - Lightning-fast JavaScript package manager
* [Iocaine](https://iocaine.madhouse-project.org/) - A software that protects your website from "AI" by poisoning it with garbage.
* [Onyx](https://onyxlang.io/) - An efficient, procedural, and pragmatic programming language that compiles to WASM. Used for package manifests.
* [Pop!_OS/System76 Scheduler](https://github.com/pop-os/system76-scheduler) - Scheduling service which optimizes Linux's CPU scheduler and makes it go faster.
* [ImStyle](https://patitotective.github.io/ImStyle/) - ImGui application styling with Nim and KDL

View File

@ -110,38 +110,18 @@ addEventListener("DOMContentLoaded", (event) => {
document.nodes.forEach(node => {
output.append(buildNodeTree(node))
})
} catch (error) {
output.classList.add('error')
if (error instanceof KDL.InvalidKdlError) {
markers.push({
message: error.message,
severity: monaco.MarkerSeverity.Error,
startLineNumber: error.start?.line,
startColumn: error.start?.column,
endLineNumber: error.end?.line,
endColumn: error.end?.column,
})
} else if (typeof AggregateError === 'function' && error instanceof AggregateError) {
for (const suberror of error.errors) {
if (suberror instanceof KDL.InvalidKdlError) {
markers.push({
message: suberror.message,
severity: monaco.MarkerSeverity.Error,
startLineNumber: suberror.start?.line,
startColumn: suberror.start?.column,
endLineNumber: suberror.end?.line,
endColumn: suberror.end?.column,
})
} else {
console.error(suberror);
markers.push({
message: "Failed to parse KDL",
severity: monaco.MarkerSeverity.Error,
startLineNumber: 1,
startColumn: 1,
})
}
for (const detail of error.flat()) {
markers.push({
message: detail.message,
severity: monaco.MarkerSeverity.Error,
startLineNumber: detail.start?.line,
startColumn: detail.start?.column,
endLineNumber: detail.end?.line,
endColumn: detail.end?.column,
})
}
} else {
console.error(error)
@ -159,4 +139,4 @@ addEventListener("DOMContentLoaded", (event) => {
model.onDidChangeContent(parse)
parse()
})
})