Function format_document_with_formatter

pub fn format_document_with_formatter<'a, 'o, 'c: 'o, T>(root: Node<'a>, options: &'o Options<'c>, output: &'o mut dyn Write, plugins: &'o Plugins<'o>, formatter: fn(context: &mut Context<'_, '_, T>, node: Node<'a>, entering: bool) -> Result<ChildRendering, Error>, user: T) -> Result<T, Error>

Formats the given AST with all options and formatter function specified.

The default formatter as used by format_document is format_node_default. It is given the Context, Node, and a boolean indicating whether the node is being entered into or exited. The returned ChildRendering is used to inform whether and how the node's children are recursed into automatically.