lib: format nixdoc values
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia6dcbf5c44ff6d29e5760111179341226a6a6964
This commit is contained in:
raf 2026-06-20 02:08:55 +03:00
commit 56e20dd9c8
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
7 changed files with 322 additions and 322 deletions

View file

@ -2,25 +2,25 @@
inherit (builtins) listToAttrs;
in {
/**
Map over a list and convert the result to an attribute set.
Map over a list and convert the result to an attribute set.
# Type
# Type
```
mapListToAttrs :: (a -> { name :: String; value :: b }) -> [a] -> AttrSet
```
```
mapListToAttrs :: (a -> { name :: String; value :: b }) -> [a] -> AttrSet
```
# Arguments
# Arguments
- `f`: Function mapping each list element to a `{ name; value }` pair.
- `list`: The list to map over.
- `f`: Function mapping each list element to a `{ name; value }` pair.
- `list`: The list to map over.
# Example
# Example
```nix
mapListToAttrs (x: { name = x; value = x; }) ["a" "b"]
=> { a = "a"; b = "b"; }
```
```nix
mapListToAttrs (x: { name = x; value = x; }) ["a" "b"]
=> { a = "a"; b = "b"; }
```
*/
mapListToAttrs = f: list: listToAttrs (map f list);
}

View file

@ -6,26 +6,26 @@
binds = rec {
/**
Create a silent Lua keybinding wrapped in `mkIf` to guard against null keys.
Create a silent Lua keybinding wrapped in `mkIf` to guard against null keys.
# Type
# Type
```
mkLuaBinding :: String | Null -> String -> String -> AttrSet
```
```
mkLuaBinding :: String | Null -> String -> String -> AttrSet
```
# Arguments
# Arguments
- `key`: The key sequence to bind, or `null` to disable.
- `action`: Lua expression to execute on keypress.
- `desc`: Human-readable description of the binding.
- `key`: The key sequence to bind, or `null` to disable.
- `action`: Lua expression to execute on keypress.
- `desc`: Human-readable description of the binding.
# Example
# Example
```nix
mkLuaBinding "<leader>f" "require('telescope').find_files" "Find files"
=> { "<leader>f" = { action = "require('telescope').find_files"; desc = "Find files"; lua = true; silent = true; }; }
```
```nix
mkLuaBinding "<leader>f" "require('telescope').find_files" "Find files"
=> { "<leader>f" = { action = "require('telescope').find_files"; desc = "Find files"; lua = true; silent = true; }; }
```
*/
mkLuaBinding = key: action: desc:
mkIf (key != null) {
@ -37,26 +37,26 @@
};
/**
Create a silent expression-mode Lua keybinding wrapped in `mkIf`.
Create a silent expression-mode Lua keybinding wrapped in `mkIf`.
# Type
# Type
```
mkExprBinding :: String | Null -> String -> String -> AttrSet
```
```
mkExprBinding :: String | Null -> String -> String -> AttrSet
```
# Arguments
# Arguments
- `key`: The key sequence to bind, or `null` to disable.
- `action`: Lua expression evaluated as a Vim expression.
- `desc`: Human-readable description of the binding.
- `key`: The key sequence to bind, or `null` to disable.
- `action`: Lua expression evaluated as a Vim expression.
- `desc`: Human-readable description of the binding.
# Example
# Example
```nix
mkExprBinding "<C-n>" "v:count == 0 ? 'j' : 'gj'" "Smart down"
=> { "<C-n>" = { action = "v:count == 0 ? 'j' : 'gj'"; desc = "Smart down"; lua = true; silent = true; expr = true; }; }
```
```nix
mkExprBinding "<C-n>" "v:count == 0 ? 'j' : 'gj'" "Smart down"
=> { "<C-n>" = { action = "v:count == 0 ? 'j' : 'gj'"; desc = "Smart down"; lua = true; silent = true; expr = true; }; }
```
*/
mkExprBinding = key: action: desc:
mkIf (key != null) {
@ -69,26 +69,26 @@
};
/**
Create a silent (non-Lua) keybinding wrapped in `mkIf` to guard against null keys.
Create a silent (non-Lua) keybinding wrapped in `mkIf` to guard against null keys.
# Type
# Type
```
mkBinding :: String | Null -> String -> String -> AttrSet
```
```
mkBinding :: String | Null -> String -> String -> AttrSet
```
# Arguments
# Arguments
- `key`: The key sequence to bind, or `null` to disable.
- `action`: Vimscript command or mapping string to execute.
- `desc`: Human-readable description of the binding.
- `key`: The key sequence to bind, or `null` to disable.
- `action`: Vimscript command or mapping string to execute.
- `desc`: Human-readable description of the binding.
# Example
# Example
```nix
mkBinding "<leader>w" ":w<CR>" "Save file"
=> { "<leader>w" = { action = ":w<CR>"; desc = "Save file"; silent = true; }; }
```
```nix
mkBinding "<leader>w" ":w<CR>" "Save file"
=> { "<leader>w" = { action = ":w<CR>"; desc = "Save file"; silent = true; }; }
```
*/
mkBinding = key: action: desc:
mkIf (key != null) {
@ -99,25 +99,25 @@
};
/**
Build a nullable string NixOS option suitable for storing a keybinding value.
Build a nullable string NixOS option suitable for storing a keybinding value.
# Type
# Type
```
mkMappingOption :: String -> String | Null -> Option
```
```
mkMappingOption :: String -> String | Null -> Option
```
# Arguments
# Arguments
- `description`: Documentation string for the option.
- `default`: Default key value, or `null` for no binding.
- `description`: Documentation string for the option.
- `default`: Default key value, or `null` for no binding.
# Example
# Example
```nix
mkMappingOption "Toggle file tree" "<leader>e"
=> mkOption { type = nullOr str; default = "<leader>e"; description = "Toggle file tree"; }
```
```nix
mkMappingOption "Toggle file tree" "<leader>e"
=> mkOption { type = nullOr str; default = "<leader>e"; description = "Toggle file tree"; }
```
*/
mkMappingOption = description: default:
mkOption {
@ -126,29 +126,29 @@
};
/**
Merge actual mapping values with their description metadata.
Merge actual mapping values with their description metadata.
Takes two attribute sets: one mapping keys to values and another mapping
keys to `{ description }` records. Produces an attribute set mapping
keys to `{ value; description }` records. Nesting is handled recursively.
Takes two attribute sets: one mapping keys to values and another mapping
keys to `{ description }` records. Produces an attribute set mapping
keys to `{ value; description }` records. Nesting is handled recursively.
# Type
# Type
```
addDescriptionsToMappings :: AttrSet -> AttrSet -> AttrSet
```
```
addDescriptionsToMappings :: AttrSet -> AttrSet -> AttrSet
```
# Arguments
# Arguments
- `actualMappings`: Attribute set of key value pairs.
- `mappingDefinitions`: Attribute set of key `{ description }` pairs.
- `actualMappings`: Attribute set of key value pairs.
- `mappingDefinitions`: Attribute set of key `{ description }` pairs.
# Example
# Example
```nix
addDescriptionsToMappings { someKey = "some_value"; } { someKey = { description = "Some Description"; }; }
=> { someKey = { value = "some_value"; description = "Some Description"; }; }
```
```nix
addDescriptionsToMappings { someKey = "some_value"; } { someKey = { description = "Some Description"; }; }
=> { someKey = { value = "some_value"; description = "Some Description"; }; }
```
*/
addDescriptionsToMappings = actualMappings: mappingDefinitions:
mapAttrs (name: value: let
@ -165,124 +165,124 @@
actualMappings;
/**
Create a non-Lua keybinding from a structured binding record produced by `mkMappingOption`.
Create a non-Lua keybinding from a structured binding record produced by `mkMappingOption`.
# Type
# Type
```
mkSetBinding :: { value :: String | Null; description :: String } -> String -> AttrSet
```
```
mkSetBinding :: { value :: String | Null; description :: String } -> String -> AttrSet
```
# Arguments
# Arguments
- `binding`: Binding record with `value` (key) and `description` fields.
- `action`: Vimscript command or mapping string to execute.
- `binding`: Binding record with `value` (key) and `description` fields.
- `action`: Vimscript command or mapping string to execute.
# Example
# Example
```nix
mkSetBinding { value = "<leader>w"; description = "Save file"; } ":w<CR>"
=> mkBinding "<leader>w" ":w<CR>" "Save file"
```
```nix
mkSetBinding { value = "<leader>w"; description = "Save file"; } ":w<CR>"
=> mkBinding "<leader>w" ":w<CR>" "Save file"
```
*/
mkSetBinding = binding: action:
mkBinding binding.value action binding.description;
/**
Create an expression-mode Lua keybinding from a structured binding record.
Create an expression-mode Lua keybinding from a structured binding record.
# Type
# Type
```
mkSetExprBinding :: { value :: String | Null; description :: String } -> String -> AttrSet
```
```
mkSetExprBinding :: { value :: String | Null; description :: String } -> String -> AttrSet
```
# Arguments
# Arguments
- `binding`: Binding record with `value` (key) and `description` fields.
- `action`: Lua expression evaluated as a Vim expression.
- `binding`: Binding record with `value` (key) and `description` fields.
- `action`: Lua expression evaluated as a Vim expression.
# Example
# Example
```nix
mkSetExprBinding { value = "<C-n>"; description = "Smart down"; } "v:count == 0 ? 'j' : 'gj'"
=> mkExprBinding "<C-n>" "v:count == 0 ? 'j' : 'gj'" "Smart down"
```
```nix
mkSetExprBinding { value = "<C-n>"; description = "Smart down"; } "v:count == 0 ? 'j' : 'gj'"
=> mkExprBinding "<C-n>" "v:count == 0 ? 'j' : 'gj'" "Smart down"
```
*/
mkSetExprBinding = binding: action:
mkExprBinding binding.value action binding.description;
/**
Create a silent Lua keybinding from a structured binding record.
Create a silent Lua keybinding from a structured binding record.
# Type
# Type
```
mkSetLuaBinding :: { value :: String | Null; description :: String } -> String -> AttrSet
```
```
mkSetLuaBinding :: { value :: String | Null; description :: String } -> String -> AttrSet
```
# Arguments
# Arguments
- `binding`: Binding record with `value` (key) and `description` fields.
- `action`: Lua expression to execute on keypress.
- `binding`: Binding record with `value` (key) and `description` fields.
- `action`: Lua expression to execute on keypress.
# Example
# Example
```nix
mkSetLuaBinding { value = "<leader>f"; description = "Find files"; } "require('telescope').find_files"
=> mkLuaBinding "<leader>f" "require('telescope').find_files" "Find files"
```
```nix
mkSetLuaBinding { value = "<leader>f"; description = "Find files"; } "require('telescope').find_files"
=> mkLuaBinding "<leader>f" "require('telescope').find_files" "Find files"
```
*/
mkSetLuaBinding = binding: action:
mkLuaBinding binding.value action binding.description;
/**
Apply `mkDefault` to every value in an attribute set.
Apply `mkDefault` to every value in an attribute set.
Useful for lowering the priority of a set of option defaults so they can
be overridden by user configuration.
Useful for lowering the priority of a set of option defaults so they can
be overridden by user configuration.
# Type
# Type
```
pushDownDefault :: AttrSet -> AttrSet
```
```
pushDownDefault :: AttrSet -> AttrSet
```
# Arguments
# Arguments
- `attr`: Attribute set whose values should be wrapped with `mkDefault`.
- `attr`: Attribute set whose values should be wrapped with `mkDefault`.
# Example
# Example
```nix
pushDownDefault { a = true; b = "hello"; }
=> { a = mkDefault true; b = mkDefault "hello"; }
```
```nix
pushDownDefault { a = true; b = "hello"; }
=> { a = mkDefault true; b = mkDefault "hello"; }
```
*/
pushDownDefault = attr: mapAttrs (_: mkDefault) attr;
/**
Build a keymap record by merging extra options with mode, key, and action fields.
Build a keymap record by merging extra options with mode, key, and action fields.
# Type
# Type
```
mkKeymap :: String -> String -> String -> AttrSet -> AttrSet
```
```
mkKeymap :: String -> String -> String -> AttrSet -> AttrSet
```
# Arguments
# Arguments
- `mode`: Vim mode string (e.g. `"n"`, `"v"`, `"i"`).
- `key`: Key sequence to bind.
- `action`: Action to execute on keypress.
- `opt`: Extra options merged into the resulting record.
- `mode`: Vim mode string (e.g. `"n"`, `"v"`, `"i"`).
- `key`: Key sequence to bind.
- `action`: Action to execute on keypress.
- `opt`: Extra options merged into the resulting record.
# Example
# Example
```nix
mkKeymap "n" "<leader>w" ":w<CR>" { silent = true; }
=> { mode = "n"; key = "<leader>w"; action = ":w<CR>"; silent = true; }
```
```nix
mkKeymap "n" "<leader>w" ":w<CR>" { silent = true; }
=> { mode = "n"; key = "<leader>w"; action = ":w<CR>"; silent = true; }
```
*/
mkKeymap = mode: key: action: opt: opt // {inherit mode key action;};
};

View file

@ -6,25 +6,25 @@
inherit (lib.lists) flatten;
in {
/**
Build a boolean NixOS option with the given default value and description.
Build a boolean NixOS option with the given default value and description.
# Type
# Type
```
mkBool :: Bool -> String -> Option
```
```
mkBool :: Bool -> String -> Option
```
# Arguments
# Arguments
- `value`: Default boolean value for the option.
- `description`: Documentation string for the option.
- `value`: Default boolean value for the option.
- `description`: Documentation string for the option.
# Example
# Example
```nix
mkBool true "Enable feature X"
=> mkOption { type = bool; default = true; description = "Enable feature X"; }
```
```nix
mkBool true "Enable feature X"
=> mkOption { type = bool; default = true; description = "Enable feature X"; }
```
*/
mkBool = value: description:
mkOption {

View file

@ -101,96 +101,96 @@ in {
map = f: mapAttrs (n: v: v // {data = f n v.data;});
/**
Create a DAG entry with explicit before and after dependency lists.
Create a DAG entry with explicit before and after dependency lists.
# Type
# Type
```
entryBetween :: [String] -> [String] -> a -> DagEntry a
```
```
entryBetween :: [String] -> [String] -> a -> DagEntry a
```
# Arguments
# Arguments
- `before`: List of entry names this entry must come before.
- `after`: List of entry names this entry must come after.
- `data`: Payload for this DAG entry.
- `before`: List of entry names this entry must come before.
- `after`: List of entry names this entry must come after.
- `data`: Payload for this DAG entry.
# Example
# Example
```nix
entryBetween [ "c" ] [ "a" ] "payload"
=> { data = "payload"; before = [ "c" ]; after = [ "a" ]; }
```
```nix
entryBetween [ "c" ] [ "a" ] "payload"
=> { data = "payload"; before = [ "c" ]; after = [ "a" ]; }
```
*/
entryBetween = before: after: data: {inherit data before after;};
/**
Create a DAG entry with no ordering constraints.
Create a DAG entry with no ordering constraints.
The entry may be placed anywhere in the topological sort result.
The entry may be placed anywhere in the topological sort result.
# Type
# Type
```
entryAnywhere :: a -> DagEntry a
```
```
entryAnywhere :: a -> DagEntry a
```
# Arguments
# Arguments
- `data`: Payload for this DAG entry.
- `data`: Payload for this DAG entry.
# Example
# Example
```nix
entryAnywhere "lua code here"
=> { data = "lua code here"; before = []; after = []; }
```
```nix
entryAnywhere "lua code here"
=> { data = "lua code here"; before = []; after = []; }
```
*/
entryAnywhere = entryBetween [] [];
/**
Create a DAG entry that must come after the listed entries.
Create a DAG entry that must come after the listed entries.
# Type
# Type
```
entryAfter :: [String] -> a -> DagEntry a
```
```
entryAfter :: [String] -> a -> DagEntry a
```
# Arguments
# Arguments
- `after`: List of entry names this entry must follow.
- `data`: Payload for this DAG entry.
- `after`: List of entry names this entry must follow.
- `data`: Payload for this DAG entry.
# Example
# Example
```nix
entryAfter [ "init" ] "setup code"
=> { data = "setup code"; before = []; after = [ "init" ]; }
```
```nix
entryAfter [ "init" ] "setup code"
=> { data = "setup code"; before = []; after = [ "init" ]; }
```
*/
entryAfter = entryBetween [];
/**
Create a DAG entry that must come before the listed entries.
Create a DAG entry that must come before the listed entries.
# Type
# Type
```
entryBefore :: [String] -> a -> DagEntry a
```
```
entryBefore :: [String] -> a -> DagEntry a
```
# Arguments
# Arguments
- `before`: List of entry names this entry must precede.
- `data`: Payload for this DAG entry.
- `before`: List of entry names this entry must precede.
- `data`: Payload for this DAG entry.
# Example
# Example
```nix
entryBefore [ "teardown" ] "cleanup code"
=> { data = "cleanup code"; before = [ "teardown" ]; after = []; }
```
```nix
entryBefore [ "teardown" ] "cleanup code"
=> { data = "cleanup code"; before = [ "teardown" ]; after = []; }
```
*/
entryBefore = before: entryBetween before [];

View file

@ -7,30 +7,30 @@
in {
# TODO: remove
/**
Convert a list of diagnostic provider entries to a DAG-compatible attribute set.
Convert a list of diagnostic provider entries to a DAG-compatible attribute set.
Accepts either plain strings (provider type names) or attrsets with `type`
and `package` fields, and produces named entries suitable for merging into
a null-ls/none-ls DAG.
Accepts either plain strings (provider type names) or attrsets with `type`
and `package` fields, and produces named entries suitable for merging into
a null-ls/none-ls DAG.
# Type
# Type
```
diagnosticsToLua :: { lang :: String; config :: [String | { type :: String; package :: Derivation }]; diagnosticsProviders :: AttrSet } -> AttrSet
```
```
diagnosticsToLua :: { lang :: String; config :: [String | { type :: String; package :: Derivation }]; diagnosticsProviders :: AttrSet } -> AttrSet
```
# Arguments
# Arguments
- `lang`: Language identifier used to prefix generated entry names.
- `config`: List of provider names (strings) or `{ type; package }` records.
- `diagnosticsProviders`: Attribute set mapping provider type names to `{ package; nullConfig }` records.
- `lang`: Language identifier used to prefix generated entry names.
- `config`: List of provider names (strings) or `{ type; package }` records.
- `diagnosticsProviders`: Attribute set mapping provider type names to `{ package; nullConfig }` records.
# Example
# Example
```nix
diagnosticsToLua { lang = "python"; config = [ "flake8" ]; diagnosticsProviders = { flake8 = { package = pkgs.python3Packages.flake8; nullConfig = pkg: "..."; }; }; }
=> { "python-diagnostics-flake8" = "..."; }
```
```nix
diagnosticsToLua { lang = "python"; config = [ "flake8" ]; diagnosticsProviders = { flake8 = { package = pkgs.python3Packages.flake8; nullConfig = pkg: "..."; }; }; }
=> { "python-diagnostics-flake8" = "..."; }
```
*/
diagnosticsToLua = {
lang,
@ -54,24 +54,24 @@ in {
config;
/**
Build a boolean NixOS option that enables a language feature for all enabled languages.
Build a boolean NixOS option that enables a language feature for all enabled languages.
# Type
# Type
```
mkEnable :: String -> Option
```
```
mkEnable :: String -> Option
```
# Arguments
# Arguments
- `desc`: Short description of the feature being enabled (interpolated into the option description).
- `desc`: Short description of the feature being enabled (interpolated into the option description).
# Example
# Example
```nix
mkEnable "LSP support"
=> mkOption { default = false; type = bool; description = "Turn on LSP support for enabled languages by default"; }
```
```nix
mkEnable "LSP support"
=> mkOption { default = false; type = bool; description = "Turn on LSP support for enabled languages by default"; }
```
*/
mkEnable = desc:
mkOption {
@ -81,26 +81,26 @@ in {
};
/**
A freeform submodule type for LSP server options.
A freeform submodule type for LSP server options.
Provides a structured set of well-known LSP configuration fields
(`enable`, `capabilities`, `on_attach`, `filetypes`, `cmd`, `root_markers`)
while allowing arbitrary extra fields via `freeformType`.
Provides a structured set of well-known LSP configuration fields
(`enable`, `capabilities`, `on_attach`, `filetypes`, `cmd`, `root_markers`)
while allowing arbitrary extra fields via `freeformType`.
# Type
# Type
```
lspOptions :: SubmoduleType
```
```
lspOptions :: SubmoduleType
```
# Example
# Example
```nix
vim.languages.rust.lsp.options = {
enable = true;
root_markers = [ "Cargo.toml" ];
};
```
```nix
vim.languages.rust.lsp.options = {
enable = true;
root_markers = [ "Cargo.toml" ];
};
```
*/
lspOptions = submodule {
freeformType = attrsOf anything;

View file

@ -2,28 +2,28 @@
inherit (lib.lists) elem all;
in {
/**
Checks if all values are present in the list.
Checks if all values are present in the list.
# Type
# Type
```
listContainsValues :: { list :: [a], values :: [a] } -> Bool
```
```
listContainsValues :: { list :: [a], values :: [a] } -> Bool
```
# Arguments
# Arguments
- `list`: A list of elements.
- `values`: A list of values to check for presence in the list.
- `list`: A list of elements.
- `values`: A list of values to check for presence in the list.
# Example
# Example
```nix
listContainsValues { list = [1 2 3]; values = [2 3]; }
=> true
```nix
listContainsValues { list = [1 2 3]; values = [2 3]; }
=> true
listContainsValues { list = [1 2 3]; values = [2 4]; }
=> false
```
listContainsValues { list = [1 2 3]; values = [2 4]; }
=> false
```
*/
listContainsValues = {
list,

View file

@ -1,56 +1,56 @@
# Helpers for converting values to lua
{lib}: let
/**
Test whether an object is a `luaInline` value (i.e. has `_type == "lua-inline"`).
Test whether an object is a `luaInline` value (i.e. has `_type == "lua-inline"`).
# Type
# Type
```
isLuaInline :: Any -> Bool
```
```
isLuaInline :: Any -> Bool
```
# Arguments
# Arguments
- `object`: Any Nix value.
- `object`: Any Nix value.
# Example
# Example
```nix
isLuaInline (lib.mkLuaInline "vim.fn.getcwd()")
=> true
```nix
isLuaInline (lib.mkLuaInline "vim.fn.getcwd()")
=> true
isLuaInline "just a string"
=> false
```
isLuaInline "just a string"
=> false
```
*/
isLuaInline = object: (object._type or null) == "lua-inline";
/**
Recursively convert a Nix value to its Lua representation as a string.
Recursively convert a Nix value to its Lua representation as a string.
Handles all primitive Nix types as well as lists, attribute sets,
derivations (rendered as their store path string), and `luaInline` values
(rendered verbatim). Null attributes are stripped from sets.
Handles all primitive Nix types as well as lists, attribute sets,
derivations (rendered as their store path string), and `luaInline` values
(rendered verbatim). Null attributes are stripped from sets.
# Type
# Type
```
toLuaObject :: Any -> String
```
```
toLuaObject :: Any -> String
```
# Arguments
# Arguments
- `args`: Any Nix value to convert.
- `args`: Any Nix value to convert.
# Example
# Example
```nix
toLuaObject { a = 1; b = true; c = null; }
=> ''{["a"] = 1,\n["b"] = true}''
```nix
toLuaObject { a = 1; b = true; c = null; }
=> ''{["a"] = 1,\n["b"] = true}''
toLuaObject [ "x" "y" ]
=> ''{"x",\n"y"}''
```
toLuaObject [ "x" "y" ]
=> ''{"x",\n"y"}''
```
*/
toLuaObject = args:
{
@ -94,27 +94,27 @@ in
inherit isLuaInline toLuaObject;
/**
Convert a list of Lua expression strings into a Lua table string.
Convert a list of Lua expression strings into a Lua table string.
Each element is wrapped with `mkLuaInline` before conversion so that
strings are treated as raw Lua rather than quoted string literals.
Each element is wrapped with `mkLuaInline` before conversion so that
strings are treated as raw Lua rather than quoted string literals.
# Type
# Type
```
luaTable :: [String] -> String
```
```
luaTable :: [String] -> String
```
# Arguments
# Arguments
- `x`: List of Lua expression strings.
- `x`: List of Lua expression strings.
# Example
# Example
```nix
luaTable [ "vim.fn.getcwd()" "vim.fn.expand('%')" ]
=> ''{vim.fn.getcwd(),\nvim.fn.expand('%')}''
```
```nix
luaTable [ "vim.fn.getcwd()" "vim.fn.expand('%')" ]
=> ''{vim.fn.getcwd(),\nvim.fn.expand('%')}''
```
*/
luaTable = x: (toLuaObject (map lib.mkLuaInline x));
}