···
"--stringparam chunk.toc ${toc}"
151
+
linterFunctions = ''
152
+
# outputs the context of an xmllint error output
153
+
# LEN lines around the failing line are printed
155
+
# length of context
157
+
# lines to print before error line
160
+
# xmllint output lines are:
161
+
# file.xml:1234: there was an error on line 1234
162
+
while IFS=':' read -r file line rest; do
164
+
if [[ -n "$rest" ]]; then
165
+
echo "$file:$line:$rest"
166
+
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
167
+
# number lines & filter context
168
+
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
170
+
if [[ -n "$line" ]]; then
180
+
xmllint --debug --noout --nonet \
181
+
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
183
+
2>&1 | context 1>&2
184
+
# ^ redirect assumes xmllint doesn’t print to stdout
manual-combined = runCommand "nixos-manual-combined"
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
···
xmllint --xinclude --output ./manual-combined.xml ./manual.xml
160
-
xmllint --xinclude --noxincludenode \
161
-
--output ./man-pages-combined.xml ./man-pages.xml
163
-
# outputs the context of an xmllint error output
164
-
# LEN lines around the failing line are printed
166
-
# length of context
168
-
# lines to print before error line
171
-
# xmllint output lines are:
172
-
# file.xml:1234: there was an error on line 1234
173
-
while IFS=':' read -r file line rest; do
175
-
if [[ -n "$rest" ]]; then
176
-
echo "$file:$line:$rest"
177
-
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
178
-
# number lines & filter context
179
-
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
181
-
if [[ -n "$line" ]]; then
191
-
xmllint --debug --noout --nonet \
192
-
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
194
-
2>&1 | context 1>&2
195
-
# ^ redirect assumes xmllint doesn’t print to stdout
cp manual-combined.xml $out/
200
-
cp man-pages-combined.xml $out/
lintrng $out/manual-combined.xml
203
-
lintrng $out/man-pages-combined.xml
206
+
manpages-combined = runCommand "nixos-manpages-combined.xml"
207
+
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
208
+
meta.description = "The NixOS manpages as plain docbook XML";
212
+
cp -prd ${./man-pages.xml} man-pages.xml
213
+
ln -s ${optionsDoc.optionsDocBook} generated/options-db.xml
215
+
xmllint --xinclude --noxincludenode --output $out ./man-pages.xml
···
--param man.endnotes.are.numbered 0 \
--param man.break.after.slash 1 \
${docbook_xsl_ns}/xml/xsl/docbook/manpages/docbook.xsl \
303
-
${manual-combined}/man-pages-combined.xml
319
+
${manpages-combined}
mkdir -p $out/share/man/man5