src/Pure/Admin/news.scala
changeset 64369 6a9816764b37
parent 62114 a7cf464933f7
child 64372 7ffd2be0a1e8
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Pure/Admin/news.scala	Mon Oct 24 12:01:36 2016 +0200
     1.3 @@ -0,0 +1,39 @@
     1.4 +/*  Title:      Pure/Admin/news.scala
     1.5 +    Author:     Makarius
     1.6 +
     1.7 +Support for the NEWS file.
     1.8 +*/
     1.9 +
    1.10 +package isabelle
    1.11 +
    1.12 +
    1.13 +object NEWS
    1.14 +{
    1.15 +  /* generate HTML version */
    1.16 +
    1.17 +  def generate_html()
    1.18 +  {
    1.19 +    val target = Path.explode("~~/doc")
    1.20 +
    1.21 +    File.write(target + Path.explode("NEWS.html"),
    1.22 +      HTML.begin_document("NEWS") +
    1.23 +      "\n<div class=\"source\">\n<pre class=\"source\">" +
    1.24 +      HTML.output(Symbol.decode(File.read(Path.explode("~~/NEWS")))) +
    1.25 +      "</pre>\n" +
    1.26 +      HTML.end_document)
    1.27 +
    1.28 +    for (font <- Path.split(Isabelle_System.getenv_strict("ISABELLE_FONTS")))
    1.29 +      File.copy(font, target)
    1.30 +
    1.31 +    File.copy(Path.explode("~~/etc/isabelle.css"), target)
    1.32 +  }
    1.33 +
    1.34 +
    1.35 +  /* Isabelle tool wrapper */
    1.36 +
    1.37 +  val isabelle_tool =
    1.38 +    Isabelle_Tool("news", "generate HTML version of the NEWS file", args =>
    1.39 +    {
    1.40 +      Command_Line.tool0 { generate_html() }
    1.41 +    }, admin = true)
    1.42 +}