{"_id":"@calpano/ddot-prismjs","_rev":"2-04a76db6aa8b13024c407e53fa54f03f","name":"@calpano/ddot-prismjs","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@calpano/ddot-prismjs","version":"0.1.0","keywords":["ddot.it","prismjs","prism","syntax-highlighting","knowledge-graph"],"license":"MIT","_id":"@calpano/ddot-prismjs@0.1.0","maintainers":[{"name":"xamde","email":"support@calpano.com"}],"homepage":"https://ddot.it","bugs":{"url":"https://github.com/Calpano/ddot.it-syntax-tools/issues"},"dist":{"shasum":"766e4ac2263f79fce946eb3c644fb682079b48c7","tarball":"https://registry.npmjs.org/@calpano/ddot-prismjs/-/ddot-prismjs-0.1.0.tgz","fileCount":3,"integrity":"sha512-30KeWuncs4Wv40oZTfL/VZCgjsMHKHvxIlQ4tcZqsQq7ZR0RRijVXbfiKdCA1F4oD9K2+lA+Ip4BJVv3PfHEnQ==","signatures":[{"sig":"MEYCIQCoErhrvLwaWfGoOuXfA9Y7P3jTJinjTtVy1HDH7FzmIAIhAJoR32Rgc7ItJhgJjwdzGUbHE0VLteXWLvru5f3A/Q+Z","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8463},"main":"./index.js","type":"module","exports":{".":"./index.js"},"gitHead":"2bb1bd28555bb0d500e347f3d83a04707985b33c","_npmUser":{"name":"xamde","email":"support@calpano.com"},"repository":{"url":"git+https://github.com/Calpano/ddot.it-syntax-tools.git","type":"git","directory":"prismjs"},"_npmVersion":"11.12.1","description":"Prism.js language definition for ddot.it (Knowledge Graph Notation).","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"prismjs":">=1.27.0"},"_npmOperationalInternal":{"tmp":"tmp/ddot-prismjs_0.1.0_1778233798266_0.21269656630010259","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@calpano/ddot-prismjs","version":"0.1.1","description":"Prism.js language definition for ddot.it (Knowledge Graph Notation).","license":"MIT","type":"module","main":"./index.js","exports":{".":"./index.js"},"keywords":["ddot.it","prismjs","prism","syntax-highlighting","knowledge-graph"],"peerDependencies":{"prismjs":">=1.27.0"},"repository":{"type":"git","url":"git+https://github.com/Calpano/ddot.it-syntax-tools.git","directory":"prismjs"},"homepage":"https://ddot.it","publishConfig":{"access":"public"},"gitHead":"4ebb5bb2eb2965add6f8a690a48a8ad938119966","_id":"@calpano/ddot-prismjs@0.1.1","bugs":{"url":"https://github.com/Calpano/ddot.it-syntax-tools/issues"},"_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-h5jq+/nDzeKKT43g5T5Dpu8Md0j/XYzMr5I9NtnqyGNxuwkxpdk+1z+w/IDP4afKAYGwOgCD6EYeYdv5E6eTug==","shasum":"27114e172840264cc377f83624c7ed200344a68e","tarball":"https://registry.npmjs.org/@calpano/ddot-prismjs/-/ddot-prismjs-0.1.1.tgz","fileCount":3,"unpackedSize":8463,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@calpano%2fddot-prismjs@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFDE4SE64BRytr6OPvoPB7YKGbIn90OjCzfa+k0JjuGJAiBGdV4fWTILGOQkUUWmTgp8F0MZJE/ZjOZ3a7Sdkh3GyA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:166491d8-08cb-4191-b5fd-9b9e14426950"}},"directories":{},"maintainers":[{"name":"xamde","email":"support@calpano.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ddot-prismjs_0.1.1_1778311038789_0.9875862039804979"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-08T09:49:58.103Z","modified":"2026-05-09T07:17:19.199Z","0.1.0":"2026-05-08T09:49:58.407Z","0.1.1":"2026-05-09T07:17:18.921Z"},"bugs":{"url":"https://github.com/Calpano/ddot.it-syntax-tools/issues"},"license":"MIT","homepage":"https://ddot.it","keywords":["ddot.it","prismjs","prism","syntax-highlighting","knowledge-graph"],"repository":{"type":"git","url":"git+https://github.com/Calpano/ddot.it-syntax-tools.git","directory":"prismjs"},"description":"Prism.js language definition for ddot.it (Knowledge Graph Notation).","maintainers":[{"name":"xamde","email":"support@calpano.com"}],"readme":"# @calpano/ddot-prismjs\n\n[Prism.js](https://prismjs.com) language definition for **ddot.it** —\na minimal text format for typed knowledge graphs.\n\n## Install\n\n```sh\nnpm install @calpano/ddot-prismjs prismjs\n```\n\n`prismjs` is a peer dependency.\n\n## Use\n\n```js\nimport Prism from 'prismjs';\nimport '@calpano/ddot-prismjs';   // side-effect: registers the language\n\nconst html = Prism.highlight(code, Prism.languages['ddot.it'], 'ddot.it');\n```\n\nAliases registered: `ddot.it`, `ddot`, `ddotit`.\n\n## Theme styling\n\nPrism's stock themes don't know about ddot scopes. Add CSS for:\n`.token.subject`, `.token.relation`, `.token.object`, `.token.operator`,\n`.token.command`, `.token.meta-delim`, `.token.meta-operator`,\n`.token.meta-relation`, `.token.meta-object`, `.token.meta-text`,\n`.token.disabled`.\n\n## Conformance\n\nVerified against the cross-implementation golden corpus — identical to\nthe TextMate, Shiki, Pygments, Chroma, Rouge, and highlight.js ports. See\n[`tools/conformance-prismjs.mjs`](https://github.com/Calpano/ddot.it-syntax-tools/blob/main/tools/conformance-prismjs.mjs).\n\n```sh\nnpm run conformance:prismjs\n```\n\n## Implementation note\n\nPrism's tokenizer applies patterns in priority order, splitting the\nremaining un-tokenized text as it goes. `inside` patterns can't reach\nacross already-tokenized chunks, so subject/relation/object slot\ndetection couldn't use the obvious \"match operator first, then look at\nthe gaps\" approach.\n\nThe lexer instead does everything at the **top level** with Prism's\n`lookbehind: true` mechanism. The first capture group of each slot\npattern absorbs the preceding `..` (or `^[ \\t]*` for subject) — Prism\nstrips it from the token but **leaves it in the residual text** for the\nlater `operator` pattern to claim. Slot patterns therefore run BEFORE\n`operator` so their lookbehind can see the `..` markers; `operator`\nmops them up afterwards.\n\nMulti-line regions (off-on span, free-form `,,…,,`, typed-meta region)\nare matched at the very top with their own `inside` grammars. The\ntyped-meta region is anchored to body lines starting with `..`, so the\nopener line (a normal triple ending in `,,`) is left for the top-level\nslot patterns to handle — this is what keeps the opener's operators\nscoped as `operator` instead of `meta-operator`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}