diff --git a/docs/mdbook/default.nix b/docs/mdbook/default.nix index 985375e8..aab9bd51 100644 --- a/docs/mdbook/default.nix +++ b/docs/mdbook/default.nix @@ -65,12 +65,14 @@ with lib; let if builtins.length path >= 2 && lib.hasAttrByPath path nixvimInfo then let info = lib.getAttrFromPath path nixvimInfo; - maintainers = lib.unique (options.config.meta.maintainers."${info.file}" or []); + maintainers = lib.unique (options.config.meta.maintainers.${info.file} or []); + maintainersNames = builtins.map (m: m.name) maintainers; in "# ${lib.last path}\n\n" - + (lib.optionalString (info.url != null) "Url: [${info.url}](${info.url})\n\n") + + (lib.optionalString (info.description != null) "${info.description}\n\n") + + (lib.optionalString (info.url != null) "**Url:** [${info.url}](${info.url})\n\n") + (lib.optionalString (builtins.length maintainers > 0) - "Maintainers: ${lib.concatStringsSep ", " (builtins.map (m: m.name) maintainers)}\n\n") + "**Maintainers:** ${lib.concatStringsSep ", " maintainersNames}\n\n") else null; }; diff --git a/flake-modules/modules.nix b/flake-modules/modules.nix index 48cf2eb4..77465b14 100644 --- a/flake-modules/modules.nix +++ b/flake-modules/modules.nix @@ -22,6 +22,7 @@ # Attribute may contain the following fields: # - name: Name of the module # - kind: Either colorschemes or plugins + # - description: A short description of the plugin # - url: Url for the plugin # # [kind name] will identify the plugin @@ -37,12 +38,16 @@ # } # # Where is an attrset of the form: - # {file = "path"; url = null or "";} + # { + # file = "path"; + # description = null or ""; + # url = null or ""; + # } merge = _: defs: lib.foldl' (acc: def: lib.recursiveUpdate acc { "${def.value.kind}"."${def.value.name}" = { - inherit (def.value) url; + inherit (def.value) url description; inherit (def) file; }; }) { diff --git a/lib/neovim-plugin.nix b/lib/neovim-plugin.nix index 262365db..f48a9073 100644 --- a/lib/neovim-plugin.nix +++ b/lib/neovim-plugin.nix @@ -35,6 +35,7 @@ with lib; rec { maintainers, url ? defaultPackage.meta.homepage, imports ? [], + description ? null, # deprecations deprecateExtraOptions ? false, optionsRenamedToSettings ? [], @@ -62,7 +63,11 @@ with lib; rec { meta = { inherit maintainers; nixvimInfo = { - inherit name url; + inherit + description + name + url + ; kind = namespace; }; }; diff --git a/lib/vim-plugin.nix b/lib/vim-plugin.nix index bf03aba2..e8b0a6d2 100644 --- a/lib/vim-plugin.nix +++ b/lib/vim-plugin.nix @@ -12,6 +12,7 @@ with lib; { else null, maintainers, imports ? [], + description ? null, # deprecations deprecateExtraConfig ? false, optionsRenamedToSettings ? [], @@ -72,7 +73,11 @@ with lib; { meta = { inherit maintainers; nixvimInfo = { - inherit name url; + inherit + description + name + url + ; kind = namespace; }; };