From 2e751c0772b9d48ff6923569adfa661b030ab6a2 Mon Sep 17 00:00:00 2001 From: pennae Date: Thu, 28 Jul 2022 23:19:15 +0200 Subject: treewide: automatically md-convert option descriptions the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like and , so any option using such tags will not be converted at all. --- nixos/modules/programs/tmux.nix | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'nixos/modules/programs/tmux.nix') diff --git a/nixos/modules/programs/tmux.nix b/nixos/modules/programs/tmux.nix index 74b3fbd9ac0..cf7ea4cfcf7 100644 --- a/nixos/modules/programs/tmux.nix +++ b/nixos/modules/programs/tmux.nix @@ -70,14 +70,14 @@ in { enable = mkOption { type = types.bool; default = false; - description = "Whenever to configure tmux system-wide."; + description = lib.mdDoc "Whenever to configure {command}`tmux` system-wide."; relatedPackages = [ "tmux" ]; }; aggressiveResize = mkOption { default = false; type = types.bool; - description = '' + description = lib.mdDoc '' Resize the window to the size of the smallest session for which it is the current window. ''; }; @@ -86,31 +86,31 @@ in { default = 0; example = 1; type = types.int; - description = "Base index for windows and panes."; + description = lib.mdDoc "Base index for windows and panes."; }; clock24 = mkOption { default = false; type = types.bool; - description = "Use 24 hour clock."; + description = lib.mdDoc "Use 24 hour clock."; }; customPaneNavigationAndResize = mkOption { default = false; type = types.bool; - description = "Override the hjkl and HJKL bindings for pane navigation and resizing in VI mode."; + description = lib.mdDoc "Override the hjkl and HJKL bindings for pane navigation and resizing in VI mode."; }; escapeTime = mkOption { default = 500; example = 0; type = types.int; - description = "Time in milliseconds for which tmux waits after an escape is input."; + description = lib.mdDoc "Time in milliseconds for which tmux waits after an escape is input."; }; extraConfig = mkOption { default = ""; - description = '' + description = lib.mdDoc '' Additional contents of /etc/tmux.conf ''; type = types.lines; @@ -120,53 +120,53 @@ in { default = 2000; example = 5000; type = types.int; - description = "Maximum number of lines held in window history."; + description = lib.mdDoc "Maximum number of lines held in window history."; }; keyMode = mkOption { default = defaultKeyMode; example = "vi"; type = types.enum [ "emacs" "vi" ]; - description = "VI or Emacs style shortcuts."; + description = lib.mdDoc "VI or Emacs style shortcuts."; }; newSession = mkOption { default = false; type = types.bool; - description = "Automatically spawn a session if trying to attach and none are running."; + description = lib.mdDoc "Automatically spawn a session if trying to attach and none are running."; }; reverseSplit = mkOption { default = false; type = types.bool; - description = "Reverse the window split shortcuts."; + description = lib.mdDoc "Reverse the window split shortcuts."; }; resizeAmount = mkOption { default = defaultResize; example = 10; type = types.int; - description = "Number of lines/columns when resizing."; + description = lib.mdDoc "Number of lines/columns when resizing."; }; shortcut = mkOption { default = defaultShortcut; example = "a"; type = types.str; - description = "Ctrl following by this key is used as the main shortcut."; + description = lib.mdDoc "Ctrl following by this key is used as the main shortcut."; }; terminal = mkOption { default = defaultTerminal; example = "screen-256color"; type = types.str; - description = "Set the $TERM variable."; + description = lib.mdDoc "Set the $TERM variable."; }; secureSocket = mkOption { default = true; type = types.bool; - description = '' + description = lib.mdDoc '' Store tmux socket under /run, which is more secure than /tmp, but as a downside it doesn't survive user logout. ''; @@ -175,7 +175,7 @@ in { plugins = mkOption { default = []; type = types.listOf types.package; - description = "List of plugins to install."; + description = lib.mdDoc "List of plugins to install."; example = lib.literalExpression "[ pkgs.tmuxPlugins.nord ]"; }; }; -- cgit 1.4.1