def all_document_theories: List[Document.Node.Name] =
session_background match { case Some(background) => background.base.all_document_theories case None => Nil
}
def active_document_theories: List[Document.Node.Name] = if (is_active) all_document_theories else Nil
def select(
theories: Iterable[String],
set: Boolean = false,
toggle: Boolean = false
): State = {
copy(selection =
theories.foldLeft(selection) { case (sel, theory) => val b = if (toggle) !selection(theory) else set if (b) sel + theory else sel - theory
})
}
def register_view(id: AnyRef): State = copy(views = views + id) def unregister_view(id: AnyRef): State = copy(views = views - id)
def session(pide_session: isabelle.Session): Session = { val background = session_background.filter(_.info.documents.nonEmpty) val snapshot = if (background.isEmpty) None else { val snapshot = pide_session.snapshot() def document_ready(theory: String): Boolean =
pide_session.resources.loaded_theory(theory) ||
snapshot.theory_consolidated(theory) if (snapshot.is_outdated || !selection.forall(document_ready)) None else Some(snapshot)
}
Session(background, selection, snapshot)
}
}
/* build */
def build(
session_context: Export.Session_Context,
document_session: Document_Editor.Session,
progress: Progress
): Unit = { val session_background = document_session.get_background val context =
Document_Build.context(session_context,
document_session = Some(session_background.base),
document_selection = document_session.selection,
progress = progress)
Isabelle_System.make_directory(document_output_dir())
Isabelle_System.with_tmp_dir("document") { tmp_dir => val engine = context.get_engine() val variant = document_session.get_variant val directory = engine.prepare_directory(context, tmp_dir, variant, verbose = true) val ok =
Meta_Info.read() match { case Some(meta_info) =>
meta_info.check_files() && meta_info.sources == directory.sources case None => false
} if (!ok) {
write_document(document_session.selection,
engine.build_document(context, directory, verbose = true))
}
}
}
}
¤ Dauer der Verarbeitung: 0.22 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.