author | wenzelm |
Thu, 27 Sep 2001 12:24:19 +0200 | |
changeset 11580 | a8409fa3985c |
parent 11057 | e68becb804fe |
child 11856 | a35af478aee4 |
permissions | -rw-r--r-- |
6203 | 1 |
(* Title: Pure/Thy/present.ML |
2 |
ID: $Id$ |
|
9416 | 3 |
Author: Markus Wenzel and Stefan Berghofer, TU Muenchen |
8808 | 4 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
6203 | 5 |
|
9416 | 6 |
Theory presentation: HTML, graph files, (PDF)LaTeX documents. |
6203 | 7 |
*) |
8 |
||
9 |
signature BASIC_PRESENT = |
|
10 |
sig |
|
11057 | 11 |
val no_document: ('a -> 'b) -> 'a -> 'b |
7727 | 12 |
val section: string -> unit |
6203 | 13 |
end; |
14 |
||
15 |
signature PRESENT = |
|
16 |
sig |
|
7727 | 17 |
include BASIC_PRESENT |
9452 | 18 |
val write_graph: {name: string, ID: string, dir: string, unfold: bool, |
19 |
path: string, parents: string list} list -> Path.T -> unit |
|
11580 | 20 |
val init: bool -> string -> string list -> string -> Path.T option |
21 |
-> Url.T option * bool -> bool -> unit |
|
7727 | 22 |
val finish: unit -> unit |
23 |
val init_theory: string -> unit |
|
8192 | 24 |
val verbatim_source: string -> (unit -> Symbol.symbol list) -> unit |
25 |
val old_symbol_source: string -> (unit -> Symbol.symbol list) -> unit |
|
9136 | 26 |
val theory_output: string -> string -> unit |
7727 | 27 |
val begin_theory: string -> string list -> (Path.T * bool) list -> theory -> theory |
28 |
val result: string -> string -> thm -> unit |
|
29 |
val results: string -> string -> thm list -> unit |
|
30 |
val theorem: string -> thm -> unit |
|
31 |
val theorems: string -> thm list -> unit |
|
8088 | 32 |
val chapter: string -> unit |
7727 | 33 |
val subsection: string -> unit |
34 |
val subsubsection: string -> unit |
|
35 |
val setup: (theory -> theory) list |
|
9416 | 36 |
val get_info: theory -> {name: string, session: string list, is_local: bool} |
6203 | 37 |
end; |
38 |
||
7685 | 39 |
structure Present: PRESENT = |
40 |
struct |
|
41 |
||
7727 | 42 |
|
43 |
(** paths **) |
|
44 |
||
45 |
val output_path = Path.variable "ISABELLE_BROWSER_INFO"; |
|
46 |
||
47 |
val tex_ext = Path.ext "tex"; |
|
48 |
val tex_path = tex_ext o Path.basic; |
|
49 |
val html_ext = Path.ext "html"; |
|
50 |
val html_path = html_ext o Path.basic; |
|
51 |
val graph_path = Path.ext "graph" o Path.basic; |
|
52 |
val index_path = Path.basic "index.html"; |
|
53 |
val doc_path = Path.basic "document"; |
|
8196 | 54 |
val doc_indexN = "session"; |
7727 | 55 |
|
56 |
val session_path = Path.basic ".session"; |
|
57 |
val session_entries_path = Path.unpack ".session/entries"; |
|
58 |
val pre_index_path = Path.unpack ".session/pre-index"; |
|
59 |
||
9044 | 60 |
fun mk_rel_path [] ys = Path.make ys |
61 |
| mk_rel_path xs [] = Path.appends (replicate (length xs) Path.parent) |
|
9416 | 62 |
| mk_rel_path (ps as x :: xs) (qs as y :: ys) = if x = y then mk_rel_path xs ys else |
9044 | 63 |
Path.appends (replicate (length ps) Path.parent @ [Path.make qs]); |
7727 | 64 |
|
65 |
||
66 |
(** additional theory data **) |
|
67 |
||
68 |
structure BrowserInfoArgs = |
|
69 |
struct |
|
70 |
val name = "Pure/browser_info"; |
|
9416 | 71 |
type T = {name: string, session: string list, is_local: bool}; |
7727 | 72 |
|
9416 | 73 |
val empty = {name = "Pure", session = [], is_local = false}; |
7727 | 74 |
val copy = I; |
9452 | 75 |
fun prep_ext _ = {name = "", session = [], is_local = false}; |
7727 | 76 |
fun merge _ = empty; |
77 |
fun print _ _ = (); |
|
78 |
end; |
|
79 |
||
80 |
structure BrowserInfoData = TheoryDataFun(BrowserInfoArgs); |
|
81 |
||
82 |
fun get_info thy = |
|
83 |
if Theory.eq_thy (thy, ProtoPure.thy) then BrowserInfoArgs.empty |
|
84 |
else BrowserInfoData.get thy; |
|
85 |
||
86 |
||
87 |
||
88 |
(** graphs **) |
|
89 |
||
90 |
type graph_node = |
|
91 |
{name: string, ID: string, dir: string, unfold: bool, |
|
92 |
path: string, parents: string list}; |
|
93 |
||
9416 | 94 |
fun write_graph gr path = |
95 |
File.write path (cat_lines (map (fn {name, ID, dir, unfold, path, parents} => |
|
96 |
"\"" ^ name ^ "\" \"" ^ ID ^ "\" \"" ^ dir ^ (if unfold then "\" + \"" else "\" \"") ^ |
|
97 |
path ^ "\" > " ^ space_implode " " (map quote parents) ^ " ;") gr)); |
|
7727 | 98 |
|
9416 | 99 |
fun ID_of sess s = space_implode "/" (sess @ [s]); |
7727 | 100 |
|
9416 | 101 |
(*retrieve graph data from initial theory loader database*) |
102 |
fun init_graph remote_path curr_sess = map (fn name => |
|
7727 | 103 |
let |
9416 | 104 |
val {name = sess_name, session, is_local} = get_info (ThyInfo.theory name); |
105 |
val path' = Path.append (Path.make session) (html_path name); |
|
7727 | 106 |
in |
9416 | 107 |
{name = name, ID = ID_of session name, dir = sess_name, |
108 |
path = |
|
109 |
if null session then "" else |
|
110 |
if is_some remote_path andalso not is_local then |
|
111 |
Url.pack (Url.append (the remote_path) (Url.file |
|
112 |
(Path.append (Path.make session) (html_path name)))) |
|
113 |
else Path.pack (Path.append (mk_rel_path curr_sess session) (html_path name)), |
|
114 |
unfold = false, |
|
115 |
parents = |
|
116 |
map (fn s => ID_of (#session (get_info (ThyInfo.theory s))) s) (ThyInfo.get_preds name)} |
|
7727 | 117 |
end) (ThyInfo.names ()); |
118 |
||
9416 | 119 |
fun ins_graph_entry (entry as {ID, ...}) (gr: graph_node list) = |
7727 | 120 |
filter_out (fn entry' => #ID entry' = ID) gr @ [entry]; |
121 |
||
122 |
||
123 |
||
124 |
(** global browser info state **) |
|
125 |
||
126 |
(* type theory_info *) |
|
127 |
||
128 |
type theory_info = {tex_source: Buffer.T, html_source: Buffer.T, html: Buffer.T}; |
|
129 |
||
130 |
fun make_theory_info (tex_source, html_source, html) = |
|
131 |
{tex_source = tex_source, html_source = html_source, html = html}: theory_info; |
|
132 |
||
133 |
val empty_theory_info = make_theory_info (Buffer.empty, Buffer.empty, Buffer.empty); |
|
134 |
||
135 |
fun map_theory_info f {tex_source, html_source, html} = |
|
136 |
make_theory_info (f (tex_source, html_source, html)); |
|
137 |
||
138 |
||
139 |
(* type browser_info *) |
|
140 |
||
141 |
type browser_info = {theories: theory_info Symtab.table, tex_index: Buffer.T, |
|
9416 | 142 |
html_index: Buffer.T, graph: graph_node list}; |
7727 | 143 |
|
9416 | 144 |
fun make_browser_info (theories, tex_index, html_index, graph) = |
7727 | 145 |
{theories = theories, tex_index = tex_index, html_index = html_index, |
9416 | 146 |
graph = graph}: browser_info; |
7727 | 147 |
|
9416 | 148 |
val empty_browser_info = make_browser_info (Symtab.empty, Buffer.empty, Buffer.empty, []); |
7727 | 149 |
|
9416 | 150 |
fun init_browser_info remote_path curr_sess = make_browser_info |
151 |
(Symtab.empty, Buffer.empty, Buffer.empty, init_graph remote_path curr_sess); |
|
7727 | 152 |
|
9416 | 153 |
fun map_browser_info f {theories, tex_index, html_index, graph} = |
154 |
make_browser_info (f (theories, tex_index, html_index, graph)); |
|
7727 | 155 |
|
156 |
||
157 |
(* state *) |
|
158 |
||
159 |
val browser_info = ref empty_browser_info; |
|
11057 | 160 |
fun change_browser_info f = browser_info := map_browser_info f (! browser_info); |
7727 | 161 |
|
11057 | 162 |
val suppress_tex_source = ref false; |
163 |
fun no_document f x = Library.setmp suppress_tex_source true f x; |
|
7727 | 164 |
|
165 |
fun init_theory_info name info = |
|
9416 | 166 |
change_browser_info (fn (theories, tex_index, html_index, graph) => |
167 |
(Symtab.update ((name, info), theories), tex_index, html_index, graph)); |
|
7727 | 168 |
|
169 |
fun change_theory_info name f = |
|
9416 | 170 |
change_browser_info (fn (info as (theories, tex_index, html_index, graph)) => |
7727 | 171 |
(case Symtab.lookup (theories, name) of |
172 |
None => (warning ("Browser info: cannot access theory document " ^ quote name); info) |
|
173 |
| Some info => (Symtab.update ((name, map_theory_info f info), theories), |
|
9416 | 174 |
tex_index, html_index, graph))); |
7727 | 175 |
|
176 |
||
177 |
fun add_tex_index txt = |
|
9416 | 178 |
change_browser_info (fn (theories, tex_index, html_index, graph) => |
179 |
(theories, Buffer.add txt tex_index, html_index, graph)); |
|
7727 | 180 |
|
181 |
fun add_html_index txt = |
|
9416 | 182 |
change_browser_info (fn (theories, tex_index, html_index, graph) => |
183 |
(theories, tex_index, Buffer.add txt html_index, graph)); |
|
7727 | 184 |
|
185 |
fun add_graph_entry e = |
|
9416 | 186 |
change_browser_info (fn (theories, tex_index, html_index, graph) => |
187 |
(theories, tex_index, html_index, ins_graph_entry e graph)); |
|
7727 | 188 |
|
11057 | 189 |
fun add_tex_source name txt = |
190 |
if ! suppress_tex_source then () |
|
191 |
else change_theory_info name (fn (tex_source, html_source, html) => |
|
192 |
(Buffer.add txt tex_source, html_source, html)); |
|
7727 | 193 |
|
194 |
fun add_html_source name txt = change_theory_info name (fn (tex_source, html_source, html) => |
|
195 |
(tex_source, Buffer.add txt html_source, html)); |
|
196 |
||
197 |
fun add_html name txt = change_theory_info name (fn (tex_source, html_source, html) => |
|
198 |
(tex_source, html_source, Buffer.add txt html)); |
|
199 |
||
200 |
||
201 |
||
202 |
(** global session state **) |
|
203 |
||
204 |
(* session_info *) |
|
205 |
||
206 |
type session_info = |
|
207 |
{name: string, parent: string, session: string, path: string list, html_prefix: Path.T, |
|
11580 | 208 |
doc_format: string, doc_prefixes: (Path.T * Path.T option) option, |
209 |
remote_path: Url.T option, verbose: bool}; |
|
7727 | 210 |
|
9416 | 211 |
fun make_session_info |
11580 | 212 |
(name, parent, session, path, html_prefix, doc_format, doc_prefixes, remote_path, verbose) = |
7802 | 213 |
{name = name, parent = parent, session = session, path = path, html_prefix = html_prefix, |
11580 | 214 |
doc_format = doc_format, doc_prefixes = doc_prefixes, remote_path = remote_path, |
215 |
verbose = verbose}: session_info; |
|
7685 | 216 |
|
217 |
||
7727 | 218 |
(* state *) |
219 |
||
220 |
val session_info = ref (None: session_info option); |
|
221 |
||
222 |
fun with_session x f = (case ! session_info of None => x | Some info => f info); |
|
223 |
fun with_context f = f (PureThy.get_name (Context.the_context ())); |
|
224 |
||
225 |
||
226 |
||
227 |
(** HTML output **) |
|
228 |
||
229 |
(* maintain index *) |
|
230 |
||
231 |
val session_entries = |
|
232 |
HTML.session_entries o |
|
233 |
map (fn name => (Url.file (Path.append (Path.basic name) index_path), name)); |
|
234 |
||
235 |
fun get_entries dir = |
|
236 |
split_lines (File.read (Path.append dir session_entries_path)); |
|
237 |
||
238 |
fun put_entries entries dir = |
|
239 |
File.write (Path.append dir session_entries_path) (cat_lines entries); |
|
240 |
||
241 |
||
242 |
fun create_index dir = |
|
243 |
File.read (Path.append dir pre_index_path) ^ |
|
244 |
session_entries (get_entries dir) ^ HTML.end_index |
|
245 |
|> File.write (Path.append dir index_path); |
|
246 |
||
247 |
fun update_index dir name = |
|
248 |
(case try get_entries dir of |
|
249 |
None => warning ("Browser info: cannot access session index of " ^ quote (Path.pack dir)) |
|
250 |
| Some es => (put_entries ((es \ name) @ [name]) dir; create_index dir)); |
|
251 |
||
252 |
||
253 |
(* init session *) |
|
254 |
||
255 |
fun name_of_session elems = space_implode "/" ("Isabelle" :: elems); |
|
256 |
||
257 |
fun could_copy inpath outpath = |
|
258 |
if File.exists inpath then (File.copy inpath outpath; true) |
|
259 |
else false; |
|
260 |
||
9044 | 261 |
fun copy_files path1 path2 = |
262 |
(File.mkdir path2; |
|
9795 | 263 |
File.system_command (*FIXME: quote paths!?*) |
264 |
("cp " ^ File.sysify_path path1 ^ " " ^ File.sysify_path path2)); |
|
9044 | 265 |
|
9416 | 266 |
|
11580 | 267 |
fun init false _ _ _ _ _ _ = (browser_info := empty_browser_info; session_info := None) |
268 |
| init true doc path name dump_path (remote_path, first_time) verbose = |
|
7727 | 269 |
let |
9416 | 270 |
val parent_name = name_of_session (Library.take (length path - 1, path)); |
7727 | 271 |
val session_name = name_of_session path; |
272 |
val sess_prefix = Path.make path; |
|
273 |
||
274 |
val out_path = Path.expand output_path; |
|
275 |
val html_prefix = Path.append out_path sess_prefix; |
|
276 |
||
8196 | 277 |
val (doc_prefixes, document_path) = |
7727 | 278 |
if doc = "" then (None, None) |
8196 | 279 |
else (Some (Path.append html_prefix doc_path, dump_path), Some (Path.ext doc doc_path)); |
7727 | 280 |
|
9044 | 281 |
val graph_up_lnk = (Url.file index_path, session_name); |
7727 | 282 |
|
9044 | 283 |
val _ = |
284 |
(copy_files (Path.unpack "~~/lib/browser/awtUtilities/*.class") |
|
285 |
(Path.append html_prefix (Path.basic "awtUtilities")); |
|
286 |
copy_files (Path.unpack "~~/lib/browser/GraphBrowser/*.class") |
|
287 |
(Path.append html_prefix (Path.basic "GraphBrowser"))); |
|
7727 | 288 |
|
289 |
fun prep_readme readme = |
|
290 |
let val readme_path = Path.basic readme in |
|
291 |
if could_copy readme_path (Path.append html_prefix readme_path) then Some readme_path |
|
292 |
else None |
|
293 |
end; |
|
294 |
val opt_readme = |
|
295 |
(case prep_readme "README.html" of None => prep_readme "README" | some => some); |
|
296 |
||
297 |
val parent_index_path = Path.append Path.parent index_path; |
|
298 |
val index_up_lnk = if first_time then |
|
299 |
Url.append (the remote_path) (Url.file (Path.append sess_prefix parent_index_path)) |
|
300 |
else Url.file parent_index_path; |
|
301 |
||
302 |
val index_text = HTML.begin_index (index_up_lnk, parent_name) |
|
303 |
(Url.file index_path, session_name) (apsome Url.file opt_readme) |
|
9044 | 304 |
(apsome Url.file document_path) (Url.unpack "medium.html"); |
7727 | 305 |
in |
306 |
File.mkdir (Path.append html_prefix session_path); |
|
307 |
File.write (Path.append html_prefix session_entries_path) ""; |
|
8196 | 308 |
if is_some doc_prefixes then File.copy_all doc_path html_prefix else (); |
9044 | 309 |
seq (fn (name, txt) => File.write (Path.append html_prefix (Path.basic name)) txt) |
9416 | 310 |
(HTML.applet_pages session_name graph_up_lnk); |
7727 | 311 |
session_info := Some (make_session_info (name, parent_name, session_name, path, |
11580 | 312 |
html_prefix, doc, doc_prefixes, remote_path, verbose)); |
9416 | 313 |
browser_info := init_browser_info remote_path path; |
7727 | 314 |
add_html_index index_text |
315 |
end; |
|
316 |
||
317 |
||
318 |
(* finish session *) |
|
7685 | 319 |
|
11580 | 320 |
fun isatool_document verbose doc_format doc_prefix = |
8646
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
321 |
let |
11580 | 322 |
val cmd = "\"$ISATOOL\" document -c -o '" ^ doc_format ^ "' " |
323 |
^ (if verbose then "-v " else "") ^ File.quote_sysify_path doc_prefix; |
|
8646
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
324 |
in |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
325 |
writeln cmd; |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
326 |
if system cmd <> 0 orelse not (File.exists (Path.ext doc_format doc_prefix)) then |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
327 |
error "Failed to build document" |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
328 |
else () |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
329 |
end; |
7802 | 330 |
|
8196 | 331 |
fun write_tex src name path = Buffer.write (Path.append path (tex_path name)) src; |
332 |
||
333 |
fun write_texes src name (path, None) = write_tex src name path |
|
334 |
| write_texes src name (path, Some path') = (write_tex src name path; write_tex src name path'); |
|
335 |
||
336 |
||
7727 | 337 |
fun finish () = with_session () |
11580 | 338 |
(fn {name, html_prefix, doc_format, doc_prefixes, path, verbose, ...} => |
7727 | 339 |
let |
9416 | 340 |
val {theories, tex_index, html_index, graph} = ! browser_info; |
341 |
val parent_html_prefix = Path.append html_prefix Path.parent; |
|
7727 | 342 |
|
343 |
fun finish_node (a, {tex_source, html_source = _, html}) = |
|
8196 | 344 |
(doc_prefixes |> apsome (write_texes tex_source a); |
7727 | 345 |
Buffer.write (Path.append html_prefix (html_path a)) (Buffer.add HTML.end_theory html)); |
346 |
in |
|
347 |
seq finish_node (Symtab.dest theories); |
|
348 |
Buffer.write (Path.append html_prefix pre_index_path) html_index; |
|
9708 | 349 |
doc_prefixes |> apsome (write_texes (Buffer.add Latex.tex_trailer tex_index) doc_indexN); |
11580 | 350 |
doc_prefixes |> apsome (isatool_document verbose doc_format o #1); |
9416 | 351 |
write_graph graph (Path.append html_prefix (graph_path "session")); |
7727 | 352 |
create_index html_prefix; |
9416 | 353 |
if length path > 1 then update_index parent_html_prefix name else (); |
7727 | 354 |
browser_info := empty_browser_info; |
355 |
session_info := None |
|
356 |
end); |
|
357 |
||
358 |
||
359 |
(* theory elements *) |
|
360 |
||
361 |
fun init_theory name = with_session () (fn _ => init_theory_info name empty_theory_info); |
|
362 |
||
363 |
fun verbatim_source name mk_text = |
|
364 |
with_session () (fn _ => add_html_source name (HTML.verbatim_source (mk_text ()))); |
|
365 |
||
8192 | 366 |
fun old_symbol_source name mk_text = |
8499 | 367 |
with_session () (fn _ => add_tex_source name (Latex.old_symbol_source name (mk_text ()))); |
8192 | 368 |
|
9136 | 369 |
fun theory_output name s = |
9917 | 370 |
with_session () (fn _ => add_tex_source name (Latex.isabelle_file name s)); |
7727 | 371 |
|
372 |
||
373 |
fun parent_link remote_path curr_session name = |
|
9416 | 374 |
let val {name = _, session, is_local} = get_info (ThyInfo.theory name) |
7727 | 375 |
in (if null session then None else |
376 |
Some (if is_some remote_path andalso not is_local then |
|
9044 | 377 |
Url.append (the remote_path) (Url.file |
378 |
(Path.append (Path.make session) (html_path name))) |
|
379 |
else Url.file (Path.append (mk_rel_path curr_session session) |
|
380 |
(html_path name))), name) |
|
7727 | 381 |
end; |
382 |
||
383 |
fun begin_theory name raw_parents orig_files thy = |
|
9416 | 384 |
with_session thy (fn {name = sess_name, session, path, html_prefix, remote_path, ...} => |
7727 | 385 |
let |
386 |
val parents = map (parent_link remote_path path) raw_parents; |
|
387 |
val ml_path = ThyLoad.ml_path name; |
|
388 |
val files = map (apsnd Some) orig_files @ |
|
389 |
(if is_some (ThyLoad.check_file ml_path) then [(ml_path, None)] else []); |
|
390 |
||
391 |
fun prep_file (raw_path, loadit) = |
|
392 |
(case ThyLoad.check_file raw_path of |
|
393 |
Some (path, _) => |
|
394 |
let |
|
395 |
val base = Path.base path; |
|
396 |
val base_html = html_ext base; |
|
397 |
in |
|
398 |
File.write (Path.append html_prefix base_html) |
|
399 |
(HTML.ml_file (Url.file base) (File.read path)); |
|
400 |
(Some (Url.file base_html), Url.file raw_path, loadit) |
|
401 |
end |
|
402 |
| None => (warning ("Browser info: expected to find ML file" ^ quote (Path.pack raw_path)); |
|
403 |
(None, Url.file raw_path, loadit))); |
|
404 |
||
405 |
val files_html = map prep_file files; |
|
406 |
||
407 |
fun prep_html_source (tex_source, html_source, html) = |
|
408 |
let |
|
409 |
val txt = HTML.begin_theory (Url.file index_path, session) |
|
410 |
name parents files_html (Buffer.content html_source) |
|
411 |
in (tex_source, Buffer.empty, Buffer.add txt html) end; |
|
412 |
||
9416 | 413 |
val entry = |
414 |
{name = name, ID = ID_of path name, dir = sess_name, unfold = true, |
|
415 |
path = Path.pack (html_path name), |
|
416 |
parents = map (fn s => ID_of (#session (get_info (ThyInfo.theory s))) s) raw_parents}; |
|
7727 | 417 |
|
418 |
in |
|
419 |
change_theory_info name prep_html_source; |
|
9416 | 420 |
add_graph_entry entry; |
7727 | 421 |
add_html_index (HTML.theory_entry (Url.file (html_path name), name)); |
422 |
add_tex_index (Latex.theory_entry name); |
|
9416 | 423 |
BrowserInfoData.put {name = sess_name, session = path, is_local = is_some remote_path} thy |
7727 | 424 |
end); |
425 |
||
426 |
||
427 |
fun result k a thm = with_session () (fn _ => with_context add_html (HTML.result k a thm)); |
|
428 |
fun results k a thms = with_session () (fn _ => with_context add_html (HTML.results k a thms)); |
|
429 |
fun theorem a thm = with_session () (fn _ => with_context add_html (HTML.theorem a thm)); |
|
430 |
fun theorems a thms = with_session () (fn _ => with_context add_html (HTML.theorems a thms)); |
|
8088 | 431 |
fun chapter s = with_session () (fn _ => with_context add_html (HTML.chapter s)); |
7727 | 432 |
fun section s = with_session () (fn _ => with_context add_html (HTML.section s)); |
433 |
fun subsection s = with_session () (fn _ => with_context add_html (HTML.subsection s)); |
|
434 |
fun subsubsection s = with_session () (fn _ => with_context add_html (HTML.subsubsection s)); |
|
435 |
||
436 |
||
437 |
||
438 |
(** theory setup **) |
|
439 |
||
440 |
val setup = [BrowserInfoData.init]; |
|
7685 | 441 |
|
442 |
||
443 |
end; |
|
444 |
||
6203 | 445 |
|
446 |
structure BasicPresent: BASIC_PRESENT = Present; |
|
447 |
open BasicPresent; |