src/Pure/Tools/doc.scala
changeset 83387 65d22b27471a
parent 83383 e7e1ffa36821
equal deleted inserted replaced
83386:5294055465d3 83387:65d22b27471a
    16   case class Section(title: String, important: Boolean, entries: List[Entry]) {
    16   case class Section(title: String, important: Boolean, entries: List[Entry]) {
    17     def print_title: String = title + if_proper(important, "!")
    17     def print_title: String = title + if_proper(important, "!")
    18   }
    18   }
    19   case class Entry(name: String, path: Path, title: String = "") {
    19   case class Entry(name: String, path: Path, title: String = "") {
    20     def view(): Unit = Doc.view(path)
    20     def view(): Unit = Doc.view(path)
    21     override def toString: String =  // GUI label
    21 
    22       if (title.nonEmpty) {
    22     def print_html: String = {
    23         val style = GUI.Style_HTML
    23       val style = GUI.Style_HTML
    24         style.enclose(style.make_bold(name) + style.make_text(": " + title))
    24       if (title.nonEmpty) style.make_bold(name) + style.make_text(": " + title)
    25       }
    25       else style.make_text(name)
    26       else name
    26     }
       
    27 
       
    28     override def toString: String =  // Swing GUI label
       
    29       if (title.nonEmpty) GUI.Style_HTML.enclose(print_html) else name
    27   }
    30   }
    28 
    31 
    29   def plain_file(path0: Path,
    32   def plain_file(path0: Path,
    30     env: Isabelle_System.Settings = Isabelle_System.Settings()
    33     env: Isabelle_System.Settings = Isabelle_System.Settings()
    31   ): Option[Entry] = {
    34   ): Option[Entry] = {