more options for "isabelle mkroot";
authorwenzelm
Sat Nov 11 15:45:12 2017 +0100 (17 months ago)
changeset 67043848672fcaee5
parent 67042 677cab7c2b85
child 67044 3d81a1a67302
more options for "isabelle mkroot";
updated documentation;
NEWS
src/Doc/System/Presentation.thy
src/Pure/Tools/mkroot.scala
     1.1 --- a/NEWS	Sat Nov 11 14:55:30 2017 +0100
     1.2 +++ b/NEWS	Sat Nov 11 15:45:12 2017 +0100
     1.3 @@ -98,6 +98,9 @@
     1.4  for this session. There is no need to specify options [document = false]
     1.5  anymore.
     1.6  
     1.7 +* The command-line tool "isabelle mkroot" now always produces a document
     1.8 +outline: its options have been adapted accordingly. INCOMPATIBILITY.
     1.9 +
    1.10  * Linux and Windows/Cygwin is for x86_64 only. Old 32bit platform
    1.11  support has been discontinued.
    1.12  
     2.1 --- a/src/Doc/System/Presentation.thy	Sat Nov 11 14:55:30 2017 +0100
     2.2 +++ b/src/Doc/System/Presentation.thy	Sat Nov 11 15:45:12 2017 +0100
     2.3 @@ -94,12 +94,15 @@
     2.4    The @{tool_def mkroot} tool configures a given directory as session root,
     2.5    with some \<^verbatim>\<open>ROOT\<close> file and optional document source directory. Its usage is:
     2.6    @{verbatim [display]
     2.7 -\<open>Usage: isabelle mkroot [OPTIONS] [DIR]
     2.8 +\<open>Usage: isabelle mkroot [OPTIONS] [DIRECTORY]
     2.9  
    2.10    Options are:
    2.11 -    -n NAME      alternative session name (default: DIR base name)
    2.12 +    -A LATEX     provide author in LaTeX notation (default: user name)
    2.13 +    -T LATEX     provide title in LaTeX notation (default: session name)
    2.14 +    -n NAME      alternative session name (default: directory base name)
    2.15  
    2.16 -  Prepare session root DIR (default: current directory).\<close>}
    2.17 +  Prepare session root directory (default: current directory).
    2.18 +\<close>}
    2.19  
    2.20    The results are placed in the given directory \<open>dir\<close>, which refers to the
    2.21    current directory by default. The @{tool mkroot} tool is conservative in the
    2.22 @@ -107,16 +110,18 @@
    2.23    attempts to generate a session root need to be deleted manually.
    2.24  
    2.25    The generated session template will be accompanied by a formal document,
    2.26 -  with \<open>DIR\<close>\<^verbatim>\<open>/document/root.tex\<close> as its {\LaTeX} entry point (see also
    2.27 +  with \<open>DIRECTORY\<close>\<^verbatim>\<open>/document/root.tex\<close> as its {\LaTeX} entry point (see also
    2.28    \chref{ch:present}).
    2.29  
    2.30 -  Option \<^verbatim>\<open>-n\<close> allows to specify an alternative session name; otherwise the
    2.31 -  base name of the given directory is used.
    2.32 +  Options \<^verbatim>\<open>-T\<close> and \<^verbatim>\<open>-A\<close> specify the document title and author explicitly,
    2.33 +  using {\LaTeX} source notation.
    2.34 +
    2.35 +  Option \<^verbatim>\<open>-n\<close> specifies an alternative session name; otherwise the base name
    2.36 +  of the given directory is used.
    2.37  
    2.38    \<^medskip>
    2.39    The implicit Isabelle settings variable @{setting ISABELLE_LOGIC} specifies
    2.40 -  the parent session, and @{setting ISABELLE_DOCUMENT_FORMAT} the document
    2.41 -  format to be filled filled into the generated \<^verbatim>\<open>ROOT\<close> file.
    2.42 +  the parent session.
    2.43  \<close>
    2.44  
    2.45  
     3.1 --- a/src/Pure/Tools/mkroot.scala	Sat Nov 11 14:55:30 2017 +0100
     3.2 +++ b/src/Pure/Tools/mkroot.scala	Sat Nov 11 15:45:12 2017 +0100
     3.3 @@ -105,8 +105,7 @@
     3.4  \begin{document}
     3.5  
     3.6  \title{""" + (proper_string(title) getOrElse latex_name(name)) + """}
     3.7 -\author{""" +
     3.8 -  (proper_string(author) getOrElse ("By " + latex_name(Isabelle_System.getenv("USER")))) + """}
     3.9 +\author{""" + (proper_string(author) getOrElse latex_name(System.getProperty("user.name"))) + """}
    3.10  \maketitle
    3.11  
    3.12  \tableofcontents
    3.13 @@ -149,16 +148,22 @@
    3.14  
    3.15    val isabelle_tool = Isabelle_Tool("mkroot", "prepare session root directory", args =>
    3.16    {
    3.17 +    var author = ""
    3.18 +    var title = ""
    3.19      var session_name = ""
    3.20  
    3.21      val getopts = Getopts("""
    3.22 -Usage: isabelle mkroot [OPTIONS] [DIR]
    3.23 +Usage: isabelle mkroot [OPTIONS] [DIRECTORY]
    3.24  
    3.25    Options are:
    3.26 -    -n NAME      alternative session name (default: DIR base name)
    3.27 +    -A LATEX     provide author in LaTeX notation (default: user name)
    3.28 +    -T LATEX     provide title in LaTeX notation (default: session name)
    3.29 +    -n NAME      alternative session name (default: directory base name)
    3.30  
    3.31 -  Prepare session root DIR (default: current directory).
    3.32 +  Prepare session root directory (default: current directory).
    3.33  """,
    3.34 +      "A:" -> (arg => author = arg),
    3.35 +      "T:" -> (arg => title = arg),
    3.36        "n:" -> (arg => session_name = arg))
    3.37  
    3.38      val more_args = getopts(args)
    3.39 @@ -170,6 +175,7 @@
    3.40          case _ => getopts.usage()
    3.41        }
    3.42  
    3.43 -    mkroot(session_name = session_name, session_dir = session_dir, progress = new Console_Progress)
    3.44 +    mkroot(session_name = session_name, session_dir = session_dir, author = author, title = title,
    3.45 +      progress = new Console_Progress)
    3.46    })
    3.47  }