diff -r 89ed43a49146 -r 007e6af8a020 src/Doc/System/Environment.thy --- a/src/Doc/System/Environment.thy Thu May 02 04:38:10 2024 +0200 +++ b/src/Doc/System/Environment.thy Thu May 02 14:08:59 2024 +0200 @@ -449,6 +449,75 @@ \ +section \System registry via TOML\ + +text \ + Tools implemented in Isabelle/Scala may refer to a global registry of + hierarchically structured values, which is based on a collection of TOML + files. TOML is conceptually similar to JSON, but aims at human-readable + syntax. + + The recursive structure of a TOML \<^emph>\value\ is defined as follows: + \<^enum> atom: string, integer, float, bool, date (ISO-8601) + \<^enum> array: sequence of \<^emph>\values\ \t\, written \<^verbatim>\[\\t\<^sub>1\\<^verbatim>\,\\\\\<^verbatim>\,\\t\<^sub>n\\<^verbatim>\]\ + \<^enum> table: mapping from \<^emph>\names\ \a\ to \<^emph>\values\ \t\, written + \<^verbatim>\{\\a\<^sub>1\\<^verbatim>\=\\t\<^sub>1\\<^verbatim>\,\\\\\<^verbatim>\,\\a\<^sub>n\\<^verbatim>\=\\t\<^sub>n\\<^verbatim>\}\ + + There are various alternative syntax forms for convenience, e.g. to + construct a table of tables, using \<^emph>\header syntax\ that resembles + traditional \<^verbatim>\.INI\-file notation. For example: + @{verbatim [display, indent = 2] + \[point.A] +x = 1 +y = 1 +description = "one point" + +[point.B] +x = 2 +y = -2 +description = "another point" + +[point.C] +x = 3 +y = 7 +description = "yet another point" +\} + + Or alternatively like this: + @{verbatim [display, indent = 2] + \point.A.x = 1 +point.A.y = 1 +point.A.description = "one point" + +point.B.x = 2 +point.B.y = -2 +point.B.description = "another point" + +point.C.x = 3 +point.C.y = 7 +point.C.description = "yet another point" +\} + + The TOML website\<^footnote>\\<^url>\https://toml.io/en/v1.0.0\\ provides many examples, + together with the full language specification. Note that the Isabelle/Scala + implementation of TOML uses the default ISO date/time format of + Java.\<^footnote>\\<^url>\https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html\\ + + \<^medskip> + The overall system registry is collected from \<^verbatim>\registry.toml\ files in + directories specified via the settings variable @{setting + "ISABELLE_REGISTRY"}: this refers to \<^path>\$ISABELLE_HOME\ and + \<^path>\$ISABELLE_HOME_USER\ by default, but further directories may be + specified via the GNU bash function \<^bash_function>\isabelle_registry\ + within \<^path>\etc/settings\ of Isabelle components. + + The result is available as Isabelle/Scala object + \<^scala>\isabelle.Registry.global\. That is empty by default, unless users + populate \<^path>\$ISABELLE_HOME_USER/etc/registry.toml\ or provide other + component \<^path>\etc/registry.toml\ files. +\ + + section \YXML versus XML \label{sec:yxml-vs-xml}\ text \