Compare commits

..

4 commits

Author SHA1 Message Date
Brent Schroeter
dca9a15bfe bump npm version 2026-01-26 01:34:56 +00:00
Brent Schroeter
15bba8a9df update documentation 2026-01-26 01:34:36 +00:00
Brent Schroeter
d37f346793 update with naming scheme 2026-01-26 01:33:19 +00:00
Brent Schroeter
0950610f90 remove unnecessary files, deps, and configuration 2026-01-26 01:32:29 +00:00
10 changed files with 28 additions and 98 deletions

View file

@ -4,6 +4,7 @@
/giallo-js/Cargo.toml /giallo-js/Cargo.toml
/giallo-js/src /giallo-js/src
/giallo-js/target /giallo-js/target
/giallo-js/wit
/mise.toml /mise.toml
/node_modules /node_modules
/test /test

View file

@ -22,6 +22,10 @@ export default function (eleventyConfig) {
[Themes included with Giallo](https://github.com/getzola/giallo/blob/master/README.md#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 ## Development Quickstart
[Mise-en-place](https://mise.jdx.dev/) manages dev dependencies and scripts. [Mise-en-place](https://mise.jdx.dev/) manages dev dependencies and scripts.
@ -48,3 +52,11 @@ mise run test
global Javascript function. global Javascript function.
- Line highlights and numbers are not yet supported. - Line highlights and numbers are not yet supported.
- Giallo does not support Prism-style diff format. - 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).

4
block-diagram.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 46 KiB

69
giallo-js/Cargo.lock generated
View file

@ -26,12 +26,6 @@ version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
[[package]]
name = "bumpalo"
version = "3.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.53" version = "1.2.53"
@ -104,8 +98,6 @@ name = "giallo-js"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"giallo", "giallo",
"js-sys",
"wasm-bindgen",
"wit-bindgen", "wit-bindgen",
] ]
@ -154,16 +146,6 @@ version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
[[package]]
name = "js-sys"
version = "0.3.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]] [[package]]
name = "leb128fmt" name = "leb128fmt"
version = "0.1.0" version = "0.1.0"
@ -298,12 +280,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "rustversion"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]] [[package]]
name = "seize" name = "seize"
version = "0.5.1" version = "0.5.1"
@ -398,51 +374,6 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "wasm-bindgen"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
dependencies = [
"unicode-ident",
]
[[package]] [[package]]
name = "wasm-encoder" name = "wasm-encoder"
version = "0.244.0" version = "0.244.0"

View file

@ -19,6 +19,4 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
giallo = { version = "0.2.2", features = ["dump"] } giallo = { version = "0.2.2", features = ["dump"] }
js-sys = "0.3.85"
wasm-bindgen = "0.2.108"
wit-bindgen = "0.51.0" wit-bindgen = "0.51.0"

View file

@ -1,11 +1,9 @@
use giallo::{HighlightOptions, HtmlRenderer, Registry, RenderOptions, ThemeVariant}; use giallo::{HighlightOptions, HtmlRenderer, Registry, RenderOptions, ThemeVariant};
mod bindings { mod bindings {
//! Generated code derived from the Giallo-JS `world.wit` definition. //! Generated code derived from the `giallo-js.wit` definition.
wit_bindgen::generate!({ wit_bindgen::generate!({ path: "wit/giallo-js.wit" });
path: "wit/world.wit",
});
use super::GialloJsComponent; use super::GialloJsComponent;
export!(GialloJsComponent); export!(GialloJsComponent);
@ -13,7 +11,7 @@ mod bindings {
struct GialloJsComponent; struct GialloJsComponent;
impl bindings::exports::docs::giallo_js::syntax_highlighter::Guest for GialloJsComponent { impl bindings::exports::brentsch::giallo_js::syntax_highlighter::Guest for GialloJsComponent {
/// Rudimentary Wasm adapter around the basic /// Rudimentary Wasm adapter around the basic
/// [Giallo usage example](https://github.com/getzola/giallo/blob/a86755836dc4387056432f63f0b37b2c04b52711/examples/basic.rs). /// [Giallo usage example](https://github.com/getzola/giallo/blob/a86755836dc4387056432f63f0b37b2c04b52711/examples/basic.rs).
fn render_highlighted( fn render_highlighted(

View file

@ -1,4 +1,4 @@
package docs:giallo-js@0.0.1; package brentsch:giallo-js@0.0.1;
interface syntax-highlighter { interface syntax-highlighter {
render-highlighted: func( render-highlighted: func(

View file

@ -9,32 +9,17 @@ targets = "wasm32-wasip2"
[tools."github:WebAssembly/wasi-sdk"] [tools."github:WebAssembly/wasi-sdk"]
version_prefix = "wasi-sdk-" version_prefix = "wasi-sdk-"
version = "29" version = "29"
postinstall = 'mise run link-wasi "$MISE_TOOL_INSTALL_PATH"'
[tasks.clean] [tasks.clean]
run = """ run = """
rm -r ./target || 0 rm -r ./target || true
rm -r ./transpiled || 0 rm -r ./transpiled || true
"""
dir = "giallo-js"
[tasks.link-wasi]
hide = true
description = "[INTERNAL] Symlink the WASI artifacts installed by mise into the project directory."
usage = 'arg "<wasi_install_path>"'
run = """
mkdir -p ./build
ln -sf "${usage_wasi_install_path?}" ./build/wasi-sdk
""" """
dir = "giallo-js" dir = "giallo-js"
[tasks.compile] [tasks.compile]
description = "Compile Rust code to wasm component." description = "Compile Rust code to wasm component."
run = """ run = "cargo build --target=wasm32-wasip2"
RUSTFLAGS="-L $(pwd)/build/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi -lstatic=c++ -lstatic=c++abi" \
CC="$(pwd)/build/wasi-sdk/bin/clang" \
cargo build --target=wasm32-wasip2
"""
dir = "giallo-js" dir = "giallo-js"
[tasks.transpile] [tasks.transpile]

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "11ty-plugin-giallo", "name": "11ty-plugin-giallo",
"version": "0.1.0-alpha.2", "version": "0.1.0-beta.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "11ty-plugin-giallo", "name": "11ty-plugin-giallo",
"version": "0.1.0-alpha.2", "version": "0.1.0-beta.1",
"license": "EUPL-1.2", "license": "EUPL-1.2",
"dependencies": { "dependencies": {
"@bytecodealliance/preview2-shim": "^0.17.6" "@bytecodealliance/preview2-shim": "^0.17.6"

View file

@ -1,7 +1,8 @@
{ {
"name": "11ty-plugin-giallo", "name": "11ty-plugin-giallo",
"version": "0.1.0-beta.0", "version": "0.1.0-beta.1",
"description": "Eleventy plugin to support TextMate-style syntax highlighting via the Giallo Rust crate.", "description": "Eleventy plugin to support TextMate-style syntax highlighting via the Giallo Rust crate.",
"keywords": ["eleventy", "eleventy-plugin"],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://forge.secondsystemtech.com/brent/11ty-plugin-giallo" "url": "https://forge.secondsystemtech.com/brent/11ty-plugin-giallo"