src/Pure/Thy/present.ML
changeset 37939 965537d86fcc
parent 37216 3165bc303f66
child 37940 4857eab31298
equal deleted inserted replaced
37938:445e5a3244cc 37939:965537d86fcc
   458   let
   458   let
   459     val name = Context.theory_name thy;
   459     val name = Context.theory_name thy;
   460     val parents = Theory.parents_of thy;
   460     val parents = Theory.parents_of thy;
   461     val parent_specs = map (parent_link remote_path path) parents;
   461     val parent_specs = map (parent_link remote_path path) parents;
   462 
   462 
   463     fun prep_file (raw_path, loadit) =
   463     val files_html = files |> map (fn (raw_path, loadit) =>
   464       (case Thy_Load.check_ml dir raw_path of
   464       let
   465         SOME (path, _) =>
   465         val path = #1 (Thy_Load.check_file dir raw_path);
   466           let
   466         val base = Path.base path;
   467             val base = Path.base path;
   467         val base_html = html_ext base;
   468             val base_html = html_ext base;
   468         val _ = add_file (Path.append html_prefix base_html,
   469             val _ = add_file (Path.append html_prefix base_html,
   469           HTML.ml_file (Url.File base) (File.read path));
   470               HTML.ml_file (Url.File base) (File.read path));
   470       in (Url.File base_html, Url.File raw_path, loadit) end);
   471             in (Url.File base_html, Url.File raw_path, loadit) end
       
   472       | NONE => error ("Browser info: expected to find ML file " ^ quote (Path.implode raw_path)));
       
   473 
       
   474     val files_html = map prep_file files;
       
   475 
   471 
   476     fun prep_html_source (tex_source, html_source, html) =
   472     fun prep_html_source (tex_source, html_source, html) =
   477       let
   473       let
   478         val txt = HTML.begin_theory (Url.File index_path, session)
   474         val txt = HTML.begin_theory (Url.File index_path, session)
   479           name parent_specs files_html (Buffer.content html_source)
   475           name parent_specs files_html (Buffer.content html_source)