Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions crates/pampa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ cargo-fuzz = true
default = ["terminal-support", "json-filter", "lua-filter", "template-fs"]
terminal-support = ["dep:crossterm", "dep:supports-hyperlinks"]
terminal-hyperlinks = ["dep:supports-hyperlinks"]
# Enable filter pipeline support (pulls in quarto-system-runtime / deno_core / v8).
# Parser-only consumers can disable this with `default-features = false` to avoid
# the v8 link dependency, which is problematic in shared-library builds on Linux.
filters = ["dep:quarto-system-runtime"]
# Enable JSON filter support (requires subprocess spawning, disable for WASM)
json-filter = []
json-filter = ["filters"]
# Enable Lua filter support (disable for WASM, where mlua is not available)
lua-filter = ["dep:mlua"]
lua-filter = ["filters", "dep:mlua"]
# Enable filesystem-based template resolution (disable for WASM)
template-fs = []

Expand All @@ -49,7 +53,7 @@ quarto-ast-reconcile = { path = "../quarto-ast-reconcile" }
quarto-doctemplate = { workspace = true }
quarto-citeproc = { path = "../quarto-citeproc" }
quarto-csl = { path = "../quarto-csl" }
quarto-system-runtime = { workspace = true }
quarto-system-runtime = { workspace = true, optional = true }
regex = { version = "1.12.3", features = ["unicode"] }
clap = { version = "4.5", features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
Expand Down
16 changes: 16 additions & 0 deletions crates/pampa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ We will, aspirationally, treat unintentional differences as bugs.
The "reader" syntax allows users to recover the exact Pandoc markdown behavior when desired.
With this feature, however, other quarto-markdown conveniences will be absent: no error messages, source tracking, etc.

## Library usage

When used as a library, pampa's default features include filter support
(`json-filter`, `lua-filter`), which transitively pull in
`quarto-system-runtime` and `deno_core`. Parser-only consumers (e.g. tooling
that only needs the qmd reader and writers) can opt out:

```toml
[dependencies]
pampa = { ..., default-features = false }
```

This drops the v8 link dependency, which avoids shared-library link failures
on Linux x86_64 (`R_X86_64_TPOFF32` against v8 TLS symbols) for consumers
building a `cdylib`.

## Current state

Parses [quarto-web](https://github.com/quarto-dev/quarto-web) with a small number of changes
Expand Down
2 changes: 2 additions & 0 deletions crates/pampa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Copyright (c) 2025 Posit, PBC
*/

#[cfg(feature = "filters")]
pub mod citeproc_filter;
pub mod errors;
pub mod filter_context;
Expand All @@ -21,6 +22,7 @@ pub mod template;
pub mod toc;
pub mod transforms;
pub mod traversals;
#[cfg(feature = "filters")]
pub mod unified_filter;
pub mod utils;
pub mod wasm_entry_points;
Expand Down
Loading