Cmarkit.Link_definition
Link definitions.
type layout = {
indent : Layout.indent;
Amount of indentation, 0
on inline links.
angled_dest : bool;
true
if destination is between <…>
.
before_dest : Block_line.blank list;
Blanks to destination.
*)after_dest : Block_line.blank list;
Blanks after destination.
*)title_open_delim : Layout.char;
Title open delimiter ('\"'
, '('
, …)
after_title : Block_line.blank list;
Blanks after title (inline links).
*)}
The type for link reference layout.
val layout_for_dest : string -> layout
layout_for_dest d
computes a layout value for destination d
. This just determines if angled_dest
needs to be true
.
The type for representing link references definitions and inline links.
val make :
?layout:layout ->
?defined_label:Label.t option ->
?label:Label.t ->
?dest:string node ->
?title:Block_line.tight list ->
unit ->
t
make ()
is a link reference with given parameters. If dest
is given and layout
is not, the latter is computed with layout_for_dest
. label
is a label if the link is defined via a link reference definition. defined_label
defaults to label
.
label ld
is None
if this is a link definition for an inline link. It is Some l
, if ld
is a link reference definition. l
is the label as found in the text. The result of the resolver is in defined_label
.
defined_label ld
is the label determined by the Label.resolver
for the link definition reference. The label as found in the source text is in label
. If this is None
either it's a link definition for an inline link or the resolver deleted the label definition.
dest ld
is the link destination of ld
. None
means there was no destination. CommonMark renders that as an empty href
in HTML.
val title : t -> Block_line.tight list option
title ld
is the title of the reference, if any.