src/Pure/Tools/doc.ML
changeset 72760 042180540068
child 73761 ef1a18e20ace
equal deleted inserted replaced
72759:bd5ee3148132 72760:042180540068
       
     1 (*  Title:      Pure/Tools/doc.ML
       
     2     Author:     Makarius
       
     3 
       
     4 Access to Isabelle documentation.
       
     5 *)
       
     6 
       
     7 signature DOC =
       
     8 sig
       
     9   val check: Proof.context -> string * Position.T -> string
       
    10 end;
       
    11 
       
    12 structure Doc: DOC =
       
    13 struct
       
    14 
       
    15 fun check ctxt arg =
       
    16   Completion.check_item "documentation" (Markup.doc o #1)
       
    17     (\<^scala>\<open>doc_names\<close> "" |> split_lines |> map (rpair ())) ctxt arg;
       
    18 
       
    19 val _ =
       
    20   Theory.setup
       
    21    (Thy_Output.antiquotation_verbatim_embedded \<^binding>\<open>doc\<close>
       
    22       (Scan.lift Parse.embedded_position) check);
       
    23 
       
    24 end;