aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs
diff options
context:
space:
mode:
Diffstat (limited to 'pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs')
-rw-r--r--pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs49
1 files changed, 21 insertions, 28 deletions
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs
index c6a124166..75d1ac3ba 100644
--- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs
+++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs
@@ -26,34 +26,27 @@ import qualified HsLua.Module.System as MSys
-- | Push the pandoc.system module on the Lua stack.
documentedModule :: forall e. LuaError e => Module e
-documentedModule = Module
- { moduleName = "pandoc.system"
- , moduleDescription = moduleDescription @e MSys.documentedModule
- , moduleFields =
- [ arch
- , os
+documentedModule = defmodule "pandoc.system"
+ `withDescription` moduleDescription @e MSys.documentedModule
+ `withFields` [arch, os]
+ `withFunctions`
+ [ cputime `since` v[3,1,1]
+ , setName cmd "command" `since` v[3,7,1]
+ , setName cp "copy" `since` v[3,7,1]
+ , setName env "environment" `since` v[2,7,3]
+ , setName getwd "get_working_directory" `since` v[2,8]
+ , setName ls "list_directory" `since` v[2,19]
+ , setName mkdir "make_directory" `since` v[2,19]
+ , read_file `since` v[3,7,1]
+ , rename `since` v[3,7,1]
+ , setName rm "remove" `since` v[3,7,1]
+ , setName rmdir "remove_directory" `since` v[2,19]
+ , times `since` v[3,7,1]
+ , setName with_env "with_environment" `since` v[2,7,3]
+ , setName with_tmpdir "with_temporary_directory" `since` v[2,8]
+ , setName with_wd "with_working_directory" `since` v[2,7,3]
+ , write_file `since` v[3,7,1]
+ , xdg `since` v[3,7,1]
]
- , moduleFunctions =
- [ cputime `since` v[3,1,1]
- , setName "command" cmd `since` v[3,7,1]
- , setName "copy" cp `since` v[3,7,1]
- , setName "environment" env `since` v[2,7,3]
- , setName "get_working_directory" getwd `since` v[2,8]
- , setName "list_directory" ls `since` v[2,19]
- , setName "make_directory" mkdir `since` v[2,19]
- , read_file `since` v[3,7,1]
- , rename `since` v[3,7,1]
- , setName "remove" rm `since` v[3,7,1]
- , setName "remove_directory" rmdir `since` v[2,19]
- , times `since` v[3,7,1]
- , setName "with_environment" with_env `since` v[2,7,3]
- , setName "with_temporary_directory" with_tmpdir `since` v[2,8]
- , setName "with_working_directory" with_wd `since` v[2,7,3]
- , write_file `since` v[3,7,1]
- , xdg `since` v[3,7,1]
- ]
- , moduleOperations = []
- , moduleTypeInitializers = []
- }
where
v = makeVersion