Folio.Content.ShowRule (Folio v0.3.0)

Copy Markdown View Source

A show rule that transforms matching content elements before compilation.

Applied on the Elixir side; never sent to Rust. The transform function receives the matched struct and returns replacement content.

Targets are atoms matching content types: :enum, :enum_item, :list, :list_item, :heading, :paragraph, :quote, :table, :grid, :block, etc.

Summary

Types

t()

@type t() :: %Folio.Content.ShowRule{
  target: atom(),
  transform: (struct() -> Folio.Content.t() | [Folio.Content.t()] | String.t())
}