mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-15 03:34:31 +02:00
meta: extend meta.nixvimInfo
support treewide
Rather than supplying a `kind` and `name` pair, we now supply a raw path. This path could point to any nixvim option.
This commit is contained in:
parent
b2a477260d
commit
f34fda8d99
4 changed files with 28 additions and 23 deletions
|
@ -67,17 +67,18 @@ let
|
|||
filterAttrs (_: component: component.isOption && (isVisible component)) opts;
|
||||
path = removeWhitespace (concatStringsSep "/" path);
|
||||
moduleDoc =
|
||||
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 [ ]);
|
||||
maintainersNames = builtins.map (m: m.name) maintainers;
|
||||
in
|
||||
let
|
||||
info = optionalAttrs (hasAttrByPath path nixvimInfo) (getAttrFromPath path nixvimInfo);
|
||||
maintainers = lib.unique (options.config.meta.maintainers.${info.file} or [ ]);
|
||||
maintainersNames = builtins.map (m: m.name) maintainers;
|
||||
in
|
||||
# Make sure this path has a valid info attrset
|
||||
if info ? file && info ? description && info ? url then
|
||||
"# ${lib.last path}\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 != [ ]
|
||||
) "**Maintainers:** ${lib.concatStringsSep ", " maintainersNames}\n\n")
|
||||
else
|
||||
null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue