mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 20:53:48 +00:00
c45deeb2aa
we want to make sure that rendering the manual from markdown without going through docbook produces (semantically) the same output as with going through docbook. to ensure this we'll build the manual twice, run each manual through html-tidy to generate a normalized form and diff the normalized forms. we don't want to compare raw output because that exposes us to a lot of whitespace we'd have to reproduce exactly in the MD render. this check may be relaxed even further in the future, but hopefully not by much.
22 lines
407 B
Bash
Executable File
22 lines
407 B
Bash
Executable File
#!/usr/bin/env nix-shell
|
|
#! nix-shell -i bash -p html-tidy
|
|
|
|
set -euo pipefail
|
|
shopt -s inherit_errexit
|
|
|
|
normalize() {
|
|
tidy \
|
|
--anchor-as-name no \
|
|
--coerce-endtags no \
|
|
--escape-scripts no \
|
|
--fix-backslash no \
|
|
--fix-style-tags no \
|
|
--fix-uri no \
|
|
--indent yes \
|
|
--wrap 0 \
|
|
< "$1" \
|
|
2> /dev/null
|
|
}
|
|
|
|
diff -U3 <(normalize "$1") <(normalize "$2")
|