metanorma-plateau 1.0.8 → 1.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.
- checksums.yaml +4 -4
- data/lib/isodoc/plateau/plateau.international-standard.xsl +10199 -10556
- data/lib/isodoc/plateau/presentation_xml_convert.rb +0 -71
- data/lib/metanorma/plateau/isodoc.rng +51 -6
- data/lib/metanorma/plateau/version.rb +1 -1
- data/metanorma-plateau.gemspec +1 -2
- metadata +4 -18
@@ -79,77 +79,6 @@ module IsoDoc
|
|
79
79
|
@counter.ol_type(node, depth) # defined in Xref::Counter
|
80
80
|
end
|
81
81
|
|
82
|
-
# how many columns in the table?
|
83
|
-
def table_col_count(table)
|
84
|
-
cols = 0
|
85
|
-
table&.at(ns(".//tr"))&.xpath(ns("./td | ./th"))&.each do |td|
|
86
|
-
cols += (td["colspan"] ? td["colspan"].to_i : 1)
|
87
|
-
end
|
88
|
-
cols
|
89
|
-
end
|
90
|
-
|
91
|
-
# if there is already a full-row cell at the start of tfoot,
|
92
|
-
# use that to move content into
|
93
|
-
# else create a full-row cell at the start of tfoot
|
94
|
-
def initial_tfoot_cell(node)
|
95
|
-
colspan = table_col_count(node)
|
96
|
-
tfoot_start = node.at(ns("./tfoot/tr/td"))
|
97
|
-
if !tfoot_start
|
98
|
-
node.at(ns("./tbody")).after("<tfoot><tr #{add_id_text}><td #{add_id_text} colspan='#{colspan}'> </td></tr></tfoot>").first
|
99
|
-
tfoot_start = node.at(ns("./tfoot/tr/td"))
|
100
|
-
end
|
101
|
-
if tfoot_start["colspan"] != colspan.to_s
|
102
|
-
tfoot_start.parent.previous = "<tr #{add_id_text}><td #{add_id_text} colspan='#{colspan}'> </td></tr>"
|
103
|
-
tfoot_start = node.at(ns("./tfoot/tr/td"))
|
104
|
-
end
|
105
|
-
tfoot_start
|
106
|
-
end
|
107
|
-
|
108
|
-
# if there is already a full-row cell at the end of tfoot,
|
109
|
-
# use that to move content into
|
110
|
-
# else create a full-row cell at the end of tfoot
|
111
|
-
def final_tfoot_cell(node)
|
112
|
-
colspan = table_col_count(node)
|
113
|
-
tfoot_start = node.at(ns("./tfoot/tr[last()]/td"))
|
114
|
-
if !tfoot_start
|
115
|
-
node.at(ns("./tbody")).after("<tfoot><tr #{add_id_text}><td #{add_id_text} colspan='#{colspan}'> </td></tr></tfoot>").first
|
116
|
-
tfoot_start = node.at(ns("./tfoot/tr[last()]/td"))
|
117
|
-
end
|
118
|
-
if tfoot_start["colspan"] != colspan.to_s
|
119
|
-
tfoot_start.parent.next = "<tr #{add_id_text}><td #{add_id_text} colspan='#{colspan}'> </td></tr>"
|
120
|
-
tfoot_start = node.at(ns("./tfoot/tr[last()]/td"))
|
121
|
-
end
|
122
|
-
tfoot_start
|
123
|
-
end
|
124
|
-
|
125
|
-
def table1(node)
|
126
|
-
super
|
127
|
-
# move dl, notes, footnotes, fmt-source,
|
128
|
-
# fmt-footnote-container inside tfoot
|
129
|
-
table_dl_to_tfoot(node)
|
130
|
-
table_content_to_tfoot(node)
|
131
|
-
end
|
132
|
-
|
133
|
-
def table_dl_to_tfoot(node)
|
134
|
-
node.at(ns("./dl")) or return
|
135
|
-
tf = initial_tfoot_cell(node)
|
136
|
-
node.xpath(ns("./dl")).reverse_each do |x|
|
137
|
-
tf.children.first.previous = x.remove
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
def table_content_to_tfoot(node)
|
142
|
-
node.at(ns("./note | ./fmt-source | ./example | " \
|
143
|
-
"./fmt-footnote-container")) or return
|
144
|
-
tf = final_tfoot_cell(node)
|
145
|
-
%w(example note fmt-footnote-container
|
146
|
-
fmt-source).each do |n|
|
147
|
-
node.xpath(ns("./#{n}")).each do |x|
|
148
|
-
tf.children.last.next = x.remove
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
82
|
# Undo JIS encoding of figure and table dl as paragraphs
|
154
83
|
def dl(docxml)
|
155
84
|
docxml.xpath(ns("//dl")).each { |f| dl1(f) }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<!-- VERSION v2.0.
|
3
|
+
<!-- VERSION v2.0.8 -->
|
4
4
|
|
5
5
|
<!--
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
@@ -72,6 +72,46 @@ but to `@anchor`, the user-supplied cross-reference</a:documentation>
|
|
72
72
|
</oneOrMore>
|
73
73
|
</element>
|
74
74
|
</define>
|
75
|
+
<define name="review">
|
76
|
+
<a:documentation>Generalise BasicDoc element from just review comments, to general annotations;
|
77
|
+
the type attribute defaults to `review` for reviews</a:documentation>
|
78
|
+
<element name="annotation">
|
79
|
+
<ref name="RequiredId"/>
|
80
|
+
<ref name="ReviewAttributes"/>
|
81
|
+
<oneOrMore>
|
82
|
+
<ref name="paragraph">
|
83
|
+
<a:documentation>Reviewer comments content</a:documentation>
|
84
|
+
</ref>
|
85
|
+
</oneOrMore>
|
86
|
+
</element>
|
87
|
+
</define>
|
88
|
+
<define name="ruby_pronunciation">
|
89
|
+
<a:documentation>Ruby annotation giving pronunciation of text: change tag from BasicDoc for disambiguation</a:documentation>
|
90
|
+
<element name="ruby-pronunciation">
|
91
|
+
<attribute name="value">
|
92
|
+
<a:documentation>Ruby annotation value</a:documentation>
|
93
|
+
</attribute>
|
94
|
+
<ref name="LocalizedStringAttributes"/>
|
95
|
+
</element>
|
96
|
+
</define>
|
97
|
+
<define name="ruby_annotation">
|
98
|
+
<a:documentation>Ruby annotation giving information other than pronunciation of text: change tag from BasicDoc for disambiguation</a:documentation>
|
99
|
+
<element name="ruby-annotation">
|
100
|
+
<attribute name="value">
|
101
|
+
<a:documentation>Ruby annotation value</a:documentation>
|
102
|
+
</attribute>
|
103
|
+
<ref name="LocalizedStringAttributes"/>
|
104
|
+
</element>
|
105
|
+
</define>
|
106
|
+
<define name="annotation">
|
107
|
+
<a:documentation>Source code annotation, corresponding to a callout</a:documentation>
|
108
|
+
<element name="callout-annotation">
|
109
|
+
<ref name="RequiredId"/>
|
110
|
+
<oneOrMore>
|
111
|
+
<ref name="paragraph"/>
|
112
|
+
</oneOrMore>
|
113
|
+
</element>
|
114
|
+
</define>
|
75
115
|
<define name="section-title">
|
76
116
|
<a:documentation>Title(s) of a clause</a:documentation>
|
77
117
|
<element name="title">
|
@@ -540,7 +580,7 @@ normative or informative references, some split references into sections organiz
|
|
540
580
|
<ref name="OptionalId"/>
|
541
581
|
<optional>
|
542
582
|
<attribute name="style">
|
543
|
-
<a:documentation>CSS style: only background-color supported</a:documentation>
|
583
|
+
<a:documentation>CSS style: only background-color, color, border supported</a:documentation>
|
544
584
|
</attribute>
|
545
585
|
</optional>
|
546
586
|
</define>
|
@@ -620,7 +660,7 @@ This is done if the footnote reference is already presented in some other form,
|
|
620
660
|
<ref name="RequiredId"/>
|
621
661
|
<optional>
|
622
662
|
<attribute name="style">
|
623
|
-
<a:documentation>CSS style: only background-color supported</a:documentation>
|
663
|
+
<a:documentation>CSS style: only background-color, color, border supported</a:documentation>
|
624
664
|
</attribute>
|
625
665
|
</optional>
|
626
666
|
</define>
|
@@ -700,6 +740,11 @@ titlecase, or lowercase</a:documentation>
|
|
700
740
|
<a:documentation>Width of the table block in rendering</a:documentation>
|
701
741
|
</attribute>
|
702
742
|
</optional>
|
743
|
+
<optional>
|
744
|
+
<attribute name="style">
|
745
|
+
<a:documentation>CSS style: only background-color, color, border supported</a:documentation>
|
746
|
+
</attribute>
|
747
|
+
</optional>
|
703
748
|
<ref name="BlockAttributes"/>
|
704
749
|
</define>
|
705
750
|
<define name="FigureAttributes" combine="interleave">
|
@@ -1417,7 +1462,7 @@ numbers</a:documentation>
|
|
1417
1462
|
</optional>
|
1418
1463
|
<ref name="DocumentBody"/>
|
1419
1464
|
<optional>
|
1420
|
-
<ref name="
|
1465
|
+
<ref name="annotation-container">
|
1421
1466
|
<a:documentation>Annotations to the document</a:documentation>
|
1422
1467
|
</ref>
|
1423
1468
|
</optional>
|
@@ -1461,8 +1506,8 @@ numbers</a:documentation>
|
|
1461
1506
|
</oneOrMore>
|
1462
1507
|
</element>
|
1463
1508
|
</define>
|
1464
|
-
<define name="
|
1465
|
-
<element name="
|
1509
|
+
<define name="annotation-container">
|
1510
|
+
<element name="annotation-container">
|
1466
1511
|
<oneOrMore>
|
1467
1512
|
<ref name="review"/>
|
1468
1513
|
</oneOrMore>
|
data/metanorma-plateau.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
30
30
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
31
31
|
|
32
|
-
spec.add_dependency "metanorma-jis", "~> 0.
|
32
|
+
spec.add_dependency "metanorma-jis", "~> 0.6.0"
|
33
33
|
spec.add_dependency "pubid"
|
34
34
|
|
35
35
|
spec.add_development_dependency "debug"
|
@@ -44,7 +44,6 @@ spec.add_development_dependency "rubocop-performance"
|
|
44
44
|
spec.add_development_dependency "sassc-embedded", "~> 1"
|
45
45
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
46
46
|
spec.add_development_dependency "timecop", "~> 0.9"
|
47
|
-
spec.add_development_dependency "vcr", "~> 6.1.0"
|
48
47
|
spec.add_development_dependency "webmock"
|
49
48
|
spec.add_development_dependency "xml-c14n"
|
50
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-plateau
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-jis
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pubid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,20 +206,6 @@ dependencies:
|
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0.9'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: vcr
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - "~>"
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: 6.1.0
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - "~>"
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: 6.1.0
|
223
209
|
- !ruby/object:Gem::Dependency
|
224
210
|
name: webmock
|
225
211
|
requirement: !ruby/object:Gem::Requirement
|