Skip to content

Commit 9caeb51

Browse files
committed
docs: don't remove freeform sub-options
This isn't a fully correct fix, but it's much closer to the intended behaviour.
1 parent 1952850 commit 9caeb51

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/mdbook/default.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ let
2424

2525
removeUnwanted =
2626
attrs:
27-
builtins.removeAttrs attrs [
27+
# FIXME: We incorrectly remove _freeformOptions here.
28+
#
29+
# However we can't fix the bug because we derive page names from attrnames;
30+
# the correct behaviour would be to ignore attrnames and use option locs.
31+
#
32+
# As a workaround, merge the freeform options at the top of these attrs,
33+
# however this can run into name conflicts 😢
34+
#
35+
# We should move this workaround to where we decide the page name and
36+
# whether to nest into a sub-page, so that we can keep the original
37+
# _freeformOptions attr as intended.
38+
attrs._freeformOptions or { }
39+
// builtins.removeAttrs attrs [
2840
"_module"
2941
"_freeformOptions"
3042
"warnings"

0 commit comments

Comments
 (0)