src/Pure/Thy/present.ML
changeset 67176 13b5c3ff1954
parent 67175 4e5ba4b23731
child 67179 35a4bf0f13b3
equal deleted inserted replaced
67175:4e5ba4b23731 67176:13b5c3ff1954
   188 
   188 
   189 (* isabelle tool wrappers *)
   189 (* isabelle tool wrappers *)
   190 
   190 
   191 fun isabelle_document {verbose, purge} format name tags dir =
   191 fun isabelle_document {verbose, purge} format name tags dir =
   192   let
   192   let
   193     val s = "isabelle document -o '" ^ format ^ "' \
   193     val script =
   194       \-n '" ^ name ^ "' -t '" ^ tags ^ "' " ^ File.bash_path dir;
   194       "isabelle document -d " ^ File.bash_path dir ^ " -o " ^ Bash.string format ^
       
   195         " -n " ^ Bash.string name ^ " -t " ^ Bash.string tags;
   195     val doc_path = Path.appends [dir, Path.parent, Path.basic name |> Path.ext format];
   196     val doc_path = Path.appends [dir, Path.parent, Path.basic name |> Path.ext format];
   196     val _ = if verbose then writeln s else ();
   197     val _ = if verbose then writeln script else ();
   197     val {out, err, rc, ...} = Bash.process s;
   198     val {out, err, rc, ...} = Bash.process script;
   198     val _ = if verbose then writeln out else ();
   199     val _ = if verbose then writeln out else ();
   199     val _ =
   200     val _ =
   200       if not (File.exists doc_path) orelse rc <> 0 then
   201       if not (File.exists doc_path) orelse rc <> 0 then
   201         cat_error err ("Failed to build document " ^ quote (show_path doc_path))
   202         cat_error err ("Failed to build document " ^ quote (show_path doc_path))
   202       else ();
   203       else ();