mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
docs: simplify mdbook.nixvimOptions
impl
This commit is contained in:
parent
0562e519ec
commit
c693500a72
1 changed files with 3 additions and 3 deletions
|
@ -208,7 +208,7 @@ let
|
|||
nixvimOptions = mapModulesToString (
|
||||
name: opts:
|
||||
let
|
||||
isBranch = if name == "index" then true else opts.hasComponents && opts.index.options != { };
|
||||
isBranch = name == "index" || (opts.hasComponents && opts.index.options != { });
|
||||
|
||||
path =
|
||||
if isBranch then
|
||||
|
@ -218,9 +218,9 @@ let
|
|||
else
|
||||
"";
|
||||
|
||||
indentLevel = with builtins; length (filter isString (split "/" opts.index.path)) - 1;
|
||||
indentLevel = lib.count (c: c == "/") (lib.stringToCharacters opts.index.path);
|
||||
|
||||
padding = lib.concatStrings (builtins.genList (_: "\t") indentLevel);
|
||||
padding = lib.strings.replicate indentLevel "\t";
|
||||
in
|
||||
"${padding}- [${name}](${path})"
|
||||
) docs.modules;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue