src/Pure/Thy/present.ML
changeset 42010 04f8c4851219
parent 42009 b008525c4399
child 42126 12875677300b
equal deleted inserted replaced
42009:b008525c4399 42010:04f8c4851219
   106 (*retrieve graph data from initial collection of theories*)
   106 (*retrieve graph data from initial collection of theories*)
   107 fun init_graph remote_path curr_sess = rev o map (fn thy =>
   107 fun init_graph remote_path curr_sess = rev o map (fn thy =>
   108   let
   108   let
   109     val name = Context.theory_name thy;
   109     val name = Context.theory_name thy;
   110     val {name = sess_name, session, is_local} = get_info thy;
   110     val {name = sess_name, session, is_local} = get_info thy;
   111     val path' = Path.append (Path.make session) (html_path name);
       
   112     val entry =
   111     val entry =
   113      {name = name, ID = ID_of session name, dir = sess_name,
   112      {name = name, ID = ID_of session name, dir = sess_name,
   114       path =
   113       path =
   115         if null session then "" else
   114         if null session then "" else
   116         if is_some remote_path andalso not is_local then
   115         if is_some remote_path andalso not is_local then
   171 fun init_theory_info name info =
   170 fun init_theory_info name info =
   172   change_browser_info (fn (theories, files, tex_index, html_index, graph) =>
   171   change_browser_info (fn (theories, files, tex_index, html_index, graph) =>
   173     (Symtab.update (name, info) theories, files, tex_index, html_index, graph));
   172     (Symtab.update (name, info) theories, files, tex_index, html_index, graph));
   174 
   173 
   175 fun change_theory_info name f =
   174 fun change_theory_info name f =
   176   change_browser_info (fn (info as (theories, files, tex_index, html_index, graph)) =>
   175   change_browser_info (fn (theories, files, tex_index, html_index, graph) =>
   177     (case Symtab.lookup theories name of
   176     (case Symtab.lookup theories name of
   178       NONE => error ("Browser info: cannot access theory document " ^ quote name)
   177       NONE => error ("Browser info: cannot access theory document " ^ quote name)
   179     | SOME info => (Symtab.update (name, map_theory_info f info) theories, files,
   178     | SOME info => (Symtab.update (name, map_theory_info f info) theories, files,
   180         tex_index, html_index, graph)));
   179         tex_index, html_index, graph)));
   181 
   180 
   201   else change_theory_info name (fn (tex_source, html_source, html) =>
   200   else change_theory_info name (fn (tex_source, html_source, html) =>
   202     (Buffer.add txt tex_source, html_source, html));
   201     (Buffer.add txt tex_source, html_source, html));
   203 
   202 
   204 fun add_html_source name txt = change_theory_info name (fn (tex_source, html_source, html) =>
   203 fun add_html_source name txt = change_theory_info name (fn (tex_source, html_source, html) =>
   205   (tex_source, Buffer.add txt html_source, html));
   204   (tex_source, Buffer.add txt html_source, html));
   206 
       
   207 fun add_html name txt = change_theory_info name (fn (tex_source, html_source, html) =>
       
   208   (tex_source, html_source, Buffer.add txt html));
       
   209 
   205 
   210 
   206 
   211 
   207 
   212 (** global session state **)
   208 (** global session state **)
   213 
   209