src/Pure/Tools/doc.scala
changeset 72770 0c86c29767b2
parent 72763 3cc73d00553c
child 73276 54065cbf7134
equal deleted inserted replaced
72767:f6bf65554764 72770:0c86c29767b2
     3 
     3 
     4 Access to Isabelle documentation.
     4 Access to Isabelle documentation.
     5 */
     5 */
     6 
     6 
     7 package isabelle
     7 package isabelle
     8 
       
     9 
       
    10 import scala.util.matching.Regex
       
    11 
     8 
    12 
     9 
    13 object Doc
    10 object Doc
    14 {
    11 {
    15   /* dirs */
    12   /* dirs */
    39       val b = Library.try_unprefix("$ISABELLE_HOME/", a).getOrElse(a)
    36       val b = Library.try_unprefix("$ISABELLE_HOME/", a).getOrElse(a)
    40       Some(Text_File(b, path))
    37       Some(Text_File(b, path))
    41     }
    38     }
    42     else None
    39     else None
    43 
    40 
    44   private val Section_Entry = new Regex("""^(\S.*)\s*$""")
    41   private val Section_Entry = """^(\S.*)\s*$""".r
    45   private val Doc_Entry = new Regex("""^\s+(\S+)\s+(.+)\s*$""")
    42   private val Doc_Entry = """^\s+(\S+)\s+(.+)\s*$""".r
    46 
    43 
    47   private def release_notes(): List[Entry] =
    44   private def release_notes(): List[Entry] =
    48     Section("Release Notes", true) ::
    45     Section("Release Notes", true) ::
    49       Path.split(Isabelle_System.getenv_strict("ISABELLE_DOCS_RELEASE_NOTES")).flatMap(text_file)
    46       Path.split(Isabelle_System.getenv_strict("ISABELLE_DOCS_RELEASE_NOTES")).flatMap(text_file)
    50 
    47