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);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
72760
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/Tools/doc.ML
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     3
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     4
Access to Isabelle documentation.
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     5
*)
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     6
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     7
signature DOC =
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
     8
sig
82767
3b045cc57f0c more operations (e.g. for testing);
wenzelm
parents: 82759
diff changeset
     9
  val names: unit -> string list
72760
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    10
  val check: Proof.context -> string * Position.T -> string
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    11
end;
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    12
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    13
structure Doc: DOC =
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    14
struct
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    15
82767
3b045cc57f0c more operations (e.g. for testing);
wenzelm
parents: 82759
diff changeset
    16
fun names () = split_lines (\<^scala>\<open>doc_names\<close> ML_System.platform);
3b045cc57f0c more operations (e.g. for testing);
wenzelm
parents: 82759
diff changeset
    17
72760
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    18
fun check ctxt arg =
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    19
  Completion.check_item "documentation" (Markup.doc o #1)
82767
3b045cc57f0c more operations (e.g. for testing);
wenzelm
parents: 82759
diff changeset
    20
    (map (rpair ()) (names ())) ctxt arg;
72760
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    21
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    22
val _ =
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    23
  Theory.setup
73761
ef1a18e20ace clarified modules;
wenzelm
parents: 72760
diff changeset
    24
   (Document_Output.antiquotation_verbatim_embedded \<^binding>\<open>doc\<close>
72760
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    25
      (Scan.lift Parse.embedded_position) check);
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    26
042180540068 clarified protocol: Doc.check at run-time via Scala function;
wenzelm
parents:
diff changeset
    27
end;