Skip to content

Commit ce7b3a7

Browse files
authored
refactor(docgen): split redirects out into their own file (#266)
1 parent f19b617 commit ce7b3a7

File tree

2 files changed

+71
-62
lines changed

2 files changed

+71
-62
lines changed

docs/default.nix

Lines changed: 13 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -54,71 +54,22 @@ let
5454
}) wlib.wrapperModules;
5555
in
5656
{
57-
imports = [ wlib.wrapperModules.mdbook ];
57+
imports = [
58+
wlib.wrapperModules.mdbook
59+
./redirects.nix
60+
];
5861
mainBook = "nix-wrapper-modules";
5962
books.nix-wrapper-modules = {
60-
book.book = {
61-
src = "src";
62-
authors = [ "BirdeeHub" ];
63-
language = "en";
64-
title = "nix-wrapper-modules";
65-
description = "Make wrapper derivations with the module system! Use the existing modules, or write your own!";
63+
book = {
64+
book = {
65+
src = "src";
66+
authors = [ "BirdeeHub" ];
67+
language = "en";
68+
title = "nix-wrapper-modules";
69+
description = "Make wrapper derivations with the module system! Use the existing modules, or write your own!";
70+
};
71+
output.html.git-repository-url = "https://github.com/BirdeeHub/nix-wrapper-modules";
6672
};
67-
book.output.html.git-repository-url = "https://github.com/BirdeeHub/nix-wrapper-modules";
68-
book.output.html.redirect =
69-
lib.pipe
70-
[
71-
"alacritty"
72-
"atool"
73-
"btop"
74-
"claude-code"
75-
"foot"
76-
"fuzzel"
77-
"git"
78-
"helix"
79-
"jujutsu"
80-
"mako"
81-
"mpv"
82-
"neovim"
83-
"niri"
84-
"notmuch"
85-
"nushell"
86-
"opencode"
87-
"ov"
88-
"rofi"
89-
"tealdeer"
90-
"tmux"
91-
"vim"
92-
"waybar"
93-
"wezterm"
94-
"xplr"
95-
"yazi"
96-
]
97-
[
98-
(map (n: {
99-
name = "/${n}.html";
100-
value = "wrapperModules/${n}.html";
101-
}))
102-
builtins.listToAttrs
103-
(
104-
v:
105-
v
106-
// {
107-
"/home.html" = "/md/intro.html";
108-
"/getting-started.html" = "/md/getting-started.html";
109-
"/lib-intro.html" = "/md/lib-intro.html";
110-
"/wlib.html" = "/lib/wlib.html";
111-
"/types.html" = "/lib/types.html";
112-
"/dag.html" = "/lib/dag.html";
113-
"/core.html" = "/lib/core.html";
114-
"/helper-modules.html" = "/md/helper-modules.html";
115-
"/wrapper-modules.html" = "/md/wrapper-modules.html";
116-
"/default.html" = "/modules/default.html";
117-
"/makeWrapper.html" = "/modules/makeWrapper.html";
118-
"/symlinkScript.html" = "/modules/symlinkScript.html";
119-
}
120-
)
121-
];
12273
summary = [
12374
{
12475
data = "title";

docs/redirects.nix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{ lib, ... }:
2+
{
3+
books.nix-wrapper-modules.book.output.html.redirect =
4+
lib.pipe
5+
[
6+
"alacritty"
7+
"atool"
8+
"btop"
9+
"claude-code"
10+
"foot"
11+
"fuzzel"
12+
"git"
13+
"helix"
14+
"jujutsu"
15+
"mako"
16+
"mpv"
17+
"neovim"
18+
"niri"
19+
"notmuch"
20+
"nushell"
21+
"opencode"
22+
"ov"
23+
"rofi"
24+
"tealdeer"
25+
"tmux"
26+
"vim"
27+
"waybar"
28+
"wezterm"
29+
"xplr"
30+
"yazi"
31+
]
32+
[
33+
(map (n: {
34+
name = "/${n}.html";
35+
value = "wrapperModules/${n}.html";
36+
}))
37+
builtins.listToAttrs
38+
(
39+
v:
40+
v
41+
// {
42+
"/home.html" = "/md/intro.html";
43+
"/getting-started.html" = "/md/getting-started.html";
44+
"/lib-intro.html" = "/md/lib-intro.html";
45+
"/wlib.html" = "/lib/wlib.html";
46+
"/types.html" = "/lib/types.html";
47+
"/dag.html" = "/lib/dag.html";
48+
"/core.html" = "/lib/core.html";
49+
"/helper-modules.html" = "/md/helper-modules.html";
50+
"/wrapper-modules.html" = "/md/wrapper-modules.html";
51+
"/default.html" = "/modules/default.html";
52+
"/makeWrapper.html" = "/modules/makeWrapper.html";
53+
"/symlinkScript.html" = "/modules/symlinkScript.html";
54+
}
55+
)
56+
];
57+
58+
}

0 commit comments

Comments
 (0)