package slipshow

  1. Overview
  2. Docs

Source file has.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Cmarkit

type t = { math : bool; pdf : bool }

let has =
  let block _ acc = function
    | Block.Ext_math_block _ -> Folder.ret { acc with math = true }
    | _ -> Folder.default
  in
  let inline _ acc = function
    | Inline.Ext_math_span _ -> Folder.ret { acc with math = true }
    | Ast.Pdf _ -> Folder.ret { acc with pdf = true }
    | _ -> Folder.default
  in
  Ast.Folder.make ~block ~inline ()

let find_out (doc : Ast.t) =
  Cmarkit.Folder.fold_doc has { math = false; pdf = false } doc.doc