Commit 061bcc9a authored by Petr Kovář's avatar Petr Kovář Committed by Petr Kovář

Add schematron checks to CI for gnome-help & system-admin-guide

Wrap yelp-check tests in the shell script since they don't emit
desired exit codes.

Also, remove unused a11y-feature.page.tmpl.
parent 1b193335
......@@ -3,10 +3,7 @@ build-fedora:
before_script:
- dnf install -y git autoconf automake make gettext itstool libxslt yelp-tools
script:
- yelp-check ids gnome-help/C system-admin-guide/C
- yelp-check links gnome-help/C system-admin-guide/C
- yelp-check orphans gnome-help/C system-admin-guide/C
- yelp-check validate gnome-help/C system-admin-guide/C
- ./check.sh
- ./autogen.sh ITSTOOL="/usr/bin/itstool --strict"
- make
- make check
#!/bin/bash
xmllint --noout --schematron gnome-help/C/gnome-help.sct gnome-help/C/*.page 2>&1 | \
grep -v validates | \
grep . && echo 'schematron for gnome-help: FAIL' && exit 1 || \
echo 'schematron for gnome-help: PASS'
xmllint --noout --schematron system-admin-guide/C/system-admin-guide.sct system-admin-guide/C/*.page 2>&1 | \
grep -v validates | \
grep . && echo 'schematron for system-admin-guide: FAIL' && exit 1 || \
echo 'schematron for system-admin-guide: PASS'
yelp-check ids gnome-help/C system-admin-guide/C | \
grep . && echo 'yelp-check ids: FAIL' && exit 1 || \
echo 'yelp-check ids: PASS'
yelp-check links gnome-help/C system-admin-guide/C | \
grep . && echo 'yelp-check links: FAIL' && exit 1 || \
echo 'yelp-check links: PASS'
yelp-check orphans gnome-help/C system-admin-guide/C | \
grep . && echo 'yelp-check orphans: FAIL' && exit 1 || \
echo 'yelp-check orphans: PASS'
yelp-check validate gnome-help/C system-admin-guide/C | \
grep . && echo 'yelp-check validate: FAIL' && exit 1 || \
echo 'yelp-check validate: PASS'
<?yelp-tmpl-desc Description of how to accomplish a user task?>
<page xmlns="http://projectmallard.org/1.0/"
type="topic" style="a11y"
id="@ID@">
<info>
<link type="guide" xref="a11y"/>
<revision pkgversion="@VERSION@" date="@DATE@" status="stub"/>
<credit type="author copyright">
<name>@NAME@</name>
<email>@EMAIL@</email>
<years>@YEAR@</years>
</credit>
<desc></desc>
</info>
<title>@TITLE@</title>
<comment>
<cite date="@DATE@" href="mailto:@EMAIL@">@NAME@</cite>
<p>This assumes the reader knows how to.... By the end of this page,
the reader will be able to....</p>
</comment>
<p>Short introductory text...</p>
<steps>
<item>
<p>First step...</p>
</item>
<item>
<p>Second step...</p>
</item>
<item>
<p>Third step...</p>
</item>
</steps>
</page>
......@@ -17,8 +17,10 @@ xmllint --noout --schematron gnome-help.sct *.page 2>&1 | grep -v 'validates$'
</rule>
<rule context="mal:page/mal:info/mal:desc">
<assert test="mal:link or
substring(normalize-space(.), string-length(normalize-space(.))) = '.'"
>Desc must end with a period</assert>
substring(normalize-space(.), string-length(normalize-space(.))) = '.' or
mal:link or
substring(normalize-space(.), string-length(normalize-space(.))) = '?'"
>Desc must end with a period or question mark</assert>
</rule>
<rule context="mal:page/mal:info/mal:desc/mal:link">
<assert test="substring(normalize-space(..), string-length(normalize-space(..)) - 2) = '...' or
......
xmllint --noout --schematron gnome-help.sct *.page 2>&1 | grep -v validates
<?run this:
xmllint --noout --schematron gnome-help.sct *.page 2>&1 | grep -v 'validates$'
?>
<schema xmlns="http://www.ascc.net/xml/schematron" >
<title>Some sanity checks for the GNOME desktop help</title>
<ns prefix="mal" uri="http://projectmallard.org/1.0/"/>
<ns prefix="xi" uri="http://www.w3.org/2001/XInclude"/>
<pattern name="Info element checks">
<rule context="mal:page/mal:info">
<assert test="not(mal:license)">Must not include license directly</assert>
<!-- FIXME: https://gitlab.gnome.org/GNOME/gnome-user-docs/issues/9
<assert test="xi:include[@href='legal.xml']">Must include legal.xml</assert>
-->
</rule>
</pattern>
<pattern name="Desc checks">
<rule context="mal:page/mal:info">
<assert test="normalize-space(mal:desc) != ''">Must have non-empty desc</assert>
</rule>
<rule context="mal:page/mal:info/mal:desc">
<assert test="mal:link or
substring(normalize-space(.), string-length(normalize-space(.))) = '.' or
mal:link or
substring(normalize-space(.), string-length(normalize-space(.))) = '?'"
>Desc must end with a period or question mark</assert>
</rule>
<rule context="mal:page/mal:info/mal:desc/mal:link">
<assert test="substring(normalize-space(..), string-length(normalize-space(..)) - 2) = '...' or
substring(normalize-space(..), string-length(normalize-space(..))) = '…'"
>Desc with links must end with an ellipsis</assert>
</rule>
</pattern>
</schema>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment