Merge branch 'makarius-isabelle_dev' into Isabelle_dev
ci/woodpecker/push/build Pipeline failed
Details
ci/woodpecker/push/build Pipeline failed
Details
This commit is contained in:
commit
f09a2df943
|
@ -8,5 +8,5 @@ sources = \
|
||||||
src/scala/dof_mkroot.scala \
|
src/scala/dof_mkroot.scala \
|
||||||
src/scala/dof_tools.scala
|
src/scala/dof_tools.scala
|
||||||
services = \
|
services = \
|
||||||
isabelle_dof.DOF_Tools \
|
isabelle.dof.DOF_Tools \
|
||||||
isabelle_dof.DOF_Document_Build$Engine
|
isabelle.dof.DOF_Document_Build$Engine
|
||||||
|
|
|
@ -206,7 +206,7 @@ fun check_latex_measure _ src =
|
||||||
handle Fail _ => error ("syntax error in LaTeX measure") )
|
handle Fail _ => error ("syntax error in LaTeX measure") )
|
||||||
in () end
|
in () end
|
||||||
|
|
||||||
val parse_latex_measure = Args.text_input >> (fn src => (check_latex_measure () (* dummy arg *) src;
|
val parse_latex_measure = Parse.embedded_input >> (fn src => (check_latex_measure () (* dummy arg *) src;
|
||||||
(fst o Input.source_content) src ) )
|
(fst o Input.source_content) src ) )
|
||||||
|
|
||||||
end\<close>
|
end\<close>
|
||||||
|
|
|
@ -2865,7 +2865,7 @@ fun std_text_antiquotation name (* redefined in these more abstract terms *) =
|
||||||
|
|
||||||
(* should be the same as (2020):
|
(* should be the same as (2020):
|
||||||
fun text_antiquotation name =
|
fun text_antiquotation name =
|
||||||
Thy_Output.antiquotation_raw_embedded name (Scan.lift Args.text_input)
|
Thy_Output.antiquotation_raw_embedded name (Scan.lift Parse.embedded_input)
|
||||||
(fn ctxt => fn text =>
|
(fn ctxt => fn text =>
|
||||||
let
|
let
|
||||||
val _ = report_text ctxt text;
|
val _ = report_text ctxt text;
|
||||||
|
@ -2881,7 +2881,7 @@ fun std_theory_text_antiquotation name (* redefined in these more abstract terms
|
||||||
|
|
||||||
(* should be the same as (2020):
|
(* should be the same as (2020):
|
||||||
fun theory_text_antiquotation name =
|
fun theory_text_antiquotation name =
|
||||||
Thy_Output.antiquotation_raw_embedded name (Scan.lift Args.text_input)
|
Thy_Output.antiquotation_raw_embedded name (Scan.lift Parse.embedded_input)
|
||||||
(fn ctxt => fn text =>
|
(fn ctxt => fn text =>
|
||||||
let
|
let
|
||||||
val keywords = Thy_Header.get_keywords' ctxt;
|
val keywords = Thy_Header.get_keywords' ctxt;
|
||||||
|
|
|
@ -28,10 +28,9 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package isabelle_dof
|
package isabelle.dof
|
||||||
|
|
||||||
import isabelle._
|
import isabelle._
|
||||||
import java.io.{File => JFile}
|
|
||||||
|
|
||||||
|
|
||||||
object DOF_Document_Build
|
object DOF_Document_Build
|
||||||
|
@ -50,31 +49,31 @@ object DOF_Document_Build
|
||||||
val directory = context.prepare_directory(dir, doc, latex_output)
|
val directory = context.prepare_directory(dir, doc, latex_output)
|
||||||
|
|
||||||
// produced by alternative presentation hook (workaround for missing Toplevel.present_theory)
|
// produced by alternative presentation hook (workaround for missing Toplevel.present_theory)
|
||||||
for (name <- context.document_theories) {
|
for {
|
||||||
|
name <- context.document_theories.iterator
|
||||||
|
entry <- context.session_context.get(name.theory, Export.DOCUMENT_LATEX + "_dof")
|
||||||
|
} {
|
||||||
val path = Path.basic(Document_Build.tex_name(name))
|
val path = Path.basic(Document_Build.tex_name(name))
|
||||||
val entry = context.session_context(name.theory, Export.DOCUMENT_LATEX + "_dof", permissive = true)
|
|
||||||
val xml = YXML.parse_body(entry.text)
|
val xml = YXML.parse_body(entry.text)
|
||||||
if (xml.nonEmpty) {
|
File.content(path, xml).output(latex_output(_, file_pos = path.implode_symbolic))
|
||||||
File.Content(path, xml).output(latex_output(_, file_pos = path.implode_symbolic))
|
|
||||||
.write(directory.doc_dir)
|
.write(directory.doc_dir)
|
||||||
}
|
}
|
||||||
}
|
val isabelle_dof_dir = context.session_context.sessions_structure("Isabelle_DOF").dir
|
||||||
val dof_home= Path.explode(Isabelle_System.getenv_strict("ISABELLE_DOF_HOME"));
|
|
||||||
// print(context.options.string("dof_url"));
|
// print(context.options.string("dof_url"));
|
||||||
|
|
||||||
// copy Isabelle/DOF LaTeX templates
|
// copy Isabelle/DOF LaTeX templates
|
||||||
val template_dir = dof_home + Path.explode("src/document-templates/")
|
val template_dir = isabelle_dof_dir + Path.explode("document-templates")
|
||||||
// TODO: error handling in case 1) template does not exist or 2) root.tex does already exist
|
// TODO: error handling in case 1) template does not exist or 2) root.tex does already exist
|
||||||
val template = regex.replaceAllIn(context.options.string("dof_template"),"")
|
val template = regex.replaceAllIn(context.options.string("dof_template"),"")
|
||||||
Isabelle_System.copy_file(template_dir + Path.explode("root-"+template+".tex"),
|
Isabelle_System.copy_file(template_dir + Path.explode("root-"+template+".tex"),
|
||||||
directory.doc_dir+Path.explode("root.tex"))
|
directory.doc_dir+Path.explode("root.tex"))
|
||||||
|
|
||||||
// copy Isabelle/DOF LaTeX styles
|
// copy Isabelle/DOF LaTeX styles
|
||||||
val doc_jdir = new JFile(directory.doc_dir.implode)
|
List(Path.explode("DOF/latex"), Path.explode("ontologies"))
|
||||||
val styles = File.find_files(new JFile(dof_home.implode),((f:JFile) => f.getName().endsWith(".sty")), true)
|
.flatMap(dir =>
|
||||||
for (sty <- styles) {
|
File.find_files((isabelle_dof_dir + dir).file,
|
||||||
Isabelle_System.copy_file(sty, doc_jdir)
|
file => file.getName.endsWith(".sty"), include_dirs = true))
|
||||||
}
|
.foreach(sty => Isabelle_System.copy_file(sty, directory.doc_dir.file))
|
||||||
|
|
||||||
// create ontology.sty
|
// create ontology.sty
|
||||||
val ltx_styles = context.options.string("dof_ontologies").split(" +").map(s => regex.replaceAllIn(s,""))
|
val ltx_styles = context.options.string("dof_ontologies").split(" +").map(s => regex.replaceAllIn(s,""))
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
Prepare session root directory for Isabelle/DOF.
|
Prepare session root directory for Isabelle/DOF.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package isabelle_dof
|
package isabelle.dof
|
||||||
|
|
||||||
import isabelle._
|
import isabelle._
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package isabelle_dof
|
package isabelle.dof
|
||||||
|
|
||||||
import isabelle._
|
import isabelle._
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ fun string_2_theory_text_antiquotation ctxt text =
|
||||||
end
|
end
|
||||||
|
|
||||||
fun gen_text_antiquotation name reportNcheck compile =
|
fun gen_text_antiquotation name reportNcheck compile =
|
||||||
Document_Output.antiquotation_raw_embedded name (Scan.lift Args.text_input)
|
Document_Output.antiquotation_raw_embedded name (Scan.lift Parse.embedded_input)
|
||||||
(fn ctxt => fn text:Input.source =>
|
(fn ctxt => fn text:Input.source =>
|
||||||
let
|
let
|
||||||
val _ = reportNcheck ctxt text;
|
val _ = reportNcheck ctxt text;
|
||||||
|
@ -257,7 +257,7 @@ fun std_text_antiquotation name (* redefined in these more abstract terms *) =
|
||||||
|
|
||||||
(* should be the same as (2020):
|
(* should be the same as (2020):
|
||||||
fun text_antiquotation name =
|
fun text_antiquotation name =
|
||||||
Thy_Output.antiquotation_raw_embedded name (Scan.lift Args.text_input)
|
Thy_Output.antiquotation_raw_embedded name (Scan.lift Parse.embedded_input)
|
||||||
(fn ctxt => fn text =>
|
(fn ctxt => fn text =>
|
||||||
let
|
let
|
||||||
val _ = report_text ctxt text;
|
val _ = report_text ctxt text;
|
||||||
|
@ -273,7 +273,7 @@ fun std_theory_text_antiquotation name (* redefined in these more abstract terms
|
||||||
|
|
||||||
(* should be the same as (2020):
|
(* should be the same as (2020):
|
||||||
fun theory_text_antiquotation name =
|
fun theory_text_antiquotation name =
|
||||||
Thy_Output.antiquotation_raw_embedded name (Scan.lift Args.text_input)
|
Thy_Output.antiquotation_raw_embedded name (Scan.lift Parse.embedded_input)
|
||||||
(fn ctxt => fn text =>
|
(fn ctxt => fn text =>
|
||||||
let
|
let
|
||||||
val keywords = Thy_Header.get_keywords' ctxt;
|
val keywords = Thy_Header.get_keywords' ctxt;
|
||||||
|
|
Loading…
Reference in New Issue