3
0
Fork 0
forked from mirrors/nixpkgs

doc: clean up makefile

The sectn and ulink hacks are not necessary since pandoc has been defaulting to Docbook 5 for a long time.
With the pandoc patches, we can get rid of id→xml:id replacement and xmlns hacks as well.
This commit is contained in:
Jan Tojnar 2020-12-04 20:25:34 +01:00
parent 16dfe8d7f2
commit 64b8489d54
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -87,24 +87,12 @@ functions/library/generated: doc-support/result
ln -rfs ./doc-support/result/function-docs functions/library/generated
%.section.xml: %.section.md
pandoc $^ -w docbook \
pandoc $^ -t docbook \
-f markdown+smart \
| sed -e 's|<ulink url=|<link xlink:href=|' \
-e 's|</ulink>|</link>|' \
-e 's|<sect. id=|<section xml:id=|' \
-e 's|</sect[0-9]>|</section>|' \
-e '1s| id=| xml:id=|' \
-e '1s|\(<[^ ]* \)|\1xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" |' \
| cat > $@
%.chapter.xml: %.chapter.md
pandoc $^ -w docbook \
pandoc $^ -t docbook \
--top-level-division=chapter \
-f markdown+smart \
| sed -e 's|<ulink url=|<link xlink:href=|' \
-e 's|</ulink>|</link>|' \
-e 's|<sect. id=|<section xml:id=|' \
-e 's|</sect[0-9]>|</section>|' \
-e '1s| id=| xml:id=|' \
-e '1s|\(<[^ ]* \)|\1|' \
| cat > $@