11ty-plugin-giallo/README.md
2026-01-26 01:34:36 +00:00

62 lines
1.6 KiB
Markdown

# 11ty-plugin-giallo
Eleventy plugin to support TextMate-style syntax highlighting via the
[Giallo Rust crate](https://github.com/getzola/giallo).
## Usage
```js
// eleventy.config.js
import syntaxHighlight from "11ty-plugin-giallo";
export default function (eleventyConfig) {
eleventyConfig.addPlugin(syntaxHighlight, {
themeLight: "github-light",
themeDark: "github-dark",
});
}
```
## Themes
[Themes included with Giallo](https://github.com/getzola/giallo/blob/master/README.md#themes)
## Block Diagram
![block diagram of plugin architecture](./block-diagram.svg)
## Development Quickstart
[Mise-en-place](https://mise.jdx.dev/) manages dev dependencies and scripts.
```sh
# Installs dev tools (Rust, Node) and automatically downloads WASI-SDK for the
# host architecture.
mise install
# Installs Node dependencies.
npm install
# Compiles Rust code into a Wasm component and generates Javascript bindings.
mise run build
# Runs unit tests.
mise run test
```
## Limitations
- Support is currently limited to markdown code blocks. The official Eleventy
syntax highlighting plugin also provides Liquid and Nunjucks tags as well as a
global Javascript function.
- Line highlights and numbers are not yet supported.
- Giallo does not support Prism-style diff format.
## Licensing
`11ty-plugin-giallo` is distributed under the European Union Public License v.
1.2, to match the licensing of the Giallo crate. The EUPL is generally
compatible with other OSI-approved copyleft licenses; for more information refer
to the
[compatibility matrix](https://interoperable-europe.ec.europa.eu/collection/eupl/matrix-eupl-compatible-open-source-licences).