Cleanup: moved outdated code for exporting LaTeX style files into a dedicated functions and disabled file output.
This commit is contained in:
parent
0daaf3d699
commit
c3409d1f10
58
Isa_DOF.thy
58
Isa_DOF.thy
|
@ -15,6 +15,7 @@ text\<open> Offering
|
|||
text\<open> In this section, we develop on the basis of a management of references Isar-markups
|
||||
that provide direct support in the PIDE framework. \<close>
|
||||
|
||||
|
||||
theory Isa_DOF (* Isabelle Document Ontology Framework *)
|
||||
imports Main
|
||||
RegExpInterface (* Interface to functional regular automata for monitoring *)
|
||||
|
@ -636,6 +637,19 @@ val _ =
|
|||
Toplevel.keep (check_doc_global b o Toplevel.context_of)));
|
||||
|
||||
|
||||
|
||||
fun write_ontology_latex_sty_template thy =
|
||||
let
|
||||
(*
|
||||
val raw_name = Context.theory_long_name thy
|
||||
|
||||
val curr_thy_name = if String.isPrefix "Draft." raw_name
|
||||
then String.substring(raw_name, 6, (String.size raw_name)-6)
|
||||
else error "Not in ontology definition context"
|
||||
*)
|
||||
val curr_thy_name = Context.theory_name thy
|
||||
val {docobj_tab={tab = x, ...},docclass_tab,...}= get_data_global thy;
|
||||
|
||||
fun toStringLaTeXNewKeyCommand env long_name =
|
||||
"\\expandafter\\newkeycommand\\csname"^" "^"isaDof."^env^"."^long_name^"\\endcsname%\n"
|
||||
|
||||
|
@ -677,17 +691,6 @@ fun write_file thy filename content =
|
|||
=> warning ("Could not write \""^(name)^"\".")
|
||||
end
|
||||
|
||||
fun write_ontology_latex_sty_template thy =
|
||||
let
|
||||
(*
|
||||
val raw_name = Context.theory_long_name thy
|
||||
|
||||
val curr_thy_name = if String.isPrefix "Draft." raw_name
|
||||
then String.substring(raw_name, 6, (String.size raw_name)-6)
|
||||
else error "Not in ontology definition context"
|
||||
*)
|
||||
val curr_thy_name = Context.theory_name thy
|
||||
val {docobj_tab={tab = x, ...},docclass_tab,...}= get_data_global thy;
|
||||
fun write_attr (n, ty, _) = YXML.content_of(Binding.print n)^ "=\n"
|
||||
|
||||
fun write_class (n, {attribute_decl,id,inherits_from,name,params,thy_name,rex,rejectS}) =
|
||||
|
@ -699,8 +702,10 @@ fun write_ontology_latex_sty_template thy =
|
|||
else ""
|
||||
val content = String.concat(map write_class (Symtab.dest docclass_tab))
|
||||
(* val _ = writeln content -- for interactive testing only, breaks LaTeX compilation *)
|
||||
in write_file thy ("Isa-DOF."^curr_thy_name^".template.sty") content
|
||||
end;
|
||||
in
|
||||
warning("LaTeX Style file generation not supported.")
|
||||
(* write_file thy ("Isa-DOF."^curr_thy_name^".template.sty") content *)
|
||||
end
|
||||
|
||||
|
||||
val _ =
|
||||
|
@ -1696,31 +1701,4 @@ val _ =
|
|||
end (* struct *)
|
||||
\<close>
|
||||
|
||||
|
||||
section\<open> Testing and Validation \<close>
|
||||
|
||||
(* the f ollowing test crashes the LaTeX generation - however, without the latter this output is
|
||||
instructive
|
||||
ML\<open>
|
||||
writeln (DOF_core.toStringDocItemCommand "section" "scholarly_paper.introduction" []);
|
||||
writeln (DOF_core.toStringDocItemLabel "scholarly_paper.introduction" []);
|
||||
writeln (DOF_core.toStringDocItemRef "scholarly_paper.introduction" "XX" []);
|
||||
|
||||
(DOF_core.write_ontology_latex_sty_template @{theory})
|
||||
\<close>
|
||||
*)
|
||||
|
||||
|
||||
ML\<open>
|
||||
|
||||
\<close>
|
||||
(*
|
||||
ML\<open>
|
||||
val h = bstring_to_holstring @{context} (Syntax.string_of_term @{context} @{term "A \<longrightarrow> A"});
|
||||
holstring_to_bstring @{context} h
|
||||
\<close>
|
||||
*)
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue