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