@@ -2618,3 +2618,111 @@ Parameters:
26182618
26192619Returns: a new list containing all items for which \`test\`
26202620was true.
2621+
2622+# Module pandoc.system
2623+
2624+Access to system information and functionality.
2625+
2626+## Static Fields {#system-fields}
2627+
2628+### arch {#system-arch}
2629+
2630+The machine architecture on which the program is running.
2631+
2632+### os {#system-os}
2633+
2634+The operating system on which the program is running.
2635+
2636+## Functions {#system-functions}
2637+
2638+### environment {#system-environment}
2639+
2640+`environment ()`
2641+
2642+Retrieve the entire environment as a string-indexed table.
2643+
2644+Returns:
2645+
2646+- A table mapping environment variables names to their string value
2647+ (table).
2648+
2649+### get\_working\_directory {#system-get_working_directory}
2650+
2651+`get_working_directory ()`
2652+
2653+Obtain the current working directory as an absolute path.
2654+
2655+Returns:
2656+
2657+- The current working directory (string).
2658+
2659+### with\_environment {#system-with_environment}
2660+
2661+`with_environment (environment, callback)`
2662+
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
2667+action.
2668+
2669+Parameters:
2670+
2671+`environment`
2672+: Environment variables and their values to be set before
2673+ running `callback`. (table with string keys and string
2674+ values)
2675+
2676+`callback`
2677+: Action to execute in the custom environment (function)
2678+
2679+Returns:
2680+
2681+- The result(s) of the call to `callback`
2682+
2683+### with\_temporary\_directory {#system-with_temporary_directory}
2684+
2685+`with_temporary_directory ([parent_dir,] templ, callback)`
2686+
2687+Create and use a temporary directory inside the given directory.
2688+The directory is deleted after the callback returns.
2689+
2690+Parameters:
2691+
2692+`parent_dir`
2693+: Parent directory to create the directory in (string). If this
2694+ parameter is omitted, the system's canonical temporary
2695+ directory is used.
2696+
2697+`templ`
2698+: Directory name template (string).
2699+
2700+`callback`
2701+: Function which takes the name of the temporary directory as its
2702+ first argument (function).
2703+
2704+Returns:
2705+
2706+- The result of the call to `callback`.
2707+
2708+### with\_working\_directory {#system-with_working_directory}
2709+
2710+`with_working_directory (directory, callback)`
2711+
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.
2716+
2717+Parameters:
2718+
2719+`directory`
2720+: Directory in which the given `callback` should be executed
2721+ (string)
2722+
2723+`callback`
2724+: Action to execute in the given directory (function)
2725+
2726+Returns:
2727+
2728+- The result(s) of the call to `callback`