Module Djot.Profile

type t = private Kernel.Profile.options

The syntax a parse accepts. Start from a named profile and switch constructs on or off. The kernel record is readable, for the checks in Kernel.ProfileChecks.

val of_kernel : Kernel.Profile.options -> t option

The profile of a kernel record, such as one of Kernel.Spec.all. None if its delimiter table is not one the parser accepts.

val djot : t

djot as specified. The extensions are off.

val markdown_like : t

djot with Markdown spellings added: strong as **, dollar math, setext headings, sublists without a blank line, one-line ATX headings. Not CommonMark.

djot constructs

All on in djot.

val with_footnotes : bool -> t -> t

References [^a] and definitions [^a]: ... together.

val with_smart_typography : bool -> t -> t

Dashes and ellipses.

val with_raw_inline : bool -> t -> t

`x`{=html}.

val with_math : bool -> t -> t

$`x` and $$`x`.

val with_inline_attrs : bool -> t -> t

{...} after an inline, and spans [text]{...}.

val with_tables : bool -> t -> t
val with_divs : bool -> t -> t
val with_tasks : bool -> t -> t
val with_raw_blocks : bool -> t -> t

Code blocks with an =format info string.

val with_deflists : bool -> t -> t
val with_block_attrs : bool -> t -> t

An attribute line {...} before a block.

val with_heading_continuation : bool -> t -> t

A heading's text continues onto the following lines; off in markdown_like.

Extensions

All off in djot.

[[target|alias]] and ![[target]] (Inline.t.Ext_wikilink).

val with_ext_dollar_math : bool -> t -> t

$x$, $$x$$ and $`x`$, read as Inline.t.Math; on in markdown_like. Independent of with_math.

val with_ext_keyed : bool -> t -> t

label: content (Block.t.Ext_keyed).

val with_ext_callouts : bool -> t -> t

Callouts with a header on the first line of a block quote. Off by default.

val with_ext_tags : bool -> t -> t

Custom tag names: ::: name names a Block.t.Div and :name[...] a Inline.t.Span. Both spellings move together.

val with_ext_holes : bool -> t -> t

Holes: %`e`, a code span with a % before it, reads as Inline.t.Hole, an expression for the consumer to evaluate. A raw block in format hole stays a raw block; a consumer may treat it as a block hole. See Mapper.holes_as_raw.

val with_ext_setext_headings : bool -> t -> t

A setext heading: a paragraph underlined with = (level 1) or two or more - (level 2). On in markdown_like.

val with_ext_list_interrupts : bool -> t -> t

A bullet, or an ordered marker numbered 1, starts a list on the line after paragraph text, with no blank line between. On in markdown_like.

Switches as data

module Switch : sig ... end

One of the switches above, as a value.

val switches : Switch.t list

Every switch, djot constructs first.

Delimiters

module Delimiter : sig ... end

An inline delimiter whose spelling a profile chooses.

val emph : Delimiter.t
val strong : Delimiter.t
val superscript : Delimiter.t
val subscript : Delimiter.t
val highlight : Delimiter.t
val insert : Delimiter.t
val delete : Delimiter.t
val delimiters : Delimiter.t list

The seven above.

val with_delimiter : Delimiter.t -> char -> width:int -> Delimiter.syntax -> t -> (t, string) Stdlib.result

with_delimiter d c ~width syntax p respells d as width copies of c. The error says why a spelling is refused: the character is not ASCII punctuation, is taken by other syntax, or is another delimiter's.

val equal : t -> t -> bool

Whether two profiles have every switch and every delimiter spelling the same.

val pp_delimiters : Stdlib.Format.formatter -> t -> unit

One name: value line per inline delimiter, giving its characters and how it is written, e.g. strong: ** bare or highlight: = braced.

val pp : Stdlib.Format.formatter -> t -> unit

The lines of pp_delimiters, then one name: value line per switch above, named as the switch without with_.