More accurate treatment of sty files: do not just copy from all examples.
This commit is contained in:
parent
15feeb7d92
commit
5ac41a72ac
|
@ -31,7 +31,6 @@
|
||||||
package isabelle.dof
|
package isabelle.dof
|
||||||
|
|
||||||
import isabelle._
|
import isabelle._
|
||||||
import java.io.{File => JFile}
|
|
||||||
|
|
||||||
|
|
||||||
object DOF_Document_Build
|
object DOF_Document_Build
|
||||||
|
@ -59,22 +58,22 @@ object DOF_Document_Build
|
||||||
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 dof_home= Path.explode(Isabelle_System.getenv_strict("ISABELLE_DOF_HOME"));
|
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 = dof_home + Path.explode("src/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("src/DOF/latex"), Path.explode("src/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((dof_home + 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,""))
|
||||||
|
|
Loading…
Reference in New Issue