treewide: drop support for mdbook < 0.5
25.11 is dead, and so is mdbook 0.4 Also reenable linkcheck which was doing nothing this whole time lmao Change-Id: I4a8b9c763b881de840d6ef1b1d85bf19941f4386
This commit is contained in:
@@ -24,8 +24,7 @@ def map_contents_recursively(transformer):
|
||||
def process_command:
|
||||
.[0] as $context |
|
||||
.[1] as $body |
|
||||
# XXX FUTURE: drop sections once mdBook is at 0.5.0 or above in nixpkgs
|
||||
$body | (.items? // .sections) |= map(map_contents_recursively(if $context.renderer == "html" then transform_anchors_html else transform_anchors_strip end))
|
||||
$body | .items |= map(map_contents_recursively(if $context.renderer == "html" then transform_anchors_html else transform_anchors_strip end))
|
||||
;
|
||||
|
||||
process_command
|
||||
|
||||
@@ -31,12 +31,11 @@ command = "jq --from-file anchors.jq"
|
||||
|
||||
[output.markdown]
|
||||
|
||||
# XXX FUTURE: may be reenabled once mdBook 0.5.0 or above and matching mdbook-linkchecker are in nixpkgs
|
||||
#[output.linkcheck]
|
||||
[output.linkcheck2]
|
||||
# no Internet during the build (in the sandbox)
|
||||
#follow-web-links = false
|
||||
follow-web-links = false
|
||||
|
||||
# mdbook-linkcheck does not understand [foo]{#bar} style links, resulting in
|
||||
# excessive "Potential incomplete link" warnings. No other kind of warning was
|
||||
# produced at the time of writing.
|
||||
#warning-policy = "ignore"
|
||||
warning-policy = "ignore"
|
||||
|
||||
@@ -51,7 +51,7 @@ $ nix-shell -A native-clangStdenvPackages
|
||||
|
||||
### Building from the development shell
|
||||
|
||||
We have a [justfile](just.systems) for extra convenient building.
|
||||
We have a [justfile](https://just.systems/) for extra convenient building.
|
||||
It defaults to using `./build` as the build directory, and `$out` (`./outputs/out`) as the install directory.
|
||||
For most cases, you can clean-build, install, and run the tests with:
|
||||
|
||||
|
||||
@@ -70,11 +70,6 @@ def do_include(content: str, relative_md_path: Path, source_root: Path, search_p
|
||||
|
||||
def recursive_replace(data, book_root, search_path):
|
||||
match data:
|
||||
# XXX FUTURE: drop sections once mdBook is at 0.5.0 or above in nixpkgs
|
||||
case {'sections': sections}:
|
||||
return data | dict(
|
||||
sections = [recursive_replace(section, book_root, search_path) for section in sections],
|
||||
)
|
||||
case {'items': items}:
|
||||
return data | dict(
|
||||
items = [recursive_replace(item, book_root, search_path) for item in items],
|
||||
|
||||
+5
-13
@@ -38,9 +38,8 @@
|
||||
lowdown-unsandboxed,
|
||||
lowdown,
|
||||
mdbook,
|
||||
# older nixpkgs only have v1, newer nixpkgs only have v2
|
||||
mdbook-linkcheck ? null,
|
||||
mdbook-linkcheck2 ? mdbook-linkcheck,
|
||||
mdbook-linkcheck2,
|
||||
cacert,
|
||||
mercurial,
|
||||
meson,
|
||||
ninja,
|
||||
@@ -511,17 +510,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
]
|
||||
++ [
|
||||
(lib.getBin lowdown-unsandboxed)
|
||||
(lib.warnIf
|
||||
(
|
||||
# if mdbook 0.5 is backported to 25.11
|
||||
(lib.trivial.release == "25.11" && lib.versionAtLeast mdbook.version "0.5.0")
|
||||
# or 25.11 is EOL
|
||||
|| (lib.trivial.oldestSupportedRelease > 2511)
|
||||
)
|
||||
"Workarounds for mdbook 0.4.x/0.5.x interoperability can be removed as 0.5.0 is in nixpkgs-stable"
|
||||
mdbook
|
||||
)
|
||||
mdbook
|
||||
mdbook-linkcheck2
|
||||
# linkcheck wants a root cert to exist, even if we never actually hit the network
|
||||
cacert
|
||||
]
|
||||
++ [
|
||||
pkg-config
|
||||
|
||||
Reference in New Issue
Block a user