diff options
author | 2022-01-16 22:59:15 +0100 | |
---|---|---|
committer | 2022-01-24 19:16:10 +0100 | |
commit | 6ef11f64a2d763360542bd6a3c74da46f15dfa23 (patch) | |
tree | ccf7746a2b20e677c608234a4e1def1440db9f77 /Makefile | |
parent | ebuild-writing/common-mistakes: .diff -> .patch (diff) | |
download | devmanual-6ef11f64a2d763360542bd6a3c74da46f15dfa23.tar.gz devmanual-6ef11f64a2d763360542bd6a3c74da46f15dfa23.tar.bz2 devmanual-6ef11f64a2d763360542bd6a3c74da46f15dfa23.zip |
devbook.rnc: Change from DTD to RELAX NG compact schema
The currently used DTD format has several limitations. It does not
support data types, and it is not expressive enough for some element
syntax used in the devmanual. For example, it cannot accurately
describe the uri element which comes in two alternative forms
(namely, with the link in its body text or as an attribute).
RELAX NG is chosen because it has a variant with a compact and very
readable non-XML syntax, and it is well supported both as an input and
as an output format by conversion tools like app-text/trang. Also, we
need RNC for app-emacs/nxml-gentoo-schemas anyway.
devbook.rnc is the source file, but the generated devbook.rng is also
committed to the repository, in order to avoid an additional
dependency on trang or rnc2rng.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -82,10 +82,16 @@ install: all install -m 644 $(JS_FILES) "$(DESTDIR)$(htmldir)"/; \ fi -validate: - @xmllint --noout --dtdvalid devbook.dtd $(XMLS) +# Not all versions of xmllint support --quiet, so test for it first +validate: devbook.rng + @opt=--quiet; xmllint --help 2>&1 | grep -q -- --quiet || opt=; \ + xmllint --noout $${opt} --relaxng $< $(XMLS) @echo "xmllint validation successful" +%.rng: %.rnc + trang $< $@ + sed -i -e '2s/^/<!-- Auto-generated from $<; do not edit! -->\n/' $@ + # Run app-text/htmltidy on the output to detect mistakes. # We have to loop through them because otherwise tidy won't # tell you which file contains a mistake. |