src/Pure/Thy/browser_info.scala
changeset 75981 a1b131d5575f
parent 75980 232beef27a17
child 75982 2fff9ce6b460
equal deleted inserted replaced
75980:232beef27a17 75981:a1b131d5575f
   183       document_info.theory_by_file(session, file)
   183       document_info.theory_by_file(session, file)
   184 
   184 
   185     def session_chapter(session: String): String =
   185     def session_chapter(session: String): String =
   186       sessions_structure(session).chapter
   186       sessions_structure(session).chapter
   187 
   187 
       
   188     def chapter_dir(session: String): Path =
       
   189       root_dir + Path.basic(session_chapter(session))
       
   190 
   188     def session_dir(session: String): Path =
   191     def session_dir(session: String): Path =
   189       root_dir + Path.basic(session_chapter(session)) + Path.basic(session)
   192       chapter_dir(session) + Path.basic(session)
   190 
       
   191     def chapter_dir(chapter: String): Path =
       
   192       root_dir + Path.basic(chapter)
       
   193 
   193 
   194     def theory_dir(theory: Document_Info.Theory): Path =
   194     def theory_dir(theory: Document_Info.Theory): Path =
   195       session_dir(theory.dynamic_session)
   195       session_dir(theory.dynamic_session)
   196 
   196 
   197     def theory_html(theory: Document_Info.Theory): Path =
   197     def theory_html(theory: Document_Info.Theory): Path =
   271 
   271 
   272 
   272 
   273     /* maintain presentation structure */
   273     /* maintain presentation structure */
   274 
   274 
   275     def update_chapter(session_name: String, session_description: String): Unit = synchronized {
   275     def update_chapter(session_name: String, session_description: String): Unit = synchronized {
   276       val chapter = session_chapter(session_name)
   276       val dir = Meta_Data.init_directory(chapter_dir(session_name))
   277       val dir = Meta_Data.init_directory(chapter_dir(chapter))
       
   278       Meta_Data.change(dir, Meta_Data.INDEX) { text =>
   277       Meta_Data.change(dir, Meta_Data.INDEX) { text =>
   279         val index0 = Meta_Data.Index.parse(text, "chapter")
   278         val index0 = Meta_Data.Index.parse(text, "chapter")
   280         val item = Meta_Data.Item(session_name, description = session_description)
   279         val item = Meta_Data.Item(session_name, description = session_description)
   281         val index = index0 + item
   280         val index = index0 + item
   282         val sessions = index.items
   281         val sessions = index.items
   283 
   282 
   284         if (index != index0) {
   283         if (index != index0) {
   285           val title = "Isabelle/" + chapter + " sessions"
   284           val title = "Isabelle/" + session_chapter(session_name) + " sessions"
   286           HTML.write_document(dir, "index.html",
   285           HTML.write_document(dir, "index.html",
   287             List(HTML.title(title + Isabelle_System.isabelle_heading())),
   286             List(HTML.title(title + Isabelle_System.isabelle_heading())),
   288             HTML.chapter(title) ::
   287             HTML.chapter(title) ::
   289               (if (sessions.isEmpty) Nil
   288               (if (sessions.isEmpty) Nil
   290               else
   289               else
   530     val session_info = session_context.sessions_structure(session_name)
   529     val session_info = session_context.sessions_structure(session_name)
   531 
   530 
   532     val session_dir = context.session_dir(session_name).expand
   531     val session_dir = context.session_dir(session_name).expand
   533     progress.echo("Presenting " + session_name + " in " + session_dir + " ...")
   532     progress.echo("Presenting " + session_name + " in " + session_dir + " ...")
   534 
   533 
   535     Meta_Data.init_directory(context.chapter_dir(session_info.chapter))
   534     Meta_Data.init_directory(context.chapter_dir(session_name))
   536     Meta_Data.init_directory(session_dir)
   535     Meta_Data.init_directory(session_dir)
   537 
   536 
   538     val session = context.document_info.the_session(session_name)
   537     val session = context.document_info.the_session(session_name)
   539 
   538 
   540     Bytes.write(session_dir + session_graph_path,
   539     Bytes.write(session_dir + session_graph_path,