1 |
commit: 2330779776b8ed53ec91629db2d2d56b65e64eb7 |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 28 16:24:51 2019 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 2 12:43:21 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=23307797 |
7 |
|
8 |
Makefile: add new app-text/tidy-html5 sanity check. |
9 |
|
10 |
This new PHONY "make tidy" target runs the tidy-html5 program, using a |
11 |
new .tidyrc file, to ensure that the HTML we have generated is free |
12 |
from certain problems. In particular, it should complain if bug 626032 |
13 |
ever resurfaces and there are duplicate identifiers in some document. |
14 |
|
15 |
Closes: https://bugs.gentoo.org/626032 |
16 |
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org> |
17 |
[Command line options instead of .tidyrc file. Don't fail on first error.] |
18 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
19 |
|
20 |
Makefile | 12 +++++++++++- |
21 |
1 file changed, 11 insertions(+), 1 deletion(-) |
22 |
|
23 |
diff --git a/Makefile b/Makefile |
24 |
index 17be902..407decf 100644 |
25 |
--- a/Makefile |
26 |
+++ b/Makefile |
27 |
@@ -49,7 +49,17 @@ validate: prereq |
28 |
@xmllint --noout --dtdvalid devbook.dtd $(XMLS) \ |
29 |
&& echo "xmllint validation successful" |
30 |
|
31 |
+# Run app-text/tidy-html5 on the output to detect mistakes. |
32 |
+# We have to loop through them because otherwise tidy won't |
33 |
+# tell you which file contains a mistake. |
34 |
+tidy: $(HTMLS) |
35 |
+ @for f in $(HTMLS); do \ |
36 |
+ output=$$(tidy -q -errors --drop-empty-elements no $${f} 2>&1) \ |
37 |
+ || { status=$$?; echo "Failed on $${f}:"; echo "$${output}"; }; \ |
38 |
+ done; \ |
39 |
+ exit $${status} |
40 |
+ |
41 |
clean: |
42 |
rm -f $(HTMLS) $(IMAGES) _documents.js documents.js |
43 |
|
44 |
-.PHONY: all prereq validate clean |
45 |
+.PHONY: all prereq validate tidy clean |