{"_id":"@boundaryml/baml-highlightjs","_rev":"2-766cff649aab72a1a4166f521e0e6c6e","name":"@boundaryml/baml-highlightjs","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@boundaryml/baml-highlightjs","version":"0.1.0","keywords":["baml","highlight.js","highlightjs","hljs","syntax-highlighting","language"],"license":"Apache-2.0","_id":"@boundaryml/baml-highlightjs@0.1.0","maintainers":[{"name":"aaronvg","email":"aaron@gloo.chat"},{"name":"hellovai-boundary","email":"vbv@boundaryml.com"},{"name":"sxlijin","email":"npmjs@sxlijin.com"}],"homepage":"https://www.boundaryml.com","bugs":{"url":"https://github.com/BoundaryML/baml/issues"},"dist":{"shasum":"8b0e99617e1605556dd698efc31b4479751d6d26","tarball":"https://registry.npmjs.org/@boundaryml/baml-highlightjs/-/baml-highlightjs-0.1.0.tgz","fileCount":5,"integrity":"sha512-fuzviEZrkYdk8sRK4GPQZFmMgUpd7iiWNL28x+0TpmED9B9ZzMS3PpRJhUlY5Lf7AvmSwzBwjZRNAwmMOR5uUQ==","signatures":[{"sig":"MEQCIHA9b9ZHxQtvgrq77lYuj7YqW8JcTNHtpvMajAhGBA/TAiB4rTH8Y9IVlfXWJzN2Z0ERyF5sxaWdc3S4HaFJIORsfQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35156},"type":"module","exports":{".":{"import":"./src/baml.js","default":"./src/baml.js"},"./dist/baml.js":"./dist/baml.js","./package.json":"./package.json"},"gitHead":"dfb153e3cf2b81eedf629d704ba6afd55a15cd3a","_npmUser":{"name":"hellovai-boundary","email":"vbv@boundaryml.com"},"repository":{"url":"git+https://github.com/BoundaryML/baml-highlightjs.git","type":"git"},"_npmVersion":"10.9.2","description":"highlight.js language definition for the BAML language.","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"peerDependencies":{"highlight.js":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/baml-highlightjs_0.1.0_1783898915498_0.25040827272066735","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@boundaryml/baml-highlightjs","version":"0.1.1","type":"module","description":"highlight.js language definition for the BAML language.","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/BoundaryML/baml-highlightjs.git"},"homepage":"https://www.boundaryml.com","bugs":{"url":"https://github.com/BoundaryML/baml/issues"},"keywords":["baml","highlight.js","highlightjs","hljs","syntax-highlighting","language"],"exports":{".":{"import":"./src/baml.js","default":"./src/baml.js"},"./package.json":"./package.json","./dist/baml.js":"./dist/baml.js"},"peerDependencies":{"highlight.js":"^11.0.0"},"gitHead":"24934c296de50f3be46c4bf0bb541592fa86d2d8","_id":"@boundaryml/baml-highlightjs@0.1.1","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-huWEc/5KAChWMNu+7qYycWXvzQ5fbl+dwuaFTaIJ5KkBhfeJ8b0dr1MKg579qfH0xfyIcYrZnZRr7rR+5Q6VOw==","shasum":"74b9ced3d9685157bec63eb7b1a1658809382904","tarball":"https://registry.npmjs.org/@boundaryml/baml-highlightjs/-/baml-highlightjs-0.1.1.tgz","fileCount":5,"unpackedSize":37365,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@boundaryml%2fbaml-highlightjs@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEXWixSZVQtUEHMmxsL7DCNDUNldLi1tGiLWkEqjloB4AiEAtg27ffB/q64nzMSR4SQIVk7SmbfV7s+xeybGB2VxT0o="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:905860e1-e6d2-455a-b302-79298204e076"}},"directories":{},"maintainers":[{"name":"aaronvg","email":"aaron@gloo.chat"},{"name":"hellovai-boundary","email":"vbv@boundaryml.com"},{"name":"sxlijin","email":"npmjs@sxlijin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/baml-highlightjs_0.1.1_1783918868896_0.2877168885702852"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-12T23:28:35.319Z","modified":"2026-07-13T05:01:09.352Z","0.1.0":"2026-07-12T23:28:35.631Z","0.1.1":"2026-07-13T05:01:09.041Z"},"bugs":{"url":"https://github.com/BoundaryML/baml/issues"},"license":"Apache-2.0","homepage":"https://www.boundaryml.com","keywords":["baml","highlight.js","highlightjs","hljs","syntax-highlighting","language"],"repository":{"type":"git","url":"git+https://github.com/BoundaryML/baml-highlightjs.git"},"description":"highlight.js language definition for the BAML language.","maintainers":[{"name":"aaronvg","email":"aaron@gloo.chat"},{"name":"hellovai-boundary","email":"vbv@boundaryml.com"},{"name":"sxlijin","email":"npmjs@sxlijin.com"}],"readme":"# BAML language for highlight.js\n\nA [highlight.js](https://highlightjs.org) third-party language definition for [BAML](https://github.com/BoundaryML/baml), published as [`@boundaryml/baml-highlightjs`](https://www.npmjs.com/package/@boundaryml/baml-highlightjs).\n\nIt highlights the full BAML surface: declaration blocks (`class`, `enum`, `interface`, `function`, `client<llm>`, `generator`, `retry_policy`, `template_string`, `test`, `testset`), expression bodies (`let` / `const` / `if` / `match` / `for` / `while` / `spawn` / `defer` / `watch`), attributes (`@alias(...)`, `@@dynamic`), `env.VAR` references, and all BAML string forms — including Jinja `{{ ... }}` / `{% ... %}` markup inside `#\"...\"#` prompt bodies and `${ ... }` interpolation inside backtick strings.\n\n## Install\n\n```sh\nnpm install highlight.js @boundaryml/baml-highlightjs\n```\n\n`highlight.js` (v11) is a peer dependency.\n\n## Usage\n\n```js\nimport hljs from \"highlight.js/lib/core\"; // or \"highlight.js\" for the full build\nimport baml from \"@boundaryml/baml-highlightjs\";\n\nhljs.registerLanguage(\"baml\", baml);\n\nconst { value } = hljs.highlight(code, { language: \"baml\" });\n```\n\nCode fences tagged `baml` then highlight with any hljs-based renderer (markdown-it, marked-highlight, rehype-highlight, ...), as long as the language is registered first.\n\n## CDN\n\nThe package ships a plain ES module, so it works directly from an ESM CDN — no build step:\n\n```html\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/highlight.js@11/styles/github-dark.min.css\" />\n<script type=\"module\">\n  import hljs from \"https://cdn.jsdelivr.net/npm/highlight.js@11/+esm\";\n  import baml from \"https://cdn.jsdelivr.net/npm/@boundaryml/baml-highlightjs/+esm\";\n\n  hljs.registerLanguage(\"baml\", baml);\n  hljs.highlightAll();\n</script>\n```\n\n## Browser / bundled builds\n\nFor the classic (non-module) highlight.js build, `dist/baml.js` self-registers the language on the global `hljs` — load it after highlight.js:\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11/highlight.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/@boundaryml/baml-highlightjs/dist/baml.js\"></script>\n```\n\nBundler users should import the ES module (`src/baml.js`, the package default export) instead.\n\n## Files\n\n| Path | Contents |\n| --- | --- |\n| `src/baml.js` | ESM module, default-exports the highlight.js `LanguageFn` |\n| `dist/baml.js` | Classic-script build; self-registers `baml` on the global `hljs` |\n\n## License\n\nApache-2.0\n\n---\n\nThis repository is a **read-only mirror**, generated from [`typescript2/pkg-grammar-hljs`](https://github.com/BoundaryML/baml/tree/canary/typescript2/pkg-grammar-hljs) in the BAML monorepo. Do not edit it by hand; changes land here automatically when the language definition changes upstream.\n","readmeFilename":"README.md"}