package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/src/b0.kit/b0_cmark.ml.html

Source file b0_cmark.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(*---------------------------------------------------------------------------
   Copyright (c) 2019 The b0 programmers. All rights reserved.
   SPDX-License-Identifier: ISC
  ---------------------------------------------------------------------------*)

open B0_std

let tool = B0_memo.Tool.by_name "cmark"
let cmd ?(validate_utf_8 = true) ?(format = "html") m ~opts ~mds ~o =
  let cmark = B0_memo.tool m tool in
  let validate = Cmd.if' validate_utf_8 (Cmd.arg "--validate-utf8") in
  B0_memo.spawn m ~reads:mds ~writes:[o] ~stdout:(`File o) @@
  cmark Cmd.(arg "--to" % format %% validate %% opts %% unstamp (paths mds))

let to_html
    ?generator ?lang ?scripts ?styles ?title m ~opts ~mds ~o_frag:frag ~o
  =
  cmd m ~opts ~mds ~o:frag;
  B0_web_page.write ?generator ?lang ?scripts ?styles ?title m ~frag ~o