bracetax

Simple and deterministic text processing syntax
type kind = [
| `local
| `generic
]
type t = {
kind : kind;
linkto : string option;
other_args : string list;
contents : Buffer.t;
}
val get_kind : string -> [> `generic | `local ] * string

In the returned string, if it is a "local:" link, removes the "local:" part.

val create : ?kind:kind -> ?linkto:string -> ?other_args:string list -> unit -> t
val start : ?url_hook:( string -> string ) -> string list -> [> `link of t ] * ( string -> unit )

Start recording a link, it returns the Stack.environment element to put in the stack, and new "output" function to write/record the text of the link.

val stop : t -> kind * string option * string option

Stop recoring a link, returns the kind of link, the optional target, and the optional link text (already transformed).

val unparse : [< `generic | `local ] -> string option -> string option -> string

Transform back to a Bracetax string (treats the text as pure text).