author | wenzelm |
Sun, 25 Jun 2000 23:55:58 +0200 | |
changeset 9136 | 8196955b02ec |
parent 9044 | 28ee037278a6 |
child 9416 | 9144976964e7 |
permissions | -rw-r--r-- |
6203 | 1 |
(* Title: Pure/Thy/present.ML |
2 |
ID: $Id$ |
|
7727 | 3 |
Author: Stefan Berghofer and Markus Wenzel, TU Muenchen |
8808 | 4 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
6203 | 5 |
|
8196 | 6 |
Theory presentation (HTML, graph files, (PDF)LaTeX documents). |
6203 | 7 |
*) |
8 |
||
9 |
signature BASIC_PRESENT = |
|
10 |
sig |
|
7727 | 11 |
val section: string -> unit |
6203 | 12 |
end; |
13 |
||
14 |
signature PRESENT = |
|
15 |
sig |
|
7727 | 16 |
include BASIC_PRESENT |
8196 | 17 |
val init: bool -> string -> string list -> string -> Path.T option -> Url.T option * bool -> unit |
7727 | 18 |
val finish: unit -> unit |
19 |
val init_theory: string -> unit |
|
8192 | 20 |
val verbatim_source: string -> (unit -> Symbol.symbol list) -> unit |
21 |
val old_symbol_source: string -> (unit -> Symbol.symbol list) -> unit |
|
9136 | 22 |
val theory_output: string -> string -> unit |
7727 | 23 |
val begin_theory: string -> string list -> (Path.T * bool) list -> theory -> theory |
24 |
val result: string -> string -> thm -> unit |
|
25 |
val results: string -> string -> thm list -> unit |
|
26 |
val theorem: string -> thm -> unit |
|
27 |
val theorems: string -> thm list -> unit |
|
8088 | 28 |
val chapter: string -> unit |
7727 | 29 |
val subsection: string -> unit |
30 |
val subsubsection: string -> unit |
|
31 |
val setup: (theory -> theory) list |
|
7763 | 32 |
val get_info: theory -> {session: string list, is_local: bool} |
6203 | 33 |
end; |
34 |
||
7685 | 35 |
structure Present: PRESENT = |
36 |
struct |
|
37 |
||
7727 | 38 |
|
39 |
(** paths **) |
|
40 |
||
41 |
val output_path = Path.variable "ISABELLE_BROWSER_INFO"; |
|
42 |
||
43 |
val tex_ext = Path.ext "tex"; |
|
44 |
val tex_path = tex_ext o Path.basic; |
|
45 |
val html_ext = Path.ext "html"; |
|
46 |
val html_path = html_ext o Path.basic; |
|
47 |
val graph_path = Path.ext "graph" o Path.basic; |
|
48 |
val index_path = Path.basic "index.html"; |
|
49 |
val doc_path = Path.basic "document"; |
|
8196 | 50 |
val doc_indexN = "session"; |
7727 | 51 |
|
52 |
val session_path = Path.basic ".session"; |
|
53 |
val session_entries_path = Path.unpack ".session/entries"; |
|
54 |
val pre_index_path = Path.unpack ".session/pre-index"; |
|
55 |
||
9044 | 56 |
fun mk_rel_path [] ys = Path.make ys |
57 |
| mk_rel_path xs [] = Path.appends (replicate (length xs) Path.parent) |
|
58 |
| mk_rel_path (ps as x::xs) (qs as y::ys) = if x=y then mk_rel_path xs ys else |
|
59 |
Path.appends (replicate (length ps) Path.parent @ [Path.make qs]); |
|
7727 | 60 |
|
61 |
||
62 |
(** additional theory data **) |
|
63 |
||
64 |
structure BrowserInfoArgs = |
|
65 |
struct |
|
66 |
val name = "Pure/browser_info"; |
|
67 |
type T = {session: string list, is_local: bool}; |
|
68 |
||
69 |
val empty = {session = [], is_local = false}; |
|
70 |
val copy = I; |
|
7763 | 71 |
fun prep_ext _ = empty; |
7727 | 72 |
fun merge _ = empty; |
73 |
fun print _ _ = (); |
|
74 |
end; |
|
75 |
||
76 |
structure BrowserInfoData = TheoryDataFun(BrowserInfoArgs); |
|
77 |
||
78 |
fun get_info thy = |
|
79 |
if Theory.eq_thy (thy, ProtoPure.thy) then BrowserInfoArgs.empty |
|
80 |
else BrowserInfoData.get thy; |
|
81 |
||
82 |
||
83 |
||
84 |
(** graphs **) |
|
85 |
||
86 |
type graph_node = |
|
87 |
{name: string, ID: string, dir: string, unfold: bool, |
|
88 |
path: string, parents: string list}; |
|
89 |
||
90 |
fun get_graph path = map (fn (a :: b :: c :: d :: e :: r) => |
|
91 |
{name = unenclose a, ID = unenclose b, |
|
92 |
dir = unenclose c, unfold = (d = "+"), |
|
93 |
path = unenclose (if d = "+" then e else d), |
|
94 |
parents = map unenclose (fst (split_last (if d = "+" then tl r else r)))}) |
|
95 |
(map (filter_out (equal "") o space_explode " ") (split_lines (File.read path))); |
|
96 |
||
97 |
fun put_graph gr path = |
|
98 |
File.write path (cat_lines (map (fn {name, ID, dir, unfold, path, parents} => |
|
99 |
"\"" ^ name ^ "\" \"" ^ ID ^ "\" \"" ^ dir ^ (if unfold then "\" + \"" else "\" \"") ^ |
|
100 |
path ^ "\" > " ^ space_implode " " (map quote parents) ^ " ;") gr)); |
|
101 |
||
102 |
fun dir_of sess = space_implode "/" (case sess of |
|
103 |
[] => ["Pure"] | [x] => [x, "base"] | xs => xs); |
|
104 |
||
105 |
fun ID_of sess s = dir_of sess ^ "/" ^ s; |
|
106 |
||
107 |
||
108 |
(* retrieve graph data from theory loader database *) |
|
109 |
||
110 |
fun make_graph remote_path unfold curr_sess = map (fn name => |
|
111 |
let |
|
112 |
val {session, is_local} = get_info (ThyInfo.theory name); |
|
113 |
val path' = Path.append (Path.make session) (html_path name) |
|
114 |
in |
|
115 |
{name = name, ID = ID_of session name, dir = dir_of session, |
|
116 |
path = if null session then "" else |
|
117 |
if is_some remote_path andalso not is_local then |
|
9044 | 118 |
Url.pack (Url.append (the remote_path) (Url.file |
119 |
(Path.append (Path.make session) (html_path name)))) |
|
120 |
else Path.pack (Path.append |
|
121 |
(mk_rel_path curr_sess session) (html_path name)), |
|
7727 | 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, |
|
9044 | 160 |
if_none (try get_graph graph_path) (make_graph remote_path true [hd curr_sess])); |
7727 | 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, |
|
9044 | 219 |
doc_format: string, doc_prefixes: (Path.T * Path.T option) option, |
8196 | 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, |
9044 | 223 |
all_graph_path, remote_path) = |
7802 | 224 |
{name = name, parent = parent, session = session, path = path, html_prefix = html_prefix, |
9044 | 225 |
doc_format = doc_format, doc_prefixes = doc_prefixes, |
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 |
||
9044 | 272 |
fun copy_files path1 path2 = |
273 |
(File.mkdir path2; |
|
274 |
File.system_command |
|
275 |
("cp " ^ File.sysify_path path1 ^ " " ^ File.sysify_path path2)); |
|
276 |
||
8196 | 277 |
fun init false _ _ _ _ _ = (browser_info := empty_browser_info; session_info := None) |
278 |
| init true doc path name dump_path (remote_path, first_time) = |
|
7727 | 279 |
let |
280 |
val parent_name = name_of_session (take (length path - 1, path)); |
|
281 |
val session_name = name_of_session path; |
|
282 |
val sess_prefix = Path.make path; |
|
283 |
||
284 |
val out_path = Path.expand output_path; |
|
285 |
val html_prefix = Path.append out_path sess_prefix; |
|
286 |
||
8196 | 287 |
val (doc_prefixes, document_path) = |
7727 | 288 |
if doc = "" then (None, None) |
8196 | 289 |
else (Some (Path.append html_prefix doc_path, dump_path), Some (Path.ext doc doc_path)); |
7727 | 290 |
|
9044 | 291 |
val graph_up_lnk = (Url.file index_path, session_name); |
292 |
val all_graph_path = Path.appends [out_path, |
|
293 |
Path.basic (hd path), graph_path "all_sessions"]; |
|
7727 | 294 |
|
9044 | 295 |
val _ = |
296 |
(copy_files (Path.unpack "~~/lib/browser/awtUtilities/*.class") |
|
297 |
(Path.append html_prefix (Path.basic "awtUtilities")); |
|
298 |
copy_files (Path.unpack "~~/lib/browser/GraphBrowser/*.class") |
|
299 |
(Path.append html_prefix (Path.basic "GraphBrowser"))); |
|
7727 | 300 |
|
301 |
fun prep_readme readme = |
|
302 |
let val readme_path = Path.basic readme in |
|
303 |
if could_copy readme_path (Path.append html_prefix readme_path) then Some readme_path |
|
304 |
else None |
|
305 |
end; |
|
306 |
val opt_readme = |
|
307 |
(case prep_readme "README.html" of None => prep_readme "README" | some => some); |
|
308 |
||
309 |
val parent_index_path = Path.append Path.parent index_path; |
|
310 |
val index_up_lnk = if first_time then |
|
311 |
Url.append (the remote_path) (Url.file (Path.append sess_prefix parent_index_path)) |
|
312 |
else Url.file parent_index_path; |
|
313 |
||
314 |
val index_text = HTML.begin_index (index_up_lnk, parent_name) |
|
315 |
(Url.file index_path, session_name) (apsome Url.file opt_readme) |
|
9044 | 316 |
(apsome Url.file document_path) (Url.unpack "medium.html"); |
7727 | 317 |
in |
318 |
File.mkdir (Path.append html_prefix session_path); |
|
319 |
File.write (Path.append html_prefix session_entries_path) ""; |
|
8196 | 320 |
if is_some doc_prefixes then File.copy_all doc_path html_prefix else (); |
9044 | 321 |
seq (fn (name, txt) => File.write (Path.append html_prefix (Path.basic name)) txt) |
322 |
(HTML.applet_pages session_name graph_up_lnk (length path = 1)); |
|
7727 | 323 |
session_info := Some (make_session_info (name, parent_name, session_name, path, |
9044 | 324 |
html_prefix, doc, doc_prefixes, all_graph_path, remote_path)); |
7727 | 325 |
browser_info := initial_browser_info remote_path all_graph_path path; |
326 |
add_html_index index_text |
|
327 |
end; |
|
328 |
||
329 |
||
330 |
(* finish session *) |
|
7685 | 331 |
|
7802 | 332 |
fun isatool_document doc_format doc_prefix = |
8646
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
333 |
let |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
334 |
val cmd = "$ISATOOL document -c -o '" ^ doc_format ^ "' '" ^ File.sysify_path doc_prefix ^ "'"; |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
335 |
in |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
336 |
writeln cmd; |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
337 |
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
|
338 |
error "Failed to build document" |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
339 |
else () |
1a2c5ccebfdb
isatool document: check output file (workaround PolyML problem with RC);
wenzelm
parents:
8499
diff
changeset
|
340 |
end; |
7802 | 341 |
|
8196 | 342 |
fun write_tex src name path = Buffer.write (Path.append path (tex_path name)) src; |
343 |
||
344 |
fun write_texes src name (path, None) = write_tex src name path |
|
345 |
| write_texes src name (path, Some path') = (write_tex src name path; write_tex src name path'); |
|
346 |
||
347 |
||
7727 | 348 |
fun finish () = with_session () |
9044 | 349 |
(fn {name, html_prefix, doc_format, doc_prefixes, all_graph_path, path, ...} => |
7727 | 350 |
let |
351 |
val {theories, tex_index, html_index, graph, all_graph} = ! browser_info; |
|
352 |
||
353 |
fun finish_node (a, {tex_source, html_source = _, html}) = |
|
8196 | 354 |
(doc_prefixes |> apsome (write_texes tex_source a); |
7727 | 355 |
Buffer.write (Path.append html_prefix (html_path a)) (Buffer.add HTML.end_theory html)); |
356 |
in |
|
357 |
seq finish_node (Symtab.dest theories); |
|
358 |
Buffer.write (Path.append html_prefix pre_index_path) html_index; |
|
8196 | 359 |
doc_prefixes |> apsome (write_texes tex_index doc_indexN); |
360 |
doc_prefixes |> apsome (isatool_document doc_format o #1); |
|
9044 | 361 |
put_graph graph (Path.append html_prefix (graph_path "session")); |
7727 | 362 |
put_graph all_graph all_graph_path; |
363 |
create_index html_prefix; |
|
9136 | 364 |
if length path > 1 then update_index (Path.append html_prefix Path.parent) name else (); |
7727 | 365 |
browser_info := empty_browser_info; |
366 |
session_info := None |
|
367 |
end); |
|
368 |
||
369 |
||
370 |
(* theory elements *) |
|
371 |
||
372 |
fun init_theory name = with_session () (fn _ => init_theory_info name empty_theory_info); |
|
373 |
||
374 |
fun verbatim_source name mk_text = |
|
375 |
with_session () (fn _ => add_html_source name (HTML.verbatim_source (mk_text ()))); |
|
376 |
||
8192 | 377 |
fun old_symbol_source name mk_text = |
8499 | 378 |
with_session () (fn _ => add_tex_source name (Latex.old_symbol_source name (mk_text ()))); |
8192 | 379 |
|
9136 | 380 |
fun theory_output name s = |
381 |
with_session () (fn _ => add_tex_source name (Latex.isabelle_file s)); |
|
7727 | 382 |
|
383 |
||
384 |
fun parent_link remote_path curr_session name = |
|
9044 | 385 |
let val {session, is_local} = get_info (ThyInfo.theory name) |
7727 | 386 |
in (if null session then None else |
387 |
Some (if is_some remote_path andalso not is_local then |
|
9044 | 388 |
Url.append (the remote_path) (Url.file |
389 |
(Path.append (Path.make session) (html_path name))) |
|
390 |
else Url.file (Path.append (mk_rel_path curr_session session) |
|
391 |
(html_path name))), name) |
|
7727 | 392 |
end; |
393 |
||
394 |
fun begin_theory name raw_parents orig_files thy = |
|
395 |
with_session thy (fn {session, path, html_prefix, remote_path, ...} => |
|
396 |
let |
|
397 |
val parents = map (parent_link remote_path path) raw_parents; |
|
398 |
val ml_path = ThyLoad.ml_path name; |
|
399 |
val files = map (apsnd Some) orig_files @ |
|
400 |
(if is_some (ThyLoad.check_file ml_path) then [(ml_path, None)] else []); |
|
401 |
||
402 |
fun prep_file (raw_path, loadit) = |
|
403 |
(case ThyLoad.check_file raw_path of |
|
404 |
Some (path, _) => |
|
405 |
let |
|
406 |
val base = Path.base path; |
|
407 |
val base_html = html_ext base; |
|
408 |
in |
|
409 |
File.write (Path.append html_prefix base_html) |
|
410 |
(HTML.ml_file (Url.file base) (File.read path)); |
|
411 |
(Some (Url.file base_html), Url.file raw_path, loadit) |
|
412 |
end |
|
413 |
| None => (warning ("Browser info: expected to find ML file" ^ quote (Path.pack raw_path)); |
|
414 |
(None, Url.file raw_path, loadit))); |
|
415 |
||
416 |
val files_html = map prep_file files; |
|
417 |
||
418 |
fun prep_html_source (tex_source, html_source, html) = |
|
419 |
let |
|
420 |
val txt = HTML.begin_theory (Url.file index_path, session) |
|
421 |
name parents files_html (Buffer.content html_source) |
|
422 |
in (tex_source, Buffer.empty, Buffer.add txt html) end; |
|
423 |
||
424 |
fun make_entry unfold all = |
|
425 |
{name = name, ID = ID_of path name, dir = dir_of path, unfold = unfold, |
|
9044 | 426 |
path = Path.pack (Path.append |
427 |
(mk_rel_path (if all then [hd path] else path) path) (html_path name)), |
|
7727 | 428 |
parents = map (fn s => ID_of (#session (get_info (ThyInfo.theory s))) s) raw_parents}; |
429 |
||
430 |
in |
|
431 |
change_theory_info name prep_html_source; |
|
432 |
add_all_graph_entry (make_entry (length path = 1) true); |
|
433 |
add_graph_entry (make_entry true false); |
|
434 |
add_html_index (HTML.theory_entry (Url.file (html_path name), name)); |
|
435 |
add_tex_index (Latex.theory_entry name); |
|
436 |
BrowserInfoData.put {session = path, is_local = is_some remote_path} thy |
|
437 |
end); |
|
438 |
||
439 |
||
440 |
fun result k a thm = with_session () (fn _ => with_context add_html (HTML.result k a thm)); |
|
441 |
fun results k a thms = with_session () (fn _ => with_context add_html (HTML.results k a thms)); |
|
442 |
fun theorem a thm = with_session () (fn _ => with_context add_html (HTML.theorem a thm)); |
|
443 |
fun theorems a thms = with_session () (fn _ => with_context add_html (HTML.theorems a thms)); |
|
8088 | 444 |
fun chapter s = with_session () (fn _ => with_context add_html (HTML.chapter s)); |
7727 | 445 |
fun section s = with_session () (fn _ => with_context add_html (HTML.section s)); |
446 |
fun subsection s = with_session () (fn _ => with_context add_html (HTML.subsection s)); |
|
447 |
fun subsubsection s = with_session () (fn _ => with_context add_html (HTML.subsubsection s)); |
|
448 |
||
449 |
||
450 |
||
451 |
(** theory setup **) |
|
452 |
||
453 |
val setup = [BrowserInfoData.init]; |
|
7685 | 454 |
|
455 |
||
456 |
end; |
|
457 |
||
6203 | 458 |
|
459 |
structure BasicPresent: BASIC_PRESENT = Present; |
|
460 |
open BasicPresent; |