File tree Expand file tree Collapse file tree 3 files changed +34
-45
lines changed Expand file tree Collapse file tree 3 files changed +34
-45
lines changed Original file line number Diff line number Diff line change 1212
1313 imports = [
1414 ./_util.nix
15- ./files.nix
1615 ./mdbook
1716 ./menu
1817 ./options.nix
1918 ./pages.nix
2019 ./platforms.nix
20+ ./user-guide.nix
2121 ] ;
2222
2323 config . docs = {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ pkgs ,
4+ ...
5+ } :
6+ let
7+ user-guide = ../../docs/user-guide ;
8+
9+ sourceTransformers = {
10+ config-examples =
11+ template :
12+ pkgs . callPackage ./user-configs.nix {
13+ inherit template ;
14+ } ;
15+ } ;
16+ in
17+ {
18+ docs . pages = lib . concatMapAttrs (
19+ name : type :
20+ let
21+ title = lib . removeSuffix ".md" name ;
22+ transformer = sourceTransformers . ${ title } or lib . id ;
23+ in
24+ lib . optionalAttrs ( type == "regular" ) {
25+ "user-guide/${ title } " = {
26+ menu . section = "user-guide" ;
27+ # TODO: define user-facing titles to show in the menu...
28+ menu . location = [ title ] ;
29+ source = transformer "${ user-guide } /${ name } " ;
30+ } ;
31+ }
32+ ) ( builtins . readDir user-guide ) ;
33+ }
You can’t perform that action at this time.
0 commit comments