src/Pure/Tools/doc.ML
author wenzelm
Wed, 25 Jun 2025 13:32:28 +0200
changeset 82767 3b045cc57f0c
parent 82759 c7d2ae25d008
permissions -rw-r--r--
more operations (e.g. for testing);

(*  Title:      Pure/Tools/doc.ML
    Author:     Makarius

Access to Isabelle documentation.
*)

signature DOC =
sig
  val names: unit -> string list
  val check: Proof.context -> string * Position.T -> string
end;

structure Doc: DOC =
struct

fun names () = split_lines (\<^scala>\<open>doc_names\<close> ML_System.platform);

fun check ctxt arg =
  Completion.check_item "documentation" (Markup.doc o #1)
    (map (rpair ()) (names ())) ctxt arg;

val _ =
  Theory.setup
   (Document_Output.antiquotation_verbatim_embedded \<^binding>\<open>doc\<close>
      (Scan.lift Parse.embedded_position) check);

end;