File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 23
23
./performance.nix
24
24
./plugins.nix
25
25
] ;
26
+
27
+ docs . optionPages . options = {
28
+ enable = true ;
29
+ optionScopes = [ ] ;
30
+ } ;
26
31
}
Original file line number Diff line number Diff line change 33
33
menu . location = [ "Contributing" ] ;
34
34
source = fixLinks ../../CONTRIBUTING.md ;
35
35
} ;
36
+ optionPages . docs = {
37
+ optionScopes = [ "docs" ] ;
38
+ page . menu . location = [ "docs" ] ;
39
+ page . text = ''
40
+ Internal options used to construct these docs.
41
+ '' ;
42
+ } ;
36
43
} ;
37
44
}
Original file line number Diff line number Diff line change 1
- { lib , ... } :
1
+ { lib , options , ... } :
2
2
let
3
3
inherit ( builtins ) readDir ;
4
- inherit ( lib . attrsets ) foldlAttrs ;
4
+ inherit ( lib . attrsets ) foldlAttrs mapAttrs' ;
5
5
inherit ( lib . lists ) optional ;
6
6
by-name = ../plugins/by-name ;
7
7
in
12
12
prev : name : type :
13
13
prev ++ optional ( type == "directory" ) ( by-name + "/${ name } " )
14
14
) [ ] ( readDir by-name ) ;
15
+
16
+ docs . optionPages =
17
+ let
18
+ mkPluginPages =
19
+ scope :
20
+ mapAttrs' (
21
+ name : _ :
22
+ let
23
+ loc = [
24
+ scope
25
+ name
26
+ ] ;
27
+ in
28
+ {
29
+ name = lib . concatStringsSep "/" loc ;
30
+ value = {
31
+ optionScopes = loc ;
32
+ } ;
33
+ }
34
+ ) options . ${ scope } ;
35
+ in
36
+ {
37
+ colorschemes = {
38
+ enable = true ;
39
+ optionScopes = [ "colorschemes" ] ;
40
+ } ;
41
+ plugins = {
42
+ enable = true ;
43
+ optionScopes = [ "plugins" ] ;
44
+ } ;
45
+ }
46
+ // mkPluginPages "plugins"
47
+ // mkPluginPages "colorschemes" ;
15
48
}
You can’t perform that action at this time.
0 commit comments