From be6a29c8004fe23a4eb88e64052324e3470f2a48 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 26 Jun 2023 08:51:36 +0200 Subject: [PATCH] misc: fix documentation generation --- plugins/filetrees/neo-tree.nix | 197 +++++++++--------- .../lsp/language-servers/ltex-settings.nix | 2 +- 2 files changed, 98 insertions(+), 101 deletions(-) diff --git a/plugins/filetrees/neo-tree.nix b/plugins/filetrees/neo-tree.nix index fe841857..29d5ab14 100644 --- a/plugins/filetrees/neo-tree.nix +++ b/plugins/filetrees/neo-tree.nix @@ -609,73 +609,79 @@ in { nowait = helpers.defaultNullOpts.mkBool true "nowait"; }; - mappings = mkMappingsOption '' - { - "" = { - command = "toggle_node"; - # disable `nowait` if you have existing combos starting with this char that you want to use - nowait = false; - }; - "<2-LeftMouse>" = "open"; - "" = "open"; - "" = "revert_preview"; - P = { - command = "toggle_preview"; - config = { use_float = true; }; - }; - l = "focus_preview"; - S = "open_split"; - # S = "split_with_window_picker"; - s = "open_vsplit"; - # s = "vsplit_with_window_picker"; - t = "open_tabnew"; - # "" = "open_drop"; - # t = "open_tab_drop"; - w = "open_with_window_picker"; - C = "close_node"; - z = "close_all_nodes"; - # Z = "expand_all_nodes"; - R = "refresh"; - a = { - command = "add"; - # some commands may take optional config options, see `:h neo-tree-mappings` for details - config = { - show_path = "none"; # "none", "relative", "absolute" - }; - }; - A = "add_directory"; # also accepts the config.show_path and config.insert_as options. - d = "delete"; - r = "rename"; - y = "copy_to_clipboard"; - x = "cut_to_clipboard"; - p = "paste_from_clipboard"; - c = "copy"; # takes text input for destination, also accepts the config.show_path and config.insert_as options - m = "move"; # takes text input for destination, also accepts the config.show_path and config.insert_as options - e = "toggle_auto_expand_width"; - q = "close_window"; - "?" = "show_help"; - "<" = "prev_source"; - ">" = "next_source"; - } - ''; + mappings = + mkMappingsOption + '' + ``` + { + "" = { + command = "toggle_node"; + # disable `nowait` if you have existing combos starting with this char that you want to use + nowait = false; + }; + "<2-LeftMouse>" = "open"; + "" = "open"; + "" = "revert_preview"; + P = { + command = "toggle_preview"; + config = { use_float = true; }; + }; + l = "focus_preview"; + S = "open_split"; + # S = "split_with_window_picker"; + s = "open_vsplit"; + # s = "vsplit_with_window_picker"; + t = "open_tabnew"; + # "" = "open_drop"; + # t = "open_tab_drop"; + w = "open_with_window_picker"; + C = "close_node"; + z = "close_all_nodes"; + # Z = "expand_all_nodes"; + R = "refresh"; + a = { + command = "add"; + # some commands may take optional config options, see `:h neo-tree-mappings` for details + config = { + show_path = "none"; # "none", "relative", "absolute" + }; + }; + A = "add_directory"; # also accepts the config.show_path and config.insert_as options. + d = "delete"; + r = "rename"; + y = "copy_to_clipboard"; + x = "cut_to_clipboard"; + p = "paste_from_clipboard"; + c = "copy"; # takes text input for destination, also accepts the config.show_path and config.insert_as options + m = "move"; # takes text input for destination, also accepts the config.show_path and config.insert_as options + e = "toggle_auto_expand_width"; + q = "close_window"; + "?" = "show_help"; + "<" = "prev_source"; + ">" = "next_source"; + } + ``` + ''; }; filesystem = helpers.mkCompositeOption "Filesystem options" { - window = mkWindowMappingsOption '' - { - H = "toggle_hidden"; - "/" = "fuzzy_finder"; - D = "fuzzy_finder_directory"; - # "/" = "filter_as_you_type"; # this was the default until v1.28 - "#" = "fuzzy_sorter"; # fuzzy sorting using the fzy algorithm - # D = "fuzzy_sorter_directory"; - f = "filter_on_submit"; - "" = "clear_filter"; - "" = "navigate_up"; - "." = "set_root"; - "[g" = "prev_git_modified"; - "]g" = "next_git_modified"; - } - ''; + window = mkWindowMappingsOption (lib.mdDoc '' + ``` + { + H = "toggle_hidden"; + "/" = "fuzzy_finder"; + D = "fuzzy_finder_directory"; + # "/" = "filter_as_you_type"; # this was the default until v1.28 + "#" = "fuzzy_sorter"; # fuzzy sorting using the fzy algorithm + # D = "fuzzy_sorter_directory"; + f = "filter_on_submit"; + "" = "clear_filter"; + "" = "navigate_up"; + "." = "set_root"; + "[g" = "prev_git_modified"; + "]g" = "next_git_modified"; + } + ``` + ''); asyncDirectoryScan = helpers.defaultNullOpts.mkEnumFirstDefault ["auto" "always" "never"] '' - "auto" means refreshes are async, but it's synchronous when called from the Neotree commands. @@ -719,48 +725,39 @@ in { "only works on Windows for hidden files/directories"; hideByName = - helpers.defaultNullOpts.mkNullable (types.listOf types.str) '' - [ - ".DS_Store" - "thumbs.db" - # "node_modules" - ] - '' + helpers.defaultNullOpts.mkNullable (types.listOf types.str) + ''[".DS_Store" "thumbs.db"]'' "hide by name"; - hideByPattern = - helpers.defaultNullOpts.mkNullable (types.listOf types.str) '' - [ - # "*.meta" - # "*/src/*/tsconfig.json" - ] - '' - "hide by pattern"; + hideByPattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" '' + Hide by pattern. - alwaysShow = - helpers.defaultNullOpts.mkNullable (types.listOf types.str) '' + Example: + ``` [ - # ".gitignored" + "*.meta" + "*/src/*/tsconfig.json" ] - '' - "files/folders to always show"; + ``` + ''; - neverShow = - helpers.defaultNullOpts.mkNullable (types.listOf types.str) '' - [ - # ".DS_Store" - # "thumbs.db" - ] - '' - "files/folders to never show"; + alwaysShow = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" '' + Files/folders to always show. - neverShowByPattern = - helpers.defaultNullOpts.mkNullable (types.listOf types.str) '' - [ - # ".null-ls_*" - ] - '' - "files/folders to never show (by pattern)"; + Example: `[".gitignore"]` + ''; + + neverShow = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" '' + Files/folders to never show. + + Example: `[".DS_Store" "thumbs.db"]` + ''; + + neverShowByPattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" '' + Files/folders to never show (by pattern). + + Example: `[".null-ls_*"]` + ''; }; findByFullPathWords = helpers.defaultNullOpts.mkBool false '' diff --git a/plugins/lsp/language-servers/ltex-settings.nix b/plugins/lsp/language-servers/ltex-settings.nix index a26d0f78..b4ea625d 100644 --- a/plugins/lsp/language-servers/ltex-settings.nix +++ b/plugins/lsp/language-servers/ltex-settings.nix @@ -284,7 +284,7 @@ in { latex = { commands = helpers.defaultNullOpts.mkNullable (with types; attrsOf str) "{}" '' List of LATEX commands to be handled by the LATEX parser, listed together with empty arguments - (e.g., "\ref{}", "\documentclass[]{}"). + (e.g., `"ref{}"`, `"\documentclass[]{}"`). This setting is an attrs with the commands as keys and corresponding actions as values.