Skip to content

Commit

Permalink
Merge pull request #572 from elifesciences/pr-572
Browse files Browse the repository at this point in the history
Add slab links
  • Loading branch information
fred-atherden authored Oct 23, 2023
2 parents aaf4708 + c67f517 commit 491abdd
Show file tree
Hide file tree
Showing 45 changed files with 311 additions and 204 deletions.
66 changes: 33 additions & 33 deletions src/final-JATS-schematron.sch

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/final-JATS-schematron.xsl

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions src/final-package-JATS-schematron.sch

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions src/pre-JATS-schematron.sch

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/pre-JATS-schematron.xsl

Large diffs are not rendered by default.

105 changes: 70 additions & 35 deletions src/schematron.sch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@
</xsl:function>
<pattern id="house-style">
<rule context="break" id="break-tests">
<assert test="ancestor::td or ancestor::th" role="error" id="break-placement">The break element is only permitted as a child (or descendant) of a table cell. This one is placed elsewhere (<value-of select="concat(string-join(for $x in ancestor::* return $x/name(),'/'),'/',name())"/>).</assert>
<assert see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hmp1c-break-placement" test="ancestor::td or ancestor::th" role="error" id="break-placement">The break element is only permitted as a child (or descendant) of a table cell. This one is placed elsewhere (<value-of select="concat(string-join(for $x in ancestor::* return $x/name(),'/'),'/',name())"/>).</assert>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="house-style">
<rule context="article//styled-content" id="colour-styled-content-v2">
<let name="allowed-values" value="('color: #366BFB;','color: #9C27B0;','color: #D50000;')"/>
<report test="@style = $allowed-values" role="warning" id="colour-styled-content-flag">
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#h3819-colour-styled-content-flag" test="@style = $allowed-values" role="warning" id="colour-styled-content-flag">
<value-of select="."/> has colour formatting. Is this correct? Preceding text - <value-of select="substring(preceding-sibling::text()[1],string-length(preceding-sibling::text()[1])-25)"/>
</report>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="house-style">
<rule context="article//styled-content" id="colour-styled-content-v2">
<let name="allowed-values" value="('color: #366BFB;','color: #9C27B0;','color: #D50000;')"/>
<assert test="@style = $allowed-values" role="error" id="final-styled-content-style-check">
<assert see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#h7uzr-final-styled-content-style-check" test="@style = $allowed-values" role="error" id="final-styled-content-style-check">
<value-of select="."/> - text in <value-of select="parent::*/name()"/> element is captured in a &lt;styled-content style="<value-of select="@style"/>"&gt;. The only allowed values for the @style are <value-of select="string-join($allowed-values,', ')"/>.</assert>
</rule>
</pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="house-style">
<rule context="article//styled-content" id="colour-styled-content-v2">
<let name="allowed-values" value="('color: #366BFB;','color: #9C27B0;','color: #D50000;')"/>
<assert test="@style = $allowed-values" role="warning" id="pre-styled-content-style-check">
<assert see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hm00e-pre-styled-content-style-check" test="@style = $allowed-values" role="warning" id="pre-styled-content-style-check">
<value-of select="."/> - text in <value-of select="parent::*/name()"/> element is captured in a &lt;styled-content style="<value-of select="@style"/>"&gt;. The only allowed values for the @style are <value-of select="string-join($allowed-values,', ')"/> as only blue, purple, and red text is permitted (respectively). If this is coloured text and it is not one of the allowed colours, please query the authors - 'eLife only supports the following colours for text - red, blue and purple. Please confirm how you would like the colour(s) here captured given this information.'</assert>
</rule>
</pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="house-style">
<rule context="article//body//named-content[not(@content-type='sequence')]|article//back//named-content[not(@content-type='sequence')]" id="colour-styled-content">
<let name="parent" value="parent::*/local-name()"/>
<report test="." role="error" id="final-colour-styled-content-check">'<value-of select="."/>' - <value-of select="$parent"/> element contains a named content element. This is not allowed for coloured text. Please ensure that &lt;styled-content&gt; is used with the three permitted colours for text - red, blue and purple.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hqmsd-final-colour-styled-content-check" test="." role="error" id="final-colour-styled-content-check">'<value-of select="."/>' - <value-of select="$parent"/> element contains a named content element. This is not allowed for coloured text. Please ensure that &lt;styled-content&gt; is used with the three permitted colours for text - red, blue and purple.</report>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="house-style">
<rule context="article//body//named-content[not(@content-type='sequence')]|article//back//named-content[not(@content-type='sequence')]" id="colour-styled-content">
<let name="parent" value="parent::*/local-name()"/>
<report test="." role="warning" id="pre-colour-styled-content-check">'<value-of select="."/>' - <value-of select="$parent"/> element contains a named content element. If it is red, blue or purple then it should be tagged using &lt;styled-content&gt;. If it is not, then the author will need to be queried - 'eLife only supports the following colours for text - red, blue and purple. Please confirm how you would like the colour(s) here captured given this information.'</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#h8td5-pre-colour-styled-content-check" test="." role="warning" id="pre-colour-styled-content-check">'<value-of select="."/>' - <value-of select="$parent"/> element contains a named content element. If it is red, blue or purple then it should be tagged using &lt;styled-content&gt;. If it is not, then the author will need to be queried - 'eLife only supports the following colours for text - red, blue and purple. Please confirm how you would like the colour(s) here captured given this information.'</report>
</rule>
</pattern>
</schema>
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="content-containers">
<rule context="disp-quote" id="disp-quote-tests">
<let name="subj" value="ancestor::article//subj-group[@subj-group-type='display-channel']/subject[1]"/>
<report test="not(ancestor::sub-article) and ($subj=$research-subj)" role="error" id="disp-quote-test-2">Display quote in a <value-of select="$subj"/> is not allowed. Please capture as paragraph instead - '<value-of select="."/>'</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hq129-disp-quote-test-2" test="not(ancestor::sub-article) and ($subj=$research-subj)" role="error" id="disp-quote-test-2">Display quote in a <value-of select="$subj"/> is not allowed. Please capture as paragraph instead - '<value-of select="."/>'</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
2 changes: 2 additions & 0 deletions test/tests/gen/event-desc-tests/event-desc-content-2/fail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Message: that's a child of an event with an eLife DOI must contain the text 'Th






<!--Context: event-desc
Expand Down Expand Up @@ -188,6 +189,7 @@ Message: that's a child of an event with an eLife DOI must contain the text 'Th






<self-uri content-type="preprint" xlink:href="https://elifesciences.org/preprints/1234567890v1"/>
Expand Down
2 changes: 2 additions & 0 deletions test/tests/gen/event-desc-tests/event-desc-content-2/pass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Message: that's a child of an event with an eLife DOI must contain the text 'Th






<!--Context: event-desc
Expand Down Expand Up @@ -188,6 +189,7 @@ Message: that's a child of an event with an eLife DOI must contain the text 'Th






<self-uri content-type="preprint" xlink:href="https://elifesciences.org/preprints/1234567890v1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@
</xsl:function>
<pattern id="content-containers">
<rule context="ext-link[@ext-link-type='uri' and not(ancestor::sec[@sec-type='data-availability']) and not(parent::element-citation) and not(ancestor::table-wrap) and string-length(.) gt 59]" id="ext-link-tests-2">
<report test=". = @xlink:href" role="info" id="ext-link-length">Consider embedding long URLs in text instead of displaying in full, where appropriate. This is a very long URL - <value-of select="."/>.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#ho1mi-ext-link-length" test=". = @xlink:href" role="info" id="ext-link-length">Consider embedding long URLs in text instead of displaying in full, where appropriate. This is a very long URL - <value-of select="."/>.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
<let name="parent" value="parent::*[1]/local-name()"/>
<let name="form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then $x/local-name() else () ,', ')"/>
<let name="non-form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then () else ($x/local-name()) ,', ')"/>
<assert test="$non-form-children=''" role="error" id="ext-link-child-test-2">ext-link - <value-of select="."/> - has a non-formatting child element - <value-of select="$non-form-children"/> - which is not correct.</assert>
<assert see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hce3u-ext-link-child-test-2" test="$non-form-children=''" role="error" id="ext-link-child-test-2">ext-link - <value-of select="."/> - has a non-formatting child element - <value-of select="$non-form-children"/> - which is not correct.</assert>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
<let name="parent" value="parent::*[1]/local-name()"/>
<let name="form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then $x/local-name() else () ,', ')"/>
<let name="non-form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then () else ($x/local-name()) ,', ')"/>
<report test="(matches(.,'^https?:..(www\.)?[-a-zA-Z0-9@:%.,_\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%,_\+.~#?&amp;//=]*)$|^ftp://.|^git://.|^tel:.|^mailto:.') and ($form-children!=''))" role="error" id="ext-link-child-test">ext-link - <value-of select="."/> - has a formatting child element - <value-of select="$form-children"/> - which is not correct.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#h5vog-ext-link-child-test" test="(matches(.,'^https?:..(www\.)?[-a-zA-Z0-9@:%.,_\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%,_\+.~#?&amp;//=]*)$|^ftp://.|^git://.|^tel:.|^mailto:.') and ($form-children!=''))" role="error" id="ext-link-child-test">ext-link - <value-of select="."/> - has a formatting child element - <value-of select="$form-children"/> - which is not correct.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
<let name="parent" value="parent::*[1]/local-name()"/>
<let name="form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then $x/local-name() else () ,', ')"/>
<let name="non-form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then () else ($x/local-name()) ,', ')"/>
<report test="(matches(.,'^https?:..(www\.)?[-a-zA-Z0-9@:%.,_\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%,_\+.~#?&amp;//=]*)$|^ftp://.|^git://.|^tel:.|^mailto:.') and $parent = $formatting-elems)" role="warning" id="ext-link-parent-test">ext-link - <value-of select="."/> - has a formatting parent element - <value-of select="$parent"/> - which almost certainly unnecessary.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#himma-ext-link-parent-test" test="(matches(.,'^https?:..(www\.)?[-a-zA-Z0-9@:%.,_\+~#=]{2,256}\.[a-z]{2,6}([-a-zA-Z0-9@:%,_\+.~#?&amp;//=]*)$|^ftp://.|^git://.|^tel:.|^mailto:.') and $parent = $formatting-elems)" role="warning" id="ext-link-parent-test">ext-link - <value-of select="."/> - has a formatting parent element - <value-of select="$parent"/> - which almost certainly unnecessary.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
<let name="parent" value="parent::*[1]/local-name()"/>
<let name="form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then $x/local-name() else () ,', ')"/>
<let name="non-form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then () else ($x/local-name()) ,', ')"/>
<report test="(.!=@xlink:href) and matches(.,'https?:|ftp:|www\.')" role="warning" id="ext-link-text">The text for a URL is '<value-of select="."/>' (which looks like a URL), but it is not the same as the actual embedded link, which is '<value-of select="@xlink:href"/>'.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hyyhg-ext-link-text" test="(.!=@xlink:href) and matches(.,'https?:|ftp:|www\.')" role="warning" id="ext-link-text">The text for a URL is '<value-of select="."/>' (which looks like a URL), but it is not the same as the actual embedded link, which is '<value-of select="@xlink:href"/>'.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
<let name="parent" value="parent::*[1]/local-name()"/>
<let name="form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then $x/local-name() else () ,', ')"/>
<let name="non-form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then () else ($x/local-name()) ,', ')"/>
<report test="matches(@xlink:href,'\.$')" role="error" id="url-fullstop-report">'<value-of select="@xlink:href"/>' - Link ends in a full stop which is incorrect.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#htqb8-url-fullstop-report" test="matches(@xlink:href,'\.$')" role="error" id="url-fullstop-report">'<value-of select="@xlink:href"/>' - Link ends in a full stop which is incorrect.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
<let name="parent" value="parent::*[1]/local-name()"/>
<let name="form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then $x/local-name() else () ,', ')"/>
<let name="non-form-children" value="string-join( for $x in child::* return if ($x/local-name()=$formatting-elems) then () else ($x/local-name()) ,', ')"/>
<report test="matches(@xlink:href,'[\p{Zs}]')" role="error" id="url-space-report">'<value-of select="@xlink:href"/>' - Link contains a space which is incorrect.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hjtq3-url-space-report" test="matches(@xlink:href,'[\p{Zs}]')" role="error" id="url-space-report">'<value-of select="@xlink:href"/>' - Link contains a space which is incorrect.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@
<let name="count" value="count(descendant::named-content[@content-type='sequence'])"/>
<let name="text-tokens" value="for $x in tokenize(.,' ') return if (matches($x,'[ACGTacgt]{15,}')) then $x else ()"/>
<let name="text-count" value="count($text-tokens)"/>
<assert test="($text-count le $count)" role="warning" id="gene-primer-sequence-test">p element contains what looks like an untagged primer or gene sequence - <value-of select="string-join($text-tokens,', ')"/>.</assert>
<assert see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hlpdc-gene-primer-sequence-test" test="($text-count le $count)" role="warning" id="gene-primer-sequence-test">p element contains what looks like an untagged primer or gene sequence - <value-of select="string-join($text-tokens,', ')"/>.</assert>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="content-containers">
<rule context="list-item" id="list-item-tests">
<let name="type" value="ancestor::list[1]/@list-type"/>
<report test="($type='alpha-lower') and matches(.,'^\p{Zs}?[a-h|j-w|y-z][\.|\)]? ')" role="warning" id="alpha-lower-test-1">list-item is part of an alpha-lower list, but it begins with a single lower-case letter. Is this correct? <value-of select="."/>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#h8efq-alpha-lower-test-1" test="($type='alpha-lower') and matches(.,'^\p{Zs}?[a-h|j-w|y-z][\.|\)]? ')" role="warning" id="alpha-lower-test-1">list-item is part of an alpha-lower list, but it begins with a single lower-case letter. Is this correct? <value-of select="."/>
</report>
</rule>
</pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="content-containers">
<rule context="list-item" id="list-item-tests">
<let name="type" value="ancestor::list[1]/@list-type"/>
<report test="($type='alpha-upper') and matches(.,'^\p{Zs}?[A-H|J-W|Y-Z][\.|\)]? ')" role="warning" id="alpha-upper-test-1">list-item is part of an alpha-upper list, but it begins with a single upper-case letter. Is this correct? <value-of select="."/>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hu39x-alpha-upper-test-1" test="($type='alpha-upper') and matches(.,'^\p{Zs}?[A-H|J-W|Y-Z][\.|\)]? ')" role="warning" id="alpha-upper-test-1">list-item is part of an alpha-upper list, but it begins with a single upper-case letter. Is this correct? <value-of select="."/>
</report>
</rule>
</pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="content-containers">
<rule context="list-item" id="list-item-tests">
<let name="type" value="ancestor::list[1]/@list-type"/>
<report test="($type='bullet') and matches(.,'^\p{Zs}?•')" role="error" id="bullet-test-1">list-item is part of bullet list, but it also begins with a '•', which means that two will output. Remove the unnecessary '•' from the beginning of the list-item.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#ho2mz-bullet-test-1" test="($type='bullet') and matches(.,'^\p{Zs}?•')" role="error" id="bullet-test-1">list-item is part of bullet list, but it also begins with a '•', which means that two will output. Remove the unnecessary '•' from the beginning of the list-item.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<pattern id="content-containers">
<rule context="list-item" id="list-item-tests">
<let name="type" value="ancestor::list[1]/@list-type"/>
<report test="($type='simple') and matches(.,'^\p{Zs}?•')" role="error" id="bullet-test-2">list-item is part of simple list, but it begins with a '•'. Remove the unnecessary '•' and capture the list as a bullet type list.</report>
<report see="https://elifeproduction.slab.com/posts/general-layout-and-formatting-wq0m31at#hiw8e-bullet-test-2" test="($type='simple') and matches(.,'^\p{Zs}?•')" role="error" id="bullet-test-2">list-item is part of simple list, but it begins with a '•'. Remove the unnecessary '•' and capture the list as a bullet type list.</report>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Loading

0 comments on commit 491abdd

Please sign in to comment.