staticfs

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package staticfs exposes the vendored Prism browser assets (prism.mjs, prism-element.mjs, prism-resolver.mjs, prism-selection.mjs, d3/*.mjs, the README files) as an embed.FS so commands compiled from cmd/prism can extract or serve them without depending on the repo layout at runtime.

Lives at the repo root next to the embedded tree so the go:embed pattern resolves cleanly (Go forbids embed paths from traversing upward via "..").

Index

Constants

View Source
const BundleRoot = "vendor/prism"

BundleRoot is the directory inside Tree that maps to the distributable bundle. `prism static-bundle <out>` extracts every file under this prefix and writes it (preserving relative paths) into <out>.

Variables

View Source
var Tree embed.FS

Tree carries the vendored ESM browser surface (the four .mjs files plus README). `prism.wasm` and `wasm_exec.js` are NOT embedded — they are produced by `make build-wasm`, can be dropped into static/vendor/prism/ at docs-build time for mdBook to pick up, and shipped by `prism static-bundle --wasm` from their build artefact locations. Keeping them out of the embed FS prevents the host CLI binary from inflating by ~70 MiB.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL