@likecoin/epubcheck-ts 0.1.0

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 (65) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +339 -0
  3. package/dist/index.cjs +1904 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +523 -0
  6. package/dist/index.d.ts +523 -0
  7. package/dist/index.js +1895 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +69 -0
  10. package/schemas/applications.rng +429 -0
  11. package/schemas/aria.rng +3355 -0
  12. package/schemas/block.rng +488 -0
  13. package/schemas/common.rng +1076 -0
  14. package/schemas/container.rng +24 -0
  15. package/schemas/core-scripting.rng +950 -0
  16. package/schemas/data.rng +161 -0
  17. package/schemas/datatypes.rng +401 -0
  18. package/schemas/embed.rng +980 -0
  19. package/schemas/epub-mathml3-inc.rng +161 -0
  20. package/schemas/epub-nav-30.rnc +44 -0
  21. package/schemas/epub-nav-30.rng +19985 -0
  22. package/schemas/epub-nav-30.sch +87 -0
  23. package/schemas/epub-prefix-attr.rng +17 -0
  24. package/schemas/epub-shared-inc.rng +29 -0
  25. package/schemas/epub-ssml-attrs.rng +17 -0
  26. package/schemas/epub-svg-30.rnc +17 -0
  27. package/schemas/epub-svg-30.rng +19903 -0
  28. package/schemas/epub-svg-30.sch +7 -0
  29. package/schemas/epub-svg-forgiving-inc.rng +315 -0
  30. package/schemas/epub-switch.rng +121 -0
  31. package/schemas/epub-trigger.rng +90 -0
  32. package/schemas/epub-type-attr.rng +12 -0
  33. package/schemas/epub-xhtml-30.rnc +6 -0
  34. package/schemas/epub-xhtml-30.rng +19882 -0
  35. package/schemas/epub-xhtml-30.sch +409 -0
  36. package/schemas/epub-xhtml-inc.rng +151 -0
  37. package/schemas/epub-xhtml-integration.rng +565 -0
  38. package/schemas/epub-xhtml-svg-mathml.rng +17 -0
  39. package/schemas/form-datatypes.rng +54 -0
  40. package/schemas/mathml3-common.rng +336 -0
  41. package/schemas/mathml3-content.rng +1552 -0
  42. package/schemas/mathml3-inc.rng +30 -0
  43. package/schemas/mathml3-presentation.rng +2341 -0
  44. package/schemas/mathml3-strict-content.rng +205 -0
  45. package/schemas/media.rng +374 -0
  46. package/schemas/meta.rng +754 -0
  47. package/schemas/microdata.rng +192 -0
  48. package/schemas/ncx.rng +308 -0
  49. package/schemas/ocf-container-30.rnc +37 -0
  50. package/schemas/ocf-container-30.rng +568 -0
  51. package/schemas/opf.rng +15 -0
  52. package/schemas/opf20.rng +513 -0
  53. package/schemas/package-30.rnc +133 -0
  54. package/schemas/package-30.rng +1153 -0
  55. package/schemas/package-30.sch +444 -0
  56. package/schemas/phrase.rng +746 -0
  57. package/schemas/rdfa.rng +552 -0
  58. package/schemas/revision.rng +106 -0
  59. package/schemas/ruby.rng +141 -0
  60. package/schemas/sectional.rng +278 -0
  61. package/schemas/structural.rng +298 -0
  62. package/schemas/tables.rng +420 -0
  63. package/schemas/web-components.rng +184 -0
  64. package/schemas/web-forms.rng +975 -0
  65. package/schemas/web-forms2.rng +1236 -0
@@ -0,0 +1,161 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!--
4
+ #####################################################################
5
+
6
+ MathML validation based on the schemas from the Nu Html Checker,
7
+ with the following changes:
8
+ - Content MathML is only allowed in annotation-xml
9
+ - annotation-xml follows the restrictions defined in
10
+ EPUB Content Documents
11
+ - EPUB SSML attributes are allowed
12
+
13
+ #####################################################################
14
+ -->
15
+ <include href="mathml3-inc.rng">
16
+ <!-- extend to circumvent datatype collisions -->
17
+ <define name="NonMathMLAtt">
18
+ <attribute>
19
+ <anyName>
20
+ <except>
21
+ <nsName ns=""/>
22
+ <nsName/>
23
+ <nsName ns="http://www.w3.org/XML/1998/namespace"/>
24
+ <nsName ns="http://www.w3.org/1999/xhtml"/>
25
+ <nsName ns="http://www.w3.org/2001/xml-events"/>
26
+ <nsName ns="http://www.w3.org/2001/10/synthesis"/>
27
+ <nsName ns="http://www.idpf.org/2007/ops"/>
28
+ </except>
29
+ </anyName>
30
+ <ref name="datatype.string"/>
31
+ </attribute>
32
+ </define>
33
+ <!-- as ops allows presentation mathml only at top level, kill the contribution to MathExpression -->
34
+ <define name="MathExpression">
35
+ <choice>
36
+ <ref name="semantics"/>
37
+ <ref name="PresentationExpression"/>
38
+ </choice>
39
+ </define>
40
+ <!-- override annotation-xml with EPUB restrictions -->
41
+ <define name="annotation-xml">
42
+ <ref name="epub.annotation-xml"/>
43
+ </define>
44
+ </include>
45
+ <!--
46
+ Common attribute extensions
47
+ - epub:type
48
+ -->
49
+ <define name="CommonAtt" combine="interleave">
50
+ <optional>
51
+ <ref name="epub.type.attr"/>
52
+ </optional>
53
+ </define>
54
+ <!-- - SSML attributes -->
55
+ <define name="CommonAtt" combine="interleave">
56
+ <optional>
57
+ <ref name="epub.ssml.ph.attr"/>
58
+ </optional>
59
+ </define>
60
+ <!-- - xml:base -->
61
+ <define name="CommonAtt" combine="interleave">
62
+ <optional>
63
+ <ref name="common.attrs.xmlbase"/>
64
+ </optional>
65
+ </define>
66
+ <!-- - ARIA -->
67
+ <define name="CommonAtt" combine="interleave">
68
+ <optional>
69
+ <ref name="aria.global"/>
70
+ </optional>
71
+ </define>
72
+ <define name="annotation-xml.model.xhtml" combine="choice">
73
+ <ref name="common.inner.flow"/>
74
+ </define>
75
+ <define name="annotation-xml.model.svg" combine="choice">
76
+ <ref name="svg"/>
77
+ </define>
78
+ <!--
79
+ The following comes from validator.nu’s xhtml5-svg-mathml.rnc driver:
80
+ in our integration, <mtext> is the only MathML "token element" that can
81
+ contain HTML element content; the <mi>, <mn>, <mo> and <ms> elements
82
+ cannot; see http://www.w3.org/Bugs/Public/show_bug.cgi?id=9859#c8 for a
83
+ rationale
84
+ -->
85
+ <define name="mtext.content" combine="choice">
86
+ <ref name="common.elem.phrasing"/>
87
+ </define>
88
+ <!-- EPUB very specific annotation-xml restrictions: -->
89
+ <define name="epub.annotation-xml">
90
+ <choice>
91
+ <ref name="annotation-xml.xhtml"/>
92
+ <ref name="annotation-xml.svg"/>
93
+ <ref name="epub.annotation-xml.mathml.content"/>
94
+ <ref name="epub.annotation-xml.mathml.presentation"/>
95
+ </choice>
96
+ </define>
97
+ <define name="epub.annotation-xml.attributes">
98
+ <ref name="CommonAtt"/>
99
+ <optional>
100
+ <ref name="cd"/>
101
+ </optional>
102
+ <optional>
103
+ <ref name="src"/>
104
+ </optional>
105
+ </define>
106
+ <define name="epub.annotation-xml.mathml.content">
107
+ <element name="annotation-xml">
108
+ <ref name="epub.annotation-xml.model.mathml.content"/>
109
+ <ref name="epub.annotation-xml.attributes"/>
110
+ <ref name="epub.att-encoding.mathml.content"/>
111
+ <ref name="epub.att-name.mathml.content"/>
112
+ </element>
113
+ </define>
114
+ <define name="epub.annotation-xml.model.mathml.content">
115
+ <zeroOrMore>
116
+ <ref name="ContExp"/>
117
+ </zeroOrMore>
118
+ </define>
119
+ <define name="epub.att-encoding.mathml.content">
120
+ <attribute name="encoding">
121
+ <choice>
122
+ <value type="string" datatypeLibrary="">MathML-Content</value>
123
+ <value type="string" datatypeLibrary="">application/mathml-content+xml</value>
124
+ </choice>
125
+ </attribute>
126
+ </define>
127
+ <define name="epub.att-name.mathml.content">
128
+ <attribute name="name">
129
+ <value type="string" datatypeLibrary="">contentequiv</value>
130
+ </attribute>
131
+ </define>
132
+ <define name="epub.annotation-xml.mathml.presentation">
133
+ <element name="annotation-xml">
134
+ <ref name="epub.annotation-xml.model.mathml.presentation"/>
135
+ <ref name="epub.annotation-xml.attributes"/>
136
+ <ref name="epub.att-encoding.mathml.presentation"/>
137
+ <optional>
138
+ <ref name="epub.att-name.mathml.presentation"/>
139
+ </optional>
140
+ </element>
141
+ </define>
142
+ <define name="epub.annotation-xml.model.mathml.presentation">
143
+ <zeroOrMore>
144
+ <ref name="MathExpression"/>
145
+ </zeroOrMore>
146
+ </define>
147
+ <define name="epub.att-encoding.mathml.presentation">
148
+ <attribute name="encoding">
149
+ <choice>
150
+ <value type="string" datatypeLibrary="">MathML</value>
151
+ <value>MathML-Presentation</value>
152
+ <value type="string" datatypeLibrary="">application/mathml-presentation+xml</value>
153
+ </choice>
154
+ </attribute>
155
+ </define>
156
+ <define name="epub.att-name.mathml.presentation">
157
+ <attribute name="name">
158
+ <data type="NCName"/>
159
+ </attribute>
160
+ </define>
161
+ </grammar>
@@ -0,0 +1,44 @@
1
+
2
+ default namespace = "http://www.w3.org/1999/xhtml"
3
+ namespace epub = "http://www.idpf.org/2007/ops"
4
+
5
+
6
+ # #####################################################################
7
+ ## RELAX NG Schema for EPUB: EPUB Navigation Documents #
8
+ # #####################################################################
9
+
10
+ include "epub-xhtml-30.rnc" {
11
+ nav.attrs = nav.attrs.noepubtype
12
+ }
13
+
14
+ ## "reset" the definition of nav.attrs to what it was
15
+ ## before epub:type was set to augment common.attrs.basic
16
+ nav.attrs.noepubtype =
17
+ ( common.attrs.id?
18
+ & common.attrs.class?
19
+ & common.attrs.title?
20
+ & common.attrs.base?
21
+ & common.attrs.space?
22
+ & common.attrs.i18n
23
+ & common.attrs.present
24
+ & common.attrs.other
25
+ & ( common.attrs.aria.implicit.navigation
26
+ | common.attrs.aria.landmark.navigation
27
+ | common.attrs.aria.role.doc-index
28
+ | common.attrs.aria.role.doc-pagelist
29
+ | common.attrs.aria.role.doc-toc
30
+ )?
31
+ )
32
+
33
+ html5.headings.class = hgroup.elem | h1.elem | h2.elem | h3.elem | h4.elem | h5.elem | h6.elem
34
+
35
+ epub.nav = element nav { epub.type.attr & nav.attrs.noepubtype & epub.nav.content }
36
+ epub.nav.content = html5.headings.class?, epub.nav.ol
37
+
38
+ epub.nav.ol = element ol { ol.attrs & epub.nav.ol.content }
39
+ epub.nav.ol.content = epub.nav.oli+
40
+
41
+ epub.nav.oli = element li { oli.attrs & epub.nav.oli.content }
42
+ epub.nav.oli.content = a.elem.phrasing | ((a.elem.phrasing | span.elem), epub.nav.ol)
43
+
44
+ common.elem.flow |= epub.nav