@@ -2618,3 +2618,111 @@ Parameters:
2619Returns: a new list containing all items for which \`test\`
2619Returns: a new list containing all items for which \`test\`
2620was true.
2620was true.
2622+# Module pandoc.system
2624+Access to system information and functionality.
2626+## Static Fields {#system-fields}
2628+### arch {#system-arch}
2630+The machine architecture on which the program is running.
2634+The operating system on which the program is running.
2636+## Functions {#system-functions}
2638+### environment {#system-environment}
2642+Retrieve the entire environment as a string-indexed table.
2646+- A table mapping environment variables names to their string value
2649+### get\_working\_directory {#system-get_working_directory}
2651+`get_working_directory ()`
2653+Obtain the current working directory as an absolute path.
2657+- The current working directory (string).
2659+### with\_environment {#system-with_environment}
2661+`with_environment (environment, callback)`
2663+Run an action within a custom environment. Only the environment
2664+variables given by `environment` will be set, when `callback` is
2665+called. The original environment is restored after this function
2666+finishes, even if an error occurs while running the callback
2672+: Environment variables and their values to be set before
2673+ running `callback`. (table with string keys and string
2677+: Action to execute in the custom environment (function)
2681+- The result(s) of the call to `callback`
2683+### with\_temporary\_directory {#system-with_temporary_directory}
2685+`with_temporary_directory ([parent_dir,] templ, callback)`
2687+Create and use a temporary directory inside the given directory.
2688+The directory is deleted after the callback returns.
2693+: Parent directory to create the directory in (string). If this
2694+ parameter is omitted, the system's canonical temporary
2698+: Directory name template (string).
2701+: Function which takes the name of the temporary directory as its
2702+ first argument (function).
2706+- The result of the call to `callback`.
2708+### with\_working\_directory {#system-with_working_directory}
2710+`with_working_directory (directory, callback)`
2712+Run an action within a different directory. This function will
2713+change the working directory to `directory`, execute `callback`,
2714+then switch back to the original working directory, even if an
2715+error occurs while running the callback action.
2720+: Directory in which the given `callback` should be executed
2724+: Action to execute in the given directory (function)
2728+- The result(s) of the call to `callback`