mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
docs: optionally add a description to plugins
This commit is contained in:
parent
2d4ebda245
commit
848543d527
4 changed files with 24 additions and 7 deletions
|
@ -65,12 +65,14 @@ with lib; let
|
||||||
if builtins.length path >= 2 && lib.hasAttrByPath path nixvimInfo
|
if builtins.length path >= 2 && lib.hasAttrByPath path nixvimInfo
|
||||||
then let
|
then let
|
||||||
info = lib.getAttrFromPath path nixvimInfo;
|
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
|
in
|
||||||
"# ${lib.last path}\n\n"
|
"# ${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)
|
+ (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;
|
else null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
# Attribute may contain the following fields:
|
# Attribute may contain the following fields:
|
||||||
# - name: Name of the module
|
# - name: Name of the module
|
||||||
# - kind: Either colorschemes or plugins
|
# - kind: Either colorschemes or plugins
|
||||||
|
# - description: A short description of the plugin
|
||||||
# - url: Url for the plugin
|
# - url: Url for the plugin
|
||||||
#
|
#
|
||||||
# [kind name] will identify the plugin
|
# [kind name] will identify the plugin
|
||||||
|
@ -37,12 +38,16 @@
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# Where <info> is an attrset of the form:
|
# Where <info> is an attrset of the form:
|
||||||
# {file = "path"; url = null or "<URL>";}
|
# {
|
||||||
|
# file = "path";
|
||||||
|
# description = null or "<DESCRIPTION>";
|
||||||
|
# url = null or "<URL>";
|
||||||
|
# }
|
||||||
merge = _: defs:
|
merge = _: defs:
|
||||||
lib.foldl' (acc: def:
|
lib.foldl' (acc: def:
|
||||||
lib.recursiveUpdate acc {
|
lib.recursiveUpdate acc {
|
||||||
"${def.value.kind}"."${def.value.name}" = {
|
"${def.value.kind}"."${def.value.name}" = {
|
||||||
inherit (def.value) url;
|
inherit (def.value) url description;
|
||||||
inherit (def) file;
|
inherit (def) file;
|
||||||
};
|
};
|
||||||
}) {
|
}) {
|
||||||
|
|
|
@ -35,6 +35,7 @@ with lib; rec {
|
||||||
maintainers,
|
maintainers,
|
||||||
url ? defaultPackage.meta.homepage,
|
url ? defaultPackage.meta.homepage,
|
||||||
imports ? [],
|
imports ? [],
|
||||||
|
description ? null,
|
||||||
# deprecations
|
# deprecations
|
||||||
deprecateExtraOptions ? false,
|
deprecateExtraOptions ? false,
|
||||||
optionsRenamedToSettings ? [],
|
optionsRenamedToSettings ? [],
|
||||||
|
@ -62,7 +63,11 @@ with lib; rec {
|
||||||
meta = {
|
meta = {
|
||||||
inherit maintainers;
|
inherit maintainers;
|
||||||
nixvimInfo = {
|
nixvimInfo = {
|
||||||
inherit name url;
|
inherit
|
||||||
|
description
|
||||||
|
name
|
||||||
|
url
|
||||||
|
;
|
||||||
kind = namespace;
|
kind = namespace;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,6 +12,7 @@ with lib; {
|
||||||
else null,
|
else null,
|
||||||
maintainers,
|
maintainers,
|
||||||
imports ? [],
|
imports ? [],
|
||||||
|
description ? null,
|
||||||
# deprecations
|
# deprecations
|
||||||
deprecateExtraConfig ? false,
|
deprecateExtraConfig ? false,
|
||||||
optionsRenamedToSettings ? [],
|
optionsRenamedToSettings ? [],
|
||||||
|
@ -72,7 +73,11 @@ with lib; {
|
||||||
meta = {
|
meta = {
|
||||||
inherit maintainers;
|
inherit maintainers;
|
||||||
nixvimInfo = {
|
nixvimInfo = {
|
||||||
inherit name url;
|
inherit
|
||||||
|
description
|
||||||
|
name
|
||||||
|
url
|
||||||
|
;
|
||||||
kind = namespace;
|
kind = namespace;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue