Skip to content

Commit 5b7cd22

Browse files
committed
docs: fix rendering
Fix link to extra modules. Fix separation between section items.
1 parent 9003cd9 commit 5b7cd22

9 files changed

Lines changed: 10 additions & 7 deletions

File tree

default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let
1212
type = data.${name};
1313
in
1414
sum ++
15-
(if type == "regular" then [ (import path) ]
15+
(if type == "regular" then [ path ]
1616
# assume it's a directory
1717
else importTree path);
1818
in
@@ -23,7 +23,7 @@ rec {
2323
cli = pkgs.callPackage ./devshell { };
2424

2525
# Folder that contains all the extra modules
26-
extraModulesDir = toString ./modules_extra;
26+
extraModulesDir = toString ./extra;
2727

2828
# Get the modules documentation from an empty evaluation
2929
modules-docs = (eval {

modules/modules-docs.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ let
126126
+ (lib.optionalString opt.internal "\n**internal**\n")
127127
+ opt.description + "\n"
128128
+ (lib.optionalString (opt ? default && opt.default != null) ''
129+
129130
**Default value**:
130131
```nix
131132
${
@@ -143,24 +144,26 @@ let
143144
144145
'')
145146
+ ''
146-
**Type**: ${opt.type}
147147
148+
**Type**: ${opt.type}
148149
''
149150
+ (lib.optionalString (opt ? example) ''
151+
150152
**Example value**:
151153
```nix
152154
${builtins.toJSON opt.example}
153155
```
154156
155157
'')
156158
+ ''
159+
157160
Declared in:
158161
''
159162
+ (
160163
lib.concatStringsSep
161164
"\n"
162165
(map
163-
(decl: "* [./modules/${decl.path}](${decl.url})")
166+
(decl: "* [${decl.path}](${decl.url})")
164167
opt.declarations
165168
)
166169
)

modules/modules.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let
1212
# Configure modules-docs
1313
config.modules-docs.roots = [{
1414
url = "https://github.com/numtide/devshell";
15-
path = ../.;
15+
path = toString ../.;
1616
branch = "master";
1717
}];
1818
}

tests/extra/language.c.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
language-c-1 =
55
let
66
shell = devshell.mkShell {
7-
imports = [ ../../modules_extra/language/c.nix ];
7+
imports = [ ../../extra/language/c.nix ];
88
devshell.name = "devshell-1";
99
};
1010
in

tests/extra/language.rust.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
simple =
55
let
66
shell = devshell.mkShell {
7-
imports = [ ../../modules_extra/language/rust.nix ];
7+
imports = [ ../../extra/language/rust.nix ];
88
devshell.name = "language-rust-simple";
99
};
1010
in

0 commit comments

Comments
 (0)