package mdx
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=603990812efa7184d88a4896d7f9369b43d32e3dbdd26fe9cecb5a5f5f32c1e0
sha512=461bb3f2e25f8a2f869577ec8f95f731e0765a534043088fdc88ee9fabaa52926eb957124529ff889f1d698df594b235219c677521eebe01a5959c7db75131ea
doc/mdx/Mdx/Block/index.html
Module Mdx.BlockSource
Code blocks headers.
Code blocks.
type ocaml_value = {env : Ocaml_env.t;(*
*)envis the name given to the environment where tests are run.non_det : Label.non_det option;errors : Output.t list;
}type toplevel_value = {env : Ocaml_env.t;(*
*)envis the name given to the environment where tests are run.non_det : Label.non_det option;
}type include_ocaml_file = {part_included : string option;(*
*)part_includedis the part of the file to synchronize with. If lines is not specified synchronize the whole file.
}type include_value = {file_included : string;(*
*)file_includedis the name of the file to synchronize with.file_kind : include_file_kind;
}type value = | Raw of raw_value| OCaml of ocaml_value| Cram of cram_value| Toplevel of toplevel_value| Include of include_value
The type for block values.
The type for sections.
type t = {loc : Location.t;section : section option;dir : string option;source_trees : string list;required_packages : string list;labels : Label.t list;legacy_labels : bool;contents : string list;skip : bool;version_enabled : bool;(*Whether the current OCaml version complies with the block's version.
*)set_variables : (string * string) list;unset_variables : string list;value : value;
}The type for supported code blocks.
val mk_include :
loc:Location.t ->
section:section option ->
labels:Label.t list ->
(t, [ `Msg of string ]) Result.resultmk_include builds an include block from a comment <!-- $MDX ... --> that is not followed by a code block ``` ... ```.
Printers
pp_header pretty-prints full block headers with the labels.
pp_footer pretty-prints block footer.
pp_line_directive pretty-prints a line directive given as a filename and line number.
Accessors
Whether a block's command or output is non-deterministic.
source_trees t is the list of extra source-trees to add as dependency of the code-block.
set_variable t is the list of environment variable to set and their values
unset_variable t is the list of environment variable to unset
explicit_required_packages t returns the list of packages explicitly required by the user through require-package labels in the block t.
required_libraries t returns the set of libaries that are loaded through #require statements in the block t. Always returns an empty set if t isn't a toplevel block.
executable_contents t is either t's contents if t is a raw or a cram block, or t's commands if t is a toplevel fragments (e.g. the phrase result is discarded).
Parsers
require_from_line line returns the set of libraries imported by the #require statement on line or an empty set if line is not a require statement.
Same as require_from_line but aggregated over several lines