mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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 (
|
nixvimOptions = mapModulesToString (
|
||||||
name: opts:
|
name: opts:
|
||||||
let
|
let
|
||||||
isBranch = if name == "index" then true else opts.hasComponents && opts.index.options != { };
|
isBranch = name == "index" || (opts.hasComponents && opts.index.options != { });
|
||||||
|
|
||||||
path =
|
path =
|
||||||
if isBranch then
|
if isBranch then
|
||||||
|
@ -218,9 +218,9 @@ let
|
||||||
else
|
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
|
in
|
||||||
"${padding}- [${name}](${path})"
|
"${padding}- [${name}](${path})"
|
||||||
) docs.modules;
|
) docs.modules;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue