@likecoin/epubcheck-ts 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +8 -8
  2. package/bin/epubcheck.js +4 -4
  3. package/bin/epubcheck.ts +4 -4
  4. package/dist/index.cjs +1057 -101
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +3 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +1057 -101
  9. package/dist/index.js.map +1 -1
  10. package/package.json +4 -4
  11. package/schemas/applications.rng +0 -429
  12. package/schemas/aria.rng +0 -3355
  13. package/schemas/block.rng +0 -488
  14. package/schemas/common.rng +0 -1076
  15. package/schemas/container.rng +0 -24
  16. package/schemas/core-scripting.rng +0 -950
  17. package/schemas/data.rng +0 -161
  18. package/schemas/datatypes.rng +0 -401
  19. package/schemas/embed.rng +0 -980
  20. package/schemas/epub-mathml3-inc.rng +0 -161
  21. package/schemas/epub-nav-30.rnc +0 -44
  22. package/schemas/epub-nav-30.rng +0 -19985
  23. package/schemas/epub-nav-30.sch +0 -87
  24. package/schemas/epub-prefix-attr.rng +0 -17
  25. package/schemas/epub-shared-inc.rng +0 -29
  26. package/schemas/epub-ssml-attrs.rng +0 -17
  27. package/schemas/epub-svg-30.rnc +0 -17
  28. package/schemas/epub-svg-30.rng +0 -19903
  29. package/schemas/epub-svg-30.sch +0 -7
  30. package/schemas/epub-svg-forgiving-inc.rng +0 -315
  31. package/schemas/epub-switch.rng +0 -121
  32. package/schemas/epub-trigger.rng +0 -90
  33. package/schemas/epub-type-attr.rng +0 -12
  34. package/schemas/epub-xhtml-30.rnc +0 -6
  35. package/schemas/epub-xhtml-30.rng +0 -19882
  36. package/schemas/epub-xhtml-30.sch +0 -409
  37. package/schemas/epub-xhtml-inc.rng +0 -151
  38. package/schemas/epub-xhtml-integration.rng +0 -565
  39. package/schemas/epub-xhtml-svg-mathml.rng +0 -17
  40. package/schemas/form-datatypes.rng +0 -54
  41. package/schemas/mathml3-common.rng +0 -336
  42. package/schemas/mathml3-content.rng +0 -1552
  43. package/schemas/mathml3-inc.rng +0 -30
  44. package/schemas/mathml3-presentation.rng +0 -2341
  45. package/schemas/mathml3-strict-content.rng +0 -205
  46. package/schemas/media.rng +0 -374
  47. package/schemas/meta.rng +0 -754
  48. package/schemas/microdata.rng +0 -192
  49. package/schemas/ncx.rng +0 -308
  50. package/schemas/ocf-container-30.rnc +0 -37
  51. package/schemas/ocf-container-30.rng +0 -568
  52. package/schemas/opf.rng +0 -15
  53. package/schemas/opf20.rng +0 -513
  54. package/schemas/package-30.rnc +0 -133
  55. package/schemas/package-30.rng +0 -1153
  56. package/schemas/package-30.sch +0 -444
  57. package/schemas/phrase.rng +0 -746
  58. package/schemas/rdfa.rng +0 -552
  59. package/schemas/revision.rng +0 -106
  60. package/schemas/ruby.rng +0 -141
  61. package/schemas/sectional.rng +0 -278
  62. package/schemas/structural.rng +0 -298
  63. package/schemas/tables.rng +0 -420
  64. package/schemas/web-components.rng +0 -184
  65. package/schemas/web-forms.rng +0 -975
  66. package/schemas/web-forms2.rng +0 -1236
@@ -1,87 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
3
-
4
- <ns uri="http://www.w3.org/1999/xhtml" prefix="html"/>
5
- <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
6
-
7
- <pattern id="nav-ocurrence">
8
- <rule context="html:body">
9
- <assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='toc']) = 1">Exactly one "toc" nav element
10
- must be present</assert>
11
- <assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='page-list']) &lt; 2">Multiple occurrences of
12
- the "page-list" nav element</assert>
13
- <assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='landmarks']) &lt; 2">Multiple occurrences of
14
- the "landmarks" nav element</assert>
15
- </rule>
16
- </pattern>
17
-
18
- <pattern id="span-no-sublist">
19
- <rule context="html:body//html:nav[@epub:type]//html:span">
20
- <assert test="count(.//ol) = 0"> The span element must only be used as heading for flat
21
- sublists (not hierarchical navigation structures) </assert>
22
- </rule>
23
- </pattern>
24
-
25
- <pattern id="landmarks">
26
- <rule context="html:nav[tokenize(@epub:type,'\s+')='landmarks']//html:ol//html:a">
27
- <let name="current" value="."/>
28
- <let name="current_type_normalized" value="tokenize(lower-case(@epub:type),'\s+')"/>
29
- <let name="current_href_normalized" value="normalize-space(lower-case(@href))"/>
30
-
31
- <!-- Check for missing epub:type attributes -->
32
- <assert test="@epub:type">Missing epub:type attribute on anchor inside "landmarks" nav element</assert>
33
-
34
- <!--
35
- landmarks anchors should be unique (#493)
36
- and only reported within the same ancestor landmarks element
37
- -->
38
- <assert test="
39
- empty(ancestor::html:nav//html:ol//html:a[
40
- not(. is $current) and
41
- tokenize(lower-case(@epub:type),'\s+') = $current_type_normalized and
42
- normalize-space(lower-case(@href)) = $current_href_normalized
43
- ])">Another landmark was found with the same epub:type and same reference to "<value-of select="$current_href_normalized"/>"</assert>
44
- </rule>
45
- </pattern>
46
-
47
- <pattern id="link-labels">
48
- <rule context="html:nav[@epub:type]//html:ol//html:a">
49
- <assert
50
- test="string-length(normalize-space(string-join(.|./html:img/@alt|.//@aria-label))) > 0"
51
- >Anchors within nav elements must contain text</assert>
52
- </rule>
53
- </pattern>
54
-
55
- <pattern id="span-labels">
56
- <rule context="html:nav[@epub:type]//html:ol//html:span">
57
- <assert
58
- test="string-length(normalize-space(string-join(.|./html:img/@alt|.//@aria-label))) > 0"
59
- >Spans within nav elements must contain text</assert>
60
- </rule>
61
- </pattern>
62
-
63
- <pattern id="req-heading">
64
- <rule
65
- context="html:nav[@epub:type][not(tokenize(@epub:type,'\s+') = ('toc','page-list','landmarks'))]">
66
- <assert test="child::*[1][self::html:h1|self::html:h2|self::html:h3|self::html:h4|self::html:h5|self::html:h6]">nav
67
- elements other than "toc", "page-list" and "landmarks" must have a heading as their
68
- first child</assert>
69
- </rule>
70
- </pattern>
71
-
72
- <pattern id="heading-content">
73
- <rule context="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6">
74
- <assert
75
- test="string-length(normalize-space(string-join(.|./html:img/@alt|.//@aria-label))) > 0"
76
- >Heading elements must contain text</assert>
77
- </rule>
78
- </pattern>
79
-
80
- <pattern id="flat-nav">
81
- <rule context="html:nav[tokenize(@epub:type,'\s+') = ('page-list','landmarks')]">
82
- <assert test="count(.//html:ol) = 1">WARNING: A "<value-of select="@epub:type"/>" nav element should contain
83
- only a single ol descendant (no nested sublists)</assert>
84
- </rule>
85
- </pattern>
86
-
87
- </schema>
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:epub="http://www.idpf.org/2007/ops" xmlns="http://relaxng.org/ns/structure/1.0">
3
- <!-- ##################################################################### -->
4
- <define name="epub.prefix.attr">
5
- <a:documentation> RELAX NG Schema for EPUB: EPUB prefix attributes #</a:documentation>
6
- <!-- ##################################################################### -->
7
- <a:documentation>prefix attributes</a:documentation>
8
- <attribute name="prefix">
9
- <ref name="datatype.prefixdecl"/>
10
- </attribute>
11
- </define>
12
- <define name="epub.prefix.attr.ns">
13
- <attribute name="epub:prefix">
14
- <ref name="datatype.prefixdecl"/>
15
- </attribute>
16
- </define>
17
- </grammar>
@@ -1,29 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
3
- <!-- ##################################################################### -->
4
- <!-- EPUB elements -->
5
- <include href="epub-trigger.rng">
6
- <a:documentation> RELAX NG Schema for EPUB: shared definitions for inclusion #</a:documentation>
7
- <!-- ##################################################################### -->
8
- <a:documentation>Includes</a:documentation>
9
- </include>
10
- <include href="epub-switch.rng"/>
11
- <!-- EPUB attributes -->
12
- <include href="epub-prefix-attr.rng"/>
13
- <include href="epub-ssml-attrs.rng"/>
14
- <include href="epub-type-attr.rng"/>
15
- <!-- EPUB integration logic -->
16
- <include href="epub-xhtml-integration.rng"/>
17
- <!--
18
- Note: the default HMTL schema does not define such a category, so we
19
- do our best to include what makes sense here
20
- -->
21
- <define name="common.inner.anyhtml">
22
- <a:documentation>Content model: HTML fragments</a:documentation>
23
- <choice>
24
- <ref name="html.elem"/>
25
- <ref name="body.elem"/>
26
- <ref name="common.inner.flow"/>
27
- </choice>
28
- </define>
29
- </grammar>
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns="http://relaxng.org/ns/structure/1.0">
3
- <!-- ##################################################################### -->
4
- <define name="epub.ssml.ph.attr">
5
- <a:documentation> RELAX NG Schema for EPUB: EPUB SSML attributes #</a:documentation>
6
- <!-- ##################################################################### -->
7
- <a:documentation>SSML attributes</a:documentation>
8
- <attribute name="ssml:ph">
9
- <ref name="datatype.ssml.PhoneticExpression"/>
10
- </attribute>
11
- </define>
12
- <define name="epub.ssml.alphabet.attr">
13
- <attribute name="ssml:alphabet">
14
- <ref name="datatype.ssml.PhoneticAlphabet"/>
15
- </attribute>
16
- </define>
17
- </grammar>
@@ -1,17 +0,0 @@
1
-
2
- # #####################################################################
3
- ## RELAX NG Schema for EPUB: EPUB SVG (+ XHTML, + MathML) #
4
- # #####################################################################
5
-
6
- include "./mod/epub-xhtml-svg-mathml.rnc" {
7
- start = svg
8
-
9
- # Override the `id` attribute to require a valid XML ID
10
- svg.attr.id = attribute id { xsd:ID }?
11
- }
12
-
13
- # Allow `body` element as a child of `foreignObject`
14
- svg.foreignObject.inner |= body.elem
15
-
16
- # Allow `epub:prefix` attribute on `svg` root
17
- svg.attrs &= epub.prefix.attr.ns?