src/Pure/Admin/component_find_facts_web.scala
author haftmann
Mon, 16 Jun 2025 15:25:38 +0200
changeset 82730 3b98b1b57435
parent 82223 706562be40fc
permissions -rw-r--r--
more explicit theorem names for list quantifiers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
82113
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     1
/*  Title:      Pure/Admin/component_find_facts_web.scala
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     2
    Author:     Fabian Huch, TU Muenchen
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     3
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     4
Build Isabelle component for find_facts web app, including external resources.
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     5
*/
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     6
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     7
package isabelle
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     8
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
     9
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    10
import find_facts.Find_Facts
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    11
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    12
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    13
object Component_Find_Facts_Web {
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    14
  /* roboto font */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    15
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    16
  val default_roboto_url = "https://r2.fontsource.org/fonts/roboto"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    17
  val default_roboto_version = "5.1.1"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    18
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    19
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    20
  /* material components web elm */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    21
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    22
  val default_mcwe_url = "https://unpkg.com/material-components-web-elm"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    23
  val default_mcwe_version = "9.1.0"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    24
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    25
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    26
  /* build find facts web app */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    27
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    28
  def build_find_facts_web(
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    29
    roboto_base_url: String = default_roboto_url,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    30
    roboto_version: String = default_roboto_version,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    31
    mcwe_base_url: String = default_mcwe_url,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    32
    mcwe_version: String = default_mcwe_version,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    33
    target_dir: Path = Path.current,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    34
    progress: Progress = new Progress,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    35
  ): Unit = {
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    36
    /* component */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    37
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    38
    val component_name = "find_facts_web-" + Date.Format.alt_date(Date.now())
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    39
    val component_dir =
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    40
      Components.Directory(target_dir + Path.basic(component_name)).create(progress = progress)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    41
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    42
    val web_dir = Isabelle_System.make_directory(component_dir.path + Path.basic("web"))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    43
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    44
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    45
    /* roboto */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    46
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    47
    val roboto_download =  roboto_base_url + "@" + roboto_version + "/download.zip"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    48
    val roboto_fonts =
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    49
      List(300, 400, 500).map(weight => weight -> ("roboto-latin-" + weight + "-normal.woff"))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    50
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    51
    Isabelle_System.with_tmp_dir("download") { download_dir =>
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    52
      val archive_path = download_dir + Path.basic("download.zip")
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    53
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    54
      Isabelle_System.download_file(roboto_download, archive_path)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    55
      Isabelle_System.extract(archive_path, download_dir)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    56
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    57
      roboto_fonts.foreach((_, name) =>
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    58
        Isabelle_System.copy_file(download_dir + Path.make(List("webfonts", name)), web_dir))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    59
      Isabelle_System.copy_file(
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    60
        download_dir + Path.basic("LICENSE"),
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    61
        component_dir.path + Path.basic("LICENSE-roboto"))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    62
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    63
      File.write(web_dir + Path.basic("roboto.css"), roboto_fonts.map((weight, name) => """
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    64
@font-face {
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    65
  font-family: 'Roboto';
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    66
  font-weight: """ + weight + """;
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    67
  src: url('./""" + name + """') format('woff');
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    68
}
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    69
""").mkString)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    70
    }
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    71
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    72
    val roboto_css = "roboto.css" -> HTTP.Content.mime_type_css
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    73
    val roboto_assets = roboto_css :: roboto_fonts.map((_, name) => name -> "font/woff")
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    74
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    75
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    76
    /* mcwe */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    77
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    78
    def mcwe_file(path: String): String = mcwe_base_url + "@" + mcwe_version + "/" + path
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    79
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    80
    val mcwe_assets =
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    81
      List(
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    82
        "material-components-web-elm.min.js" -> HTTP.Content.mime_type_js,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    83
        "material-components-web-elm.min.css" -> HTTP.Content.mime_type_css)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    84
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    85
    for ((name, _) <- mcwe_assets)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    86
      Isabelle_System.download_file(mcwe_file("dist/" + name), web_dir + Path.basic(name))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    87
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    88
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    89
    /* settings */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    90
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    91
    val assets =
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    92
      (roboto_assets ::: mcwe_assets).map((name, mime_type) => name + ":" + mime_type).mkString(",")
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    93
    component_dir.write_settings("""
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    94
FIND_FACTS_WEB_ASSETS_DIR="$COMPONENT/web"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    95
FIND_FACTS_WEB_ASSETS="""" + assets + """"
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    96
""")
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    97
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    98
    /* README */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
    99
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   100
    File.write(component_dir.README,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   101
      """This component contains web assets (downloaded from recommended CDNs) for the Find_Facts
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   102
web application, and its compiled index.html.
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   103
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   104
Sources can be found in $FIND_FACTS_HOME/web.
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   105
82223
706562be40fc tuned output;
wenzelm
parents: 82113
diff changeset
   106
82113
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   107
        Fabian Huch
82223
706562be40fc tuned output;
wenzelm
parents: 82113
diff changeset
   108
        """ + Date.Format.date(Date.now()) + "\n")
82113
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   109
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   110
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   111
    /* pre-compiled web app */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   112
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   113
    Isabelle_System.with_tmp_dir("find_facts") { dir =>
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   114
      Find_Facts.build_html(web_dir + Find_Facts.web_html, dir, assets, progress = progress)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   115
    }
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   116
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   117
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   118
    /* license */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   119
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   120
    File.write(
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   121
      component_dir.path + Path.basic("LICENSE-material-components-web-elm"),
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   122
      Url.read(mcwe_file("LICENSE")))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   123
  }
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   124
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   125
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   126
  /* Isabelle tool wrapper */
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   127
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   128
  val isabelle_tool =
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   129
    Isabelle_Tool(
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   130
      "component_find_facts_web",
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   131
      "build Find_Facts web component from elm sources and external resources",
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   132
      Scala_Project.here,
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   133
      { args =>
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   134
        var target_dir = Path.current
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   135
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   136
        val getopts = Getopts("""
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   137
Usage: isabelle component_find_facts_web [OPTIONS]
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   138
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   139
  Options are:
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   140
    -D DIR       target directory (default ".")
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   141
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   142
  Build Find_Facts web component from the specified url and elm sources.
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   143
""",
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   144
          "D:" -> (arg => target_dir = Path.explode(arg)))
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   145
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   146
        val more_args = getopts(args)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   147
        if (more_args.nonEmpty) getopts.usage()
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   148
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   149
        val progress = new Console_Progress()
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   150
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   151
        build_find_facts_web(target_dir = target_dir, progress = progress)
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   152
      })
b636cad7b684 web component for Find_Facts: bundled assets and compiled elm app;
Fabian Huch <huch@in.tum.de>
parents:
diff changeset
   153
}