metanorma-jis 0.0.10 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/jis/base_convert.rb +13 -102
- data/lib/isodoc/jis/html/style-human.css +8 -8
- data/lib/isodoc/jis/html/style-human.scss +8 -8
- data/lib/isodoc/jis/html/style-iso.css +19 -19
- data/lib/isodoc/jis/html/style-iso.scss +19 -19
- data/lib/isodoc/jis/jis.international-standard.xsl +180 -31
- data/lib/isodoc/jis/presentation_xml_convert.rb +70 -1
- data/lib/isodoc/jis/word_convert.rb +22 -56
- data/lib/metanorma/jis/isodoc.rng +26 -4
- data/lib/metanorma/jis/version.rb +1 -1
- data/metanorma-jis.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ff1a468059b202d18d33ada0b23da0b282c96759e92abc63ed4fa5de1bd1758
|
4
|
+
data.tar.gz: 8a9c0567a2aac6d8ee74055e473c38529c5159ecc5dc1ebc4a43e91f4bafe867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bd9b580671c15264219ba773d0abdb2213f864c122d4f38ebb94dcacecf5c2ad1a78c1ab482d9d616e7f3d4ecbd732b5c8b0d013386bb53d07af0829f36401d
|
7
|
+
data.tar.gz: 63dff5f511d7f9e2cd2867bfadad394d4fc80a27566610633888dbec19efe7d62ac53b71233791ef1b01430702317af83d58eb8a2f9d3ccafd619508a7e7d76a
|
@@ -4,73 +4,6 @@ require "metanorma-iso"
|
|
4
4
|
module IsoDoc
|
5
5
|
module JIS
|
6
6
|
module BaseConvert
|
7
|
-
def middle_title(_isoxml, out)
|
8
|
-
middle_title_hdr(out)
|
9
|
-
middle_title_main(out, "zzSTDTitle1")
|
10
|
-
middle_subtitle_main(out)
|
11
|
-
# middle_title_amd(out)
|
12
|
-
end
|
13
|
-
|
14
|
-
def middle_title_hdr(out)
|
15
|
-
out.p(class: "JapaneseIndustrialStandard") do |p|
|
16
|
-
p << @i18n.jis
|
17
|
-
@meta.get[:unpublished] and p << @i18n.l10n("(#{@i18n.draft_label})")
|
18
|
-
insert_tab(p, 7)
|
19
|
-
p << "<span class='JIS'>JIS</span>"
|
20
|
-
end
|
21
|
-
out.p(class: "StandardNumber") do |p|
|
22
|
-
insert_tab(p, 1)
|
23
|
-
p << @meta.get[:docnumber_undated]
|
24
|
-
if yr = @meta.get[:docyear]
|
25
|
-
p << ": "
|
26
|
-
p << "<span class='EffectiveYear'>#{yr}</span>"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
out.p(class: "IDT")
|
30
|
-
end
|
31
|
-
|
32
|
-
def middle_title_main(out, style)
|
33
|
-
out.p(class: style) do |p|
|
34
|
-
p << @meta.get[:doctitleintro]
|
35
|
-
p << " — " if @meta.get[:doctitleintro] && @meta.get[:doctitlemain]
|
36
|
-
p << @meta.get[:doctitlemain]
|
37
|
-
p << " — " if @meta.get[:doctitlemain] && @meta.get[:doctitlepart]
|
38
|
-
end
|
39
|
-
a = @meta.get[:doctitlepart] and out.p(class: "zzSTDTitle1") do |p|
|
40
|
-
b = @meta.get[:doctitlepartlabel] and p << "#{b}: "
|
41
|
-
p << "<br/><b>#{a}</b>"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def middle_subtitle_main(out)
|
46
|
-
@meta.get[:docsubtitlemain] or return
|
47
|
-
out.p(class: "zzSTDTitle2") do |p|
|
48
|
-
p << @meta.get[:docsubtitleintro]
|
49
|
-
p << " — " if @meta.get[:docsubtitleintro] && @meta.get[:docsubtitlemain]
|
50
|
-
p << @meta.get[:docsubtitlemain]
|
51
|
-
p << " — " if @meta.get[:docsubtitlemain] && @meta.get[:docsubtitlepart]
|
52
|
-
end
|
53
|
-
a = @meta.get[:docsubtitlepart] and out.p(class: "zzSTDTitle2") do |p|
|
54
|
-
b = @meta.get[:docsubtitlepartlabel] and p << "#{b}: "
|
55
|
-
p << "<br/><b>#{a}</b>"
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def commentary_title(_isoxml, out)
|
60
|
-
commentary_title_hdr(out)
|
61
|
-
middle_title_main(out, "CommentaryStandardName")
|
62
|
-
end
|
63
|
-
|
64
|
-
def commentary_title_hdr(out)
|
65
|
-
out.p(class: "CommentaryStandardNumber") do |p|
|
66
|
-
p << "JIS #{@meta.get[:docnumber_undated]}"
|
67
|
-
if yr = @meta.get[:docyear]
|
68
|
-
p << ": "
|
69
|
-
p << "<span class='CommentaryEffectiveYear'>#{yr}</span>"
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
7
|
def termnote_parse(node, out)
|
75
8
|
name = node.at(ns("./name"))&.remove
|
76
9
|
out.div **note_attrs(node) do |div|
|
@@ -93,52 +26,30 @@ module IsoDoc
|
|
93
26
|
end
|
94
27
|
end
|
95
28
|
|
96
|
-
def para_class(node)
|
97
|
-
super || node["class"]
|
98
|
-
end
|
99
|
-
|
100
29
|
def make_tr_attr(cell, row, totalrows, header, bordered)
|
101
30
|
cell["border"] == "0" and bordered = false
|
102
31
|
super
|
103
32
|
end
|
104
33
|
|
105
|
-
def
|
106
|
-
|
107
|
-
middle_admonitions(isoxml, out)
|
108
|
-
i = isoxml.at(ns("//sections/introduction")) and
|
109
|
-
introduction i, out
|
110
|
-
scope isoxml, out, 0
|
111
|
-
norm_ref isoxml, out, 0
|
112
|
-
clause_etc isoxml, out, 0
|
113
|
-
annex isoxml, out
|
114
|
-
bibliography isoxml, out
|
115
|
-
commentary isoxml, out
|
116
|
-
indexsect isoxml, out
|
117
|
-
end
|
118
|
-
|
119
|
-
def annex(isoxml, out)
|
34
|
+
def annex(node, out)
|
35
|
+
node["commentary"] = "true" and return commentary(node, out)
|
120
36
|
amd(isoxml) and @suppressheadingnumbers = @oldsuppressheadingnumbers
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
else parse(c1, s)
|
127
|
-
end
|
128
|
-
end
|
37
|
+
page_break(out)
|
38
|
+
out.div **attr_code(annex_attrs(node)) do |s|
|
39
|
+
node.elements.each do |c1|
|
40
|
+
if c1.name == "title" then annex_name(node, c1, s)
|
41
|
+
else parse(c1, s) end
|
129
42
|
end
|
130
43
|
end
|
131
44
|
amd(isoxml) and @suppressheadingnumbers = true
|
132
45
|
end
|
133
46
|
|
134
|
-
def commentary(
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
else parse(c1, s)
|
141
|
-
end
|
47
|
+
def commentary(node, out)
|
48
|
+
page_break(out)
|
49
|
+
out.div **attr_code(annex_attrs(node)) do |s|
|
50
|
+
node.elements.each do |c1|
|
51
|
+
if c1.name == "title" then annex_name(node, c1, s)
|
52
|
+
else parse(c1, s)
|
142
53
|
end
|
143
54
|
end
|
144
55
|
end
|
@@ -301,10 +301,10 @@ blockquote,
|
|
301
301
|
q {
|
302
302
|
quotes: none; }
|
303
303
|
|
304
|
-
blockquote
|
305
|
-
blockquote
|
306
|
-
q
|
307
|
-
q
|
304
|
+
blockquote::before,
|
305
|
+
blockquote::after,
|
306
|
+
q::before,
|
307
|
+
q::after {
|
308
308
|
content: '';
|
309
309
|
content: none; }
|
310
310
|
|
@@ -458,7 +458,7 @@ h2 p, .h2 p {
|
|
458
458
|
ul > li {
|
459
459
|
list-style: none; }
|
460
460
|
|
461
|
-
ul > li > p:first-child
|
461
|
+
ul > li > p:first-child::before {
|
462
462
|
content: "\2014";
|
463
463
|
display: inline-block;
|
464
464
|
width: 1em;
|
@@ -470,7 +470,7 @@ li p {
|
|
470
470
|
margin-bottom: 0.6em;
|
471
471
|
line-height: 1.2; }
|
472
472
|
|
473
|
-
#toc li
|
473
|
+
#toc li::before {
|
474
474
|
content: " ";
|
475
475
|
display: none; }
|
476
476
|
|
@@ -521,7 +521,7 @@ p.Terms {
|
|
521
521
|
#toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
522
522
|
padding: 0 1.5em;
|
523
523
|
overflow: visible; } }
|
524
|
-
#toc li
|
524
|
+
#toc li::before, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li::before {
|
525
525
|
content: " ";
|
526
526
|
display: none; }
|
527
527
|
|
@@ -1030,7 +1030,7 @@ ol.footnotes-list p,
|
|
1030
1030
|
aside.footnote {
|
1031
1031
|
display: inline; }
|
1032
1032
|
|
1033
|
-
ol > li > p
|
1033
|
+
ol > li > p::before {
|
1034
1034
|
content: "";
|
1035
1035
|
display: none; }
|
1036
1036
|
|
@@ -38,10 +38,10 @@ q {
|
|
38
38
|
quotes: none;
|
39
39
|
}
|
40
40
|
|
41
|
-
blockquote
|
42
|
-
blockquote
|
43
|
-
q
|
44
|
-
q
|
41
|
+
blockquote::before,
|
42
|
+
blockquote::after,
|
43
|
+
q::before,
|
44
|
+
q::after {
|
45
45
|
content: '';
|
46
46
|
content: none;
|
47
47
|
}
|
@@ -232,7 +232,7 @@ ul>li {
|
|
232
232
|
list-style: none;
|
233
233
|
}
|
234
234
|
|
235
|
-
ul>li>p:first-child
|
235
|
+
ul>li>p:first-child::before {
|
236
236
|
content: "\2014";
|
237
237
|
display: inline-block;
|
238
238
|
width: 1em;
|
@@ -246,7 +246,7 @@ li p {
|
|
246
246
|
line-height: 1.2;
|
247
247
|
}
|
248
248
|
|
249
|
-
#toc li
|
249
|
+
#toc li::before {
|
250
250
|
content: " ";
|
251
251
|
display: none;
|
252
252
|
}
|
@@ -271,7 +271,7 @@ p.Terms {
|
|
271
271
|
// box-shadow: inset -5px 0px 10px -5px #1d1d1d !important;
|
272
272
|
// }
|
273
273
|
|
274
|
-
li
|
274
|
+
li::before {
|
275
275
|
content: " ";
|
276
276
|
display: none;
|
277
277
|
}
|
@@ -694,7 +694,7 @@ aside.footnote {
|
|
694
694
|
display: inline;
|
695
695
|
}
|
696
696
|
|
697
|
-
ol>li>p
|
697
|
+
ol>li>p::before {
|
698
698
|
content: "";
|
699
699
|
display: none;
|
700
700
|
}
|
@@ -295,8 +295,8 @@ body {
|
|
295
295
|
blockquote, q {
|
296
296
|
quotes: none; }
|
297
297
|
|
298
|
-
blockquote
|
299
|
-
q
|
298
|
+
blockquote::before, blockquote::after,
|
299
|
+
q::before, q::after {
|
300
300
|
content: '';
|
301
301
|
content: none; }
|
302
302
|
|
@@ -410,7 +410,7 @@ h2 p, .h2 p {
|
|
410
410
|
ul > li {
|
411
411
|
list-style: none; }
|
412
412
|
|
413
|
-
ul > li > p:first-child
|
413
|
+
ul > li > p:first-child::before {
|
414
414
|
content: "\2014";
|
415
415
|
display: inline-block;
|
416
416
|
width: 1em;
|
@@ -473,7 +473,7 @@ p.Terms {
|
|
473
473
|
#toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
|
474
474
|
box-shadow: 0px 1px 0px 0px black !important;
|
475
475
|
background: none; }
|
476
|
-
#toc li
|
476
|
+
#toc li::before, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li::before {
|
477
477
|
content: " ";
|
478
478
|
display: none; }
|
479
479
|
|
@@ -793,57 +793,57 @@ ol > li {
|
|
793
793
|
list-style: none;
|
794
794
|
position: relative; }
|
795
795
|
|
796
|
-
ol > li
|
796
|
+
ol > li::before {
|
797
797
|
position: absolute;
|
798
798
|
left: -1.4em; }
|
799
799
|
|
800
|
-
ol[class="roman"] > li
|
800
|
+
ol[class="roman"] > li::before {
|
801
801
|
left: -2.0em; }
|
802
802
|
|
803
|
-
ol[class="roman_upper"] > li
|
803
|
+
ol[class="roman_upper"] > li::before {
|
804
804
|
left: -2.3em; }
|
805
805
|
|
806
|
-
ol[class="alphabet"] > li
|
806
|
+
ol[class="alphabet"] > li::before {
|
807
807
|
counter-increment: alphabet;
|
808
808
|
content: counter(alphabet, lower-alpha) ") "; }
|
809
809
|
|
810
|
-
ol[class="arabic"] > li
|
810
|
+
ol[class="arabic"] > li::before {
|
811
811
|
counter-increment: arabic;
|
812
812
|
content: counter(arabic, decimal) ") "; }
|
813
813
|
|
814
|
-
ol[class="roman"] > li
|
814
|
+
ol[class="roman"] > li::before {
|
815
815
|
counter-increment: roman;
|
816
816
|
content: counter(roman, lower-roman) ") "; }
|
817
817
|
|
818
|
-
ol[class="alphabet_upper"] > li
|
818
|
+
ol[class="alphabet_upper"] > li::before {
|
819
819
|
counter-increment: alphabet_upper;
|
820
820
|
content: counter(alphabet_upper, upper-alpha) ") "; }
|
821
821
|
|
822
|
-
ol[class="roman_upper"] > li
|
822
|
+
ol[class="roman_upper"] > li::before {
|
823
823
|
counter-increment: roman_upper;
|
824
824
|
content: counter(roman_upper, upper-roman) ") "; }
|
825
825
|
|
826
|
-
ol > li
|
826
|
+
ol > li::before {
|
827
827
|
counter-increment: alphabet;
|
828
828
|
content: counter(alphabet, lower-alpha) ") "; }
|
829
829
|
|
830
|
-
ol[class="alphabet"] ol[class="alphabet"] > li
|
830
|
+
ol[class="alphabet"] ol[class="alphabet"] > li::before {
|
831
831
|
counter-increment: alphabet2;
|
832
832
|
content: counter(alphabet2, lower-alpha) ") "; }
|
833
833
|
|
834
|
-
ol[class="arabic"] ol[class="arabic"] > li
|
834
|
+
ol[class="arabic"] ol[class="arabic"] > li::before {
|
835
835
|
counter-increment: arabic2;
|
836
836
|
content: counter(arabic2, decimal) ") "; }
|
837
837
|
|
838
|
-
ol[class="roman"] ol[class="roman"] > li
|
838
|
+
ol[class="roman"] ol[class="roman"] > li::before {
|
839
839
|
counter-increment: roman2;
|
840
840
|
content: counter(roman2, lower-roman) ") "; }
|
841
841
|
|
842
|
-
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li
|
842
|
+
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li::before {
|
843
843
|
counter-increment: alphabet_upper2;
|
844
844
|
content: counter(alphabet_upper2, upper-alpha) ") "; }
|
845
845
|
|
846
|
-
ol[class="roman_upper"] ol[class="roman_upper"] > li
|
846
|
+
ol[class="roman_upper"] ol[class="roman_upper"] > li::before {
|
847
847
|
counter-increment: roman_upper2;
|
848
848
|
content: counter(roman_upper2, upper-roman) ") "; }
|
849
849
|
|
@@ -1067,7 +1067,7 @@ ol.footnotes-list:first-child {
|
|
1067
1067
|
ol.footnotes-list p, aside.footnote p {
|
1068
1068
|
display: inline; }
|
1069
1069
|
|
1070
|
-
ol > li > p
|
1070
|
+
ol > li > p::before {
|
1071
1071
|
content: "";
|
1072
1072
|
display: none; }
|
1073
1073
|
|
@@ -27,8 +27,8 @@ body {
|
|
27
27
|
blockquote, q {
|
28
28
|
quotes: none;
|
29
29
|
}
|
30
|
-
blockquote
|
31
|
-
q
|
30
|
+
blockquote::before, blockquote::after,
|
31
|
+
q::before, q::after {
|
32
32
|
content: '';
|
33
33
|
content: none;
|
34
34
|
}
|
@@ -177,7 +177,7 @@ ul > li {
|
|
177
177
|
list-style: none;
|
178
178
|
}
|
179
179
|
|
180
|
-
ul > li > p:first-child
|
180
|
+
ul > li > p:first-child::before {
|
181
181
|
content: "\2014";
|
182
182
|
display: inline-block;
|
183
183
|
width: 1em;
|
@@ -210,7 +210,7 @@ p.Terms {
|
|
210
210
|
background: none;
|
211
211
|
}
|
212
212
|
|
213
|
-
li
|
213
|
+
li::before {
|
214
214
|
content: " ";
|
215
215
|
display: none;
|
216
216
|
}
|
@@ -458,57 +458,57 @@ ol > li {
|
|
458
458
|
list-style: none;
|
459
459
|
position: relative;
|
460
460
|
}
|
461
|
-
ol > li
|
461
|
+
ol > li::before {
|
462
462
|
position: absolute;
|
463
463
|
left: -1.4em;
|
464
464
|
}
|
465
|
-
ol[class="roman"] > li
|
465
|
+
ol[class="roman"] > li::before {
|
466
466
|
left: -2.0em;
|
467
467
|
}
|
468
|
-
ol[class="roman_upper"] > li
|
468
|
+
ol[class="roman_upper"] > li::before {
|
469
469
|
left: -2.3em;
|
470
470
|
}
|
471
|
-
ol[class="alphabet"] > li
|
471
|
+
ol[class="alphabet"] > li::before {
|
472
472
|
counter-increment: alphabet;
|
473
473
|
content: counter(alphabet, lower-alpha)") "
|
474
474
|
}
|
475
|
-
ol[class="arabic"] > li
|
475
|
+
ol[class="arabic"] > li::before {
|
476
476
|
counter-increment: arabic;
|
477
477
|
content: counter(arabic, decimal)") "
|
478
478
|
}
|
479
|
-
ol[class="roman"] > li
|
479
|
+
ol[class="roman"] > li::before {
|
480
480
|
counter-increment: roman;
|
481
481
|
content: counter(roman, lower-roman)") "
|
482
482
|
}
|
483
|
-
ol[class="alphabet_upper"] > li
|
483
|
+
ol[class="alphabet_upper"] > li::before {
|
484
484
|
counter-increment: alphabet_upper;
|
485
485
|
content: counter(alphabet_upper, upper-alpha)") "
|
486
486
|
}
|
487
|
-
ol[class="roman_upper"] > li
|
487
|
+
ol[class="roman_upper"] > li::before {
|
488
488
|
counter-increment: roman_upper;
|
489
489
|
content: counter(roman_upper, upper-roman)") "
|
490
490
|
}
|
491
|
-
ol > li
|
491
|
+
ol > li::before {
|
492
492
|
counter-increment: alphabet;
|
493
493
|
content: counter(alphabet, lower-alpha)") "
|
494
494
|
}
|
495
|
-
ol[class="alphabet"] ol[class="alphabet"] > li
|
495
|
+
ol[class="alphabet"] ol[class="alphabet"] > li::before {
|
496
496
|
counter-increment: alphabet2;
|
497
497
|
content: counter(alphabet2, lower-alpha)") "
|
498
498
|
}
|
499
|
-
ol[class="arabic"] ol[class="arabic"] > li
|
499
|
+
ol[class="arabic"] ol[class="arabic"] > li::before {
|
500
500
|
counter-increment: arabic2;
|
501
501
|
content: counter(arabic2, decimal)") "
|
502
502
|
}
|
503
|
-
ol[class="roman"] ol[class="roman"] > li
|
503
|
+
ol[class="roman"] ol[class="roman"] > li::before {
|
504
504
|
counter-increment: roman2;
|
505
505
|
content: counter(roman2, lower-roman)") "
|
506
506
|
}
|
507
|
-
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li
|
507
|
+
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li::before {
|
508
508
|
counter-increment: alphabet_upper2;
|
509
509
|
content: counter(alphabet_upper2, upper-alpha)") "
|
510
510
|
}
|
511
|
-
ol[class="roman_upper"] ol[class="roman_upper"] > li
|
511
|
+
ol[class="roman_upper"] ol[class="roman_upper"] > li::before {
|
512
512
|
counter-increment: roman_upper2;
|
513
513
|
content: counter(roman_upper2, upper-roman)") "
|
514
514
|
}
|
@@ -723,7 +723,7 @@ ol.footnotes-list p, aside.footnote p {
|
|
723
723
|
display: inline;
|
724
724
|
}
|
725
725
|
|
726
|
-
ol > li > p
|
726
|
+
ol > li > p::before {
|
727
727
|
content: "";
|
728
728
|
display: none;
|
729
729
|
}
|
@@ -459,7 +459,7 @@
|
|
459
459
|
|
460
460
|
<fo:flow flow-name="xsl-region-body">
|
461
461
|
|
462
|
-
<xsl:if test="position() = 1">
|
462
|
+
<!-- <xsl:if test="position() = 1">
|
463
463
|
<fo:table table-layout="fixed" width="100%">
|
464
464
|
<fo:table-column column-width="proportional-column-width(35)"/>
|
465
465
|
<fo:table-column column-width="proportional-column-width(97)"/>
|
@@ -467,14 +467,14 @@
|
|
467
467
|
<fo:table-column column-width="proportional-column-width(12)"/>
|
468
468
|
<fo:table-body>
|
469
469
|
<fo:table-row>
|
470
|
-
<fo:table-cell><fo:block
|
470
|
+
<fo:table-cell><fo:block></fo:block></fo:table-cell>
|
471
471
|
<fo:table-cell font-family="IPAexGothic" font-size="14pt" text-align="center">
|
472
472
|
<fo:block>
|
473
473
|
<xsl:call-template name="getLocalizedString">
|
474
474
|
<xsl:with-param name="key">doctype_dict.<xsl:value-of select="$doctype"/></xsl:with-param>
|
475
475
|
</xsl:call-template>
|
476
476
|
</fo:block>
|
477
|
-
|
477
|
+
</fo:table-cell>
|
478
478
|
<fo:table-cell text-align="right">
|
479
479
|
<fo:block font-family="Arial" font-size="16pt">
|
480
480
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($docnumber), '^(JIS)(.*)', '$1')"/>
|
@@ -489,29 +489,29 @@
|
|
489
489
|
</fo:inline>
|
490
490
|
</fo:block>
|
491
491
|
</fo:table-cell>
|
492
|
-
|
492
|
+
|
493
493
|
</fo:table-row>
|
494
494
|
</fo:table-body>
|
495
495
|
</fo:table>
|
496
|
-
|
496
|
+
|
497
497
|
<fo:block font-family="IPAexGothic" font-size="19pt" text-align="center" margin-top="12mm" margin-bottom="4mm"><xsl:value-of select="$title_ja"/></fo:block>
|
498
498
|
<fo:block font-family="Arial" font-size="13pt" text-align="center" margin-bottom="10mm"><xsl:value-of select="$title_en"/></fo:block>
|
499
|
-
|
500
|
-
</xsl:if>
|
499
|
+
|
500
|
+
</xsl:if> -->
|
501
501
|
|
502
502
|
<!-- Annex Commentary first page -->
|
503
|
-
<xsl:if test="$isCommentary = 'true'">
|
503
|
+
<!-- <xsl:if test="$isCommentary = 'true'"> -->
|
504
504
|
|
505
505
|
<!-- Example: JIS Z 8301:2019 -->
|
506
|
-
<fo:block font-family="IPAexGothic" font-size="15pt" text-align="center">
|
506
|
+
<!-- <fo:block font-family="IPAexGothic" font-size="15pt" text-align="center">
|
507
507
|
<fo:inline font-family="Arial">JIS <xsl:value-of select="$docidentifier_number"/></fo:inline>
|
508
508
|
<fo:inline baseline-shift="10%"><fo:inline font-size="10pt">:</fo:inline>
|
509
509
|
<fo:inline font-family="Times New Roman" font-size="10pt"><xsl:value-of select="$docidentifier_year"/></fo:inline></fo:inline>
|
510
|
-
</fo:block>
|
510
|
+
</fo:block> -->
|
511
511
|
|
512
512
|
<!-- title -->
|
513
|
-
<fo:block role="H1" font-family="IPAexGothic" font-size="16pt" text-align="center" margin-top="6mm"><xsl:value-of select="$title_ja"/></fo:block>
|
514
|
-
</xsl:if>
|
513
|
+
<!-- <fo:block role="H1" font-family="IPAexGothic" font-size="16pt" text-align="center" margin-top="6mm"><xsl:value-of select="$title_ja"/></fo:block> -->
|
514
|
+
<!-- </xsl:if> -->
|
515
515
|
|
516
516
|
<xsl:apply-templates select="*" mode="page"/>
|
517
517
|
|
@@ -704,6 +704,129 @@
|
|
704
704
|
</fo:page-sequence>
|
705
705
|
</xsl:template> <!-- insertInnerCoverPage -->
|
706
706
|
|
707
|
+
<xsl:template match="jis:p[@class = 'JapaneseIndustrialStandard']" priority="4">
|
708
|
+
<fo:table table-layout="fixed" width="100%">
|
709
|
+
<fo:table-column column-width="proportional-column-width(36)"/>
|
710
|
+
<fo:table-column column-width="proportional-column-width(92)"/>
|
711
|
+
<fo:table-column column-width="proportional-column-width(36)"/>
|
712
|
+
<fo:table-body>
|
713
|
+
<fo:table-row>
|
714
|
+
<fo:table-cell>
|
715
|
+
<fo:block> </fo:block>
|
716
|
+
</fo:table-cell>
|
717
|
+
<fo:table-cell font-family="IPAexGothic" font-size="14pt" text-align="center">
|
718
|
+
<fo:block><xsl:apply-templates/></fo:block>
|
719
|
+
</fo:table-cell>
|
720
|
+
<fo:table-cell padding-left="5mm">
|
721
|
+
<fo:block font-family="Arial" font-size="16pt">
|
722
|
+
<xsl:apply-templates select="jis:span[@class = 'JIS']">
|
723
|
+
<xsl:with-param name="process">true</xsl:with-param>
|
724
|
+
</xsl:apply-templates>
|
725
|
+
</fo:block>
|
726
|
+
</fo:table-cell>
|
727
|
+
</fo:table-row>
|
728
|
+
</fo:table-body>
|
729
|
+
</fo:table>
|
730
|
+
</xsl:template>
|
731
|
+
|
732
|
+
<xsl:template match="jis:p[@class = 'StandardNumber']" priority="4">
|
733
|
+
<fo:table table-layout="fixed" width="100%">
|
734
|
+
<fo:table-column column-width="proportional-column-width(36)"/>
|
735
|
+
<fo:table-column column-width="proportional-column-width(92)"/>
|
736
|
+
<fo:table-column column-width="proportional-column-width(36)"/>
|
737
|
+
<fo:table-body>
|
738
|
+
<fo:table-row>
|
739
|
+
<fo:table-cell>
|
740
|
+
<fo:block> </fo:block>
|
741
|
+
</fo:table-cell>
|
742
|
+
<fo:table-cell>
|
743
|
+
<fo:block> </fo:block>
|
744
|
+
</fo:table-cell>
|
745
|
+
<fo:table-cell>
|
746
|
+
<fo:block>
|
747
|
+
<xsl:apply-templates/>
|
748
|
+
</fo:block>
|
749
|
+
</fo:table-cell>
|
750
|
+
</fo:table-row>
|
751
|
+
</fo:table-body>
|
752
|
+
</fo:table>
|
753
|
+
</xsl:template>
|
754
|
+
|
755
|
+
<xsl:template match="jis:p[@class = 'StandardNumber']//text()[not(ancestor::jis:span)]" priority="4">
|
756
|
+
<fo:inline font-family="Arial" font-size="16pt">
|
757
|
+
<xsl:choose>
|
758
|
+
<xsl:when test="contains(., ':')">
|
759
|
+
<xsl:value-of select="substring-before(., ':')"/>
|
760
|
+
<fo:inline baseline-shift="10%" font-size="10pt" font-family="IPAexMincho">:</fo:inline>
|
761
|
+
<xsl:value-of select="substring-after(., ':')"/>
|
762
|
+
</xsl:when>
|
763
|
+
<xsl:otherwise>
|
764
|
+
<xsl:value-of select="."/>
|
765
|
+
</xsl:otherwise>
|
766
|
+
</xsl:choose>
|
767
|
+
</fo:inline>
|
768
|
+
</xsl:template>
|
769
|
+
|
770
|
+
<xsl:template match="jis:p[@class = 'StandardNumber']/jis:span[@class = 'EffectiveYear']" priority="4">
|
771
|
+
<fo:inline font-size="10pt" baseline-shift="10%">
|
772
|
+
<fo:inline font-family="Times New Roman"><xsl:apply-templates/></fo:inline>
|
773
|
+
</fo:inline>
|
774
|
+
</xsl:template>
|
775
|
+
|
776
|
+
<xsl:template match="jis:p[@class = 'JapaneseIndustrialStandard']/jis:tab" priority="4"/>
|
777
|
+
<!-- <fo:inline role="SKIP" padding-right="0mm">​</fo:inline>
|
778
|
+
</xsl:template> -->
|
779
|
+
<xsl:template match="jis:p[@class = 'JapaneseIndustrialStandard']/jis:span[@class = 'JIS']" priority="4">
|
780
|
+
<xsl:param name="process">false</xsl:param>
|
781
|
+
<xsl:if test="$process = 'true'">
|
782
|
+
<fo:inline font-size="16pt" font-family="Arial"><xsl:apply-templates/></fo:inline>
|
783
|
+
</xsl:if>
|
784
|
+
</xsl:template>
|
785
|
+
|
786
|
+
<xsl:template match="jis:p[@class = 'zzSTDTitle1']" priority="4">
|
787
|
+
<fo:block font-family="IPAexGothic" font-size="19pt" text-align="center" margin-top="12mm" margin-bottom="4mm">
|
788
|
+
<xsl:apply-templates/>
|
789
|
+
</fo:block>
|
790
|
+
</xsl:template>
|
791
|
+
|
792
|
+
<xsl:template match="jis:p[@class = 'zzSTDTitle2']" priority="4">
|
793
|
+
<fo:block font-family="Arial" font-size="13pt" text-align="center" margin-bottom="10mm">
|
794
|
+
<xsl:apply-templates/>
|
795
|
+
</fo:block>
|
796
|
+
</xsl:template>
|
797
|
+
|
798
|
+
<!-- for commentary annex -->
|
799
|
+
<xsl:template match="jis:p[@class = 'CommentaryStandardNumber']" priority="4">
|
800
|
+
<fo:block font-family="IPAexGothic" font-size="15pt" text-align="center">
|
801
|
+
<xsl:apply-templates/>
|
802
|
+
</fo:block>
|
803
|
+
</xsl:template>
|
804
|
+
|
805
|
+
<xsl:template match="jis:p[@class = 'CommentaryStandardNumber']//text()[not(ancestor::jis:span)]" priority="4">
|
806
|
+
<fo:inline font-family="Arial">
|
807
|
+
<xsl:choose>
|
808
|
+
<xsl:when test="contains(., ':')">
|
809
|
+
<xsl:value-of select="substring-before(., ':')"/>
|
810
|
+
<fo:inline baseline-shift="10%" font-size="10pt" font-family="IPAexMincho">:</fo:inline>
|
811
|
+
<xsl:value-of select="substring-after(., ':')"/>
|
812
|
+
</xsl:when>
|
813
|
+
<xsl:otherwise>
|
814
|
+
<xsl:value-of select="."/>
|
815
|
+
</xsl:otherwise>
|
816
|
+
</xsl:choose>
|
817
|
+
</fo:inline>
|
818
|
+
</xsl:template>
|
819
|
+
|
820
|
+
<xsl:template match="jis:p[@class = 'CommentaryStandardNumber']/jis:span[@class = 'CommentaryEffectiveYear']" priority="4">
|
821
|
+
<fo:inline baseline-shift="10%" font-family="Times New Roman" font-size="10pt"><xsl:apply-templates/></fo:inline>
|
822
|
+
</xsl:template>
|
823
|
+
|
824
|
+
<xsl:template match="jis:p[@class = 'CommentaryStandardName']" priority="4">
|
825
|
+
<fo:block role="H1" font-family="IPAexGothic" font-size="16pt" text-align="center" margin-top="6mm">
|
826
|
+
<xsl:apply-templates/>
|
827
|
+
</fo:block>
|
828
|
+
</xsl:template>
|
829
|
+
|
707
830
|
<!-- ============================= -->
|
708
831
|
<!-- CONTENTS -->
|
709
832
|
<!-- ============================= -->
|
@@ -842,7 +965,7 @@
|
|
842
965
|
<xsl:choose>
|
843
966
|
<xsl:when test="@type = 'section-title'">18pt</xsl:when>
|
844
967
|
<xsl:when test="@ancestor = 'foreword' and $level = '1'">14pt</xsl:when>
|
845
|
-
<xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[
|
968
|
+
<xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[local-name() = 'annex'][1][@commentary = 'true']">16pt</xsl:when>
|
846
969
|
<xsl:when test="@ancestor = 'annex' and $level = '1'">14pt</xsl:when>
|
847
970
|
<!-- <xsl:when test="@ancestor = 'foreword' and $level >= '2'">12pt</xsl:when>
|
848
971
|
<xsl:when test=". = 'Executive summary'">18pt</xsl:when>
|
@@ -879,7 +1002,7 @@
|
|
879
1002
|
<xsl:variable name="margin-top">
|
880
1003
|
<xsl:choose>
|
881
1004
|
<xsl:when test="@ancestor = 'foreword' and $level = 1">9mm</xsl:when>
|
882
|
-
<xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[
|
1005
|
+
<xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[local-name() = 'annex'][1][@commentary = 'true']">1mm</xsl:when>
|
883
1006
|
<xsl:when test="$level = 1">6.5mm</xsl:when>
|
884
1007
|
<xsl:when test="@ancestor = 'foreword' and $level = 2">0mm</xsl:when>
|
885
1008
|
<xsl:when test="@ancestor = 'annex' and $level = 2">4.5mm</xsl:when>
|
@@ -900,7 +1023,7 @@
|
|
900
1023
|
<xsl:variable name="margin-bottom">
|
901
1024
|
<xsl:choose>
|
902
1025
|
<xsl:when test="@ancestor = 'foreword' and $level = 1">9mm</xsl:when>
|
903
|
-
<xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[
|
1026
|
+
<xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::*[local-name() = 'annex'][1][@commentary = 'true']">7mm</xsl:when>
|
904
1027
|
<xsl:when test="$level = 1 and following-sibling::jis:clause">8pt</xsl:when>
|
905
1028
|
<xsl:when test="$level = 1">12pt</xsl:when>
|
906
1029
|
<xsl:when test="$level = 2 and following-sibling::jis:clause">8pt</xsl:when>
|
@@ -1167,7 +1290,7 @@
|
|
1167
1290
|
</xsl:if>
|
1168
1291
|
</xsl:template>
|
1169
1292
|
|
1170
|
-
<xsl:template match="*[local-name() = 'span'][@class = 'surname' or @class = 'givenname']" mode="update_xml_step1" priority="2">
|
1293
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'surname' or @class = 'givenname' or @class = 'JIS' or @class = 'EffectiveYear' or @class = 'CommentaryEffectiveYear']" mode="update_xml_step1" priority="2">
|
1171
1294
|
<xsl:copy>
|
1172
1295
|
<xsl:apply-templates select="@* | node()" mode="update_xml_step1"/>
|
1173
1296
|
</xsl:copy>
|
@@ -1370,7 +1493,10 @@
|
|
1370
1493
|
|
1371
1494
|
<xsl:template match="*[local-name() = 'font_en'][normalize-space() != '']">
|
1372
1495
|
<xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
|
1373
|
-
<fo:inline
|
1496
|
+
<fo:inline>
|
1497
|
+
<xsl:if test="not(ancestor::jis:p[@class = 'zzSTDTitle2']) and not(ancestor::jis:span[@class = 'JIS'])">
|
1498
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
1499
|
+
</xsl:if>
|
1374
1500
|
<xsl:if test="ancestor::*[local-name() = 'preferred']">
|
1375
1501
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1376
1502
|
</xsl:if>
|
@@ -5363,6 +5489,9 @@
|
|
5363
5489
|
<!-- END Definition List -->
|
5364
5490
|
<!-- ===================== -->
|
5365
5491
|
|
5492
|
+
<!-- default: ignore title in sections/p -->
|
5493
|
+
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
|
5494
|
+
|
5366
5495
|
<!-- ========================= -->
|
5367
5496
|
<!-- Rich text formatting -->
|
5368
5497
|
<!-- ========================= -->
|
@@ -7442,25 +7571,45 @@
|
|
7442
7571
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
7443
7572
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
7444
7573
|
|
7445
|
-
<xsl:
|
7446
|
-
<xsl:
|
7447
|
-
<xsl:
|
7448
|
-
|
7449
|
-
|
7450
|
-
|
7574
|
+
<xsl:if test="@width != '' and @width != 'auto'">
|
7575
|
+
<xsl:attribute name="width">
|
7576
|
+
<xsl:value-of select="@width"/>
|
7577
|
+
</xsl:attribute>
|
7578
|
+
</xsl:if>
|
7579
|
+
|
7580
|
+
<xsl:if test="@height != '' and @height != 'auto'">
|
7581
|
+
<xsl:attribute name="height">
|
7582
|
+
<xsl:value-of select="@height"/>
|
7583
|
+
</xsl:attribute>
|
7584
|
+
</xsl:if>
|
7451
7585
|
|
7452
|
-
<xsl:
|
7586
|
+
<xsl:choose>
|
7587
|
+
<xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
|
7588
|
+
<xsl:attribute name="scaling">non-uniform</xsl:attribute>
|
7589
|
+
</xsl:when>
|
7590
|
+
<xsl:otherwise>
|
7453
7591
|
|
7454
|
-
|
7592
|
+
<xsl:variable name="img_src">
|
7593
|
+
<xsl:choose>
|
7594
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
7595
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
7596
|
+
</xsl:choose>
|
7597
|
+
</xsl:variable>
|
7455
7598
|
|
7456
|
-
|
7599
|
+
<xsl:variable name="image_width_effective">
|
7600
|
+
|
7601
|
+
<xsl:value-of select="$width_effective"/>
|
7457
7602
|
|
7458
|
-
|
7459
|
-
<xsl:if test="number($scale) < 100">
|
7603
|
+
</xsl:variable>
|
7460
7604
|
|
7461
|
-
|
7605
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
7606
|
+
<xsl:if test="number($scale) < 100">
|
7462
7607
|
|
7463
|
-
|
7608
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
7609
|
+
|
7610
|
+
</xsl:if>
|
7611
|
+
</xsl:otherwise>
|
7612
|
+
</xsl:choose>
|
7464
7613
|
|
7465
7614
|
</xsl:if>
|
7466
7615
|
|
@@ -11122,7 +11271,7 @@
|
|
11122
11271
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
11123
11272
|
<xsl:apply-templates mode="update_xml_step1"/>
|
11124
11273
|
</xsl:template>
|
11125
|
-
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
11274
|
+
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
11126
11275
|
<xsl:copy>
|
11127
11276
|
<xsl:copy-of select="@*"/>
|
11128
11277
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -135,7 +135,7 @@ module IsoDoc
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def annex1(elem)
|
138
|
-
elem["commentary"] == "true" and return
|
138
|
+
elem["commentary"] == "true" and return commentary(elem)
|
139
139
|
lbl = @xrefs.anchor(elem["id"], :label)
|
140
140
|
if t = elem.at(ns("./title"))
|
141
141
|
t.children = "<strong>#{to_xml(t.children)}</strong>"
|
@@ -157,6 +157,21 @@ module IsoDoc
|
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
160
|
+
def commentary(elem)
|
161
|
+
t = elem.elements.first
|
162
|
+
commentary_title_hdr(t)
|
163
|
+
middle_title_main(t, "CommentaryStandardName")
|
164
|
+
end
|
165
|
+
|
166
|
+
def commentary_title_hdr(elem)
|
167
|
+
ret = <<~COMMENTARY
|
168
|
+
<p class="CommentaryStandardNumber">JIS #{@meta.get[:docnumber_undated]}
|
169
|
+
COMMENTARY
|
170
|
+
yr = @meta.get[:docyear] and
|
171
|
+
ret += ": <span class='CommentaryEffectiveYear'>#{yr}</span>"
|
172
|
+
elem.previous = ret
|
173
|
+
end
|
174
|
+
|
160
175
|
def display_order(docxml)
|
161
176
|
i = 0
|
162
177
|
i = display_order_xpath(docxml, "//preface/*", i)
|
@@ -202,6 +217,60 @@ module IsoDoc
|
|
202
217
|
dest.children.first.next = source
|
203
218
|
end
|
204
219
|
|
220
|
+
def middle_title(docxml)
|
221
|
+
s = docxml.at(ns("//sections")) or return
|
222
|
+
elem = s.children.first
|
223
|
+
middle_title_hdr(elem)
|
224
|
+
middle_title_main(elem, "zzSTDTitle1")
|
225
|
+
middle_subtitle_main(elem)
|
226
|
+
# middle_title_amd(s.children.first)
|
227
|
+
end
|
228
|
+
|
229
|
+
def middle_title_hdr(out)
|
230
|
+
ret = "<p class='JapaneseIndustrialStandard'>#{@i18n.jis}"
|
231
|
+
@meta.get[:unpublished] and ret += @i18n.l10n("(#{@i18n.draft_label})")
|
232
|
+
ret += ("<tab/>" * 7)
|
233
|
+
ret += "<span class='JIS'>JIS</span></p>"
|
234
|
+
ret += "<p class='StandardNumber'><tab/>#{@meta.get[:docnumber_undated]}"
|
235
|
+
if yr = @meta.get[:docyear]
|
236
|
+
ret += ": <span class='EffectiveYear'>#{yr}</span>"
|
237
|
+
end
|
238
|
+
ret += "</p><p class='IDT'/>"
|
239
|
+
out.previous = ret
|
240
|
+
end
|
241
|
+
|
242
|
+
def middle_title_main(out, style)
|
243
|
+
t = @meta.get[:doctitlemain]
|
244
|
+
(t && !t.empty?) or return
|
245
|
+
ret = "<p class='#{style}'>#{@meta.get[:doctitleintro]}"
|
246
|
+
ret += " — " if @meta.get[:doctitleintro] && t
|
247
|
+
ret += t
|
248
|
+
ret += " — " if t && @meta.get[:doctitlepart]
|
249
|
+
ret += "</p>"
|
250
|
+
if a = @meta.get[:doctitlepart]
|
251
|
+
ret += "<p class='zzSTDTitle1'>"
|
252
|
+
b = @meta.get[:doctitlepartlabel] and ret += "#{b}: "
|
253
|
+
ret += "<br/><strong>#{a}</strong></p>"
|
254
|
+
end
|
255
|
+
out.previous = ret
|
256
|
+
end
|
257
|
+
|
258
|
+
def middle_subtitle_main(out)
|
259
|
+
t = @meta.get[:docsubtitlemain]
|
260
|
+
(t && !t.empty?) or return
|
261
|
+
ret = "<p class='zzSTDTitle2'>#{@meta.get[:docsubtitleintro]}"
|
262
|
+
ret += " — " if @meta.get[:docsubtitleintro] && t
|
263
|
+
ret += @meta.get[:docsubtitlemain]
|
264
|
+
ret += " — " if t && @meta.get[:docsubtitlepart]
|
265
|
+
ret += "</p>"
|
266
|
+
if a = @meta.get[:docsubtitlepart]
|
267
|
+
ret += "<p class='zzSTDTitle2'>"
|
268
|
+
b = @meta.get[:docsubtitlepartlabel] and ret += "#{b}: "
|
269
|
+
ret += "<br/><strong>#{a}</strong></p>"
|
270
|
+
end
|
271
|
+
out.previous = ret
|
272
|
+
end
|
273
|
+
|
205
274
|
include Init
|
206
275
|
end
|
207
276
|
end
|
@@ -63,34 +63,29 @@ module IsoDoc
|
|
63
63
|
olstyle: "l8" }
|
64
64
|
end
|
65
65
|
|
66
|
-
def norm_ref(
|
67
|
-
|
68
|
-
return num
|
66
|
+
def norm_ref(node, out)
|
67
|
+
node["hidden"] != "true" or return
|
69
68
|
out.div class: "normref_div" do |div|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
else biblio_list(f, div, false)
|
69
|
+
clause_name(node, node.at(ns("./title")), div, nil)
|
70
|
+
if node.name == "clause"
|
71
|
+
node.elements.each { |e| parse(e, div) unless e.name == "title" }
|
72
|
+
else biblio_list(node, div, false)
|
75
73
|
end
|
76
74
|
end
|
77
|
-
num
|
78
75
|
end
|
79
76
|
|
80
|
-
def bibliography(
|
81
|
-
|
82
|
-
return
|
77
|
+
def bibliography(node, out)
|
78
|
+
node["hidden"] != "true" or return
|
83
79
|
page_break(out)
|
84
80
|
out.div class: "bibliography" do |div|
|
85
81
|
div.h1 class: "Section3" do |h1|
|
86
|
-
|
82
|
+
node.at(ns("./title"))&.children&.each { |c2| parse(c2, h1) }
|
87
83
|
end
|
88
|
-
biblio_list(
|
84
|
+
biblio_list(node, div, true)
|
89
85
|
end
|
90
86
|
end
|
91
87
|
|
92
88
|
def annex_name(_annex, name, div)
|
93
|
-
preceding_floating_titles(name, div)
|
94
89
|
return if name.nil?
|
95
90
|
|
96
91
|
div.h1 class: "Annex" do |t|
|
@@ -114,32 +109,6 @@ module IsoDoc
|
|
114
109
|
end
|
115
110
|
end
|
116
111
|
|
117
|
-
def make_body2(body, docxml)
|
118
|
-
body.div class: "WordSection2" do |div2|
|
119
|
-
boilerplate docxml, div2
|
120
|
-
front docxml, div2
|
121
|
-
div2.p { |p| p << " " } # placeholder
|
122
|
-
end
|
123
|
-
section_break(body)
|
124
|
-
end
|
125
|
-
|
126
|
-
def middle(isoxml, out)
|
127
|
-
middle_title(isoxml, out)
|
128
|
-
middle_admonitions(isoxml, out)
|
129
|
-
i = isoxml.at(ns("//sections/introduction")) and
|
130
|
-
introduction i, out
|
131
|
-
scope isoxml, out, 0
|
132
|
-
norm_ref isoxml, out, 0
|
133
|
-
clause_etc isoxml, out, 0
|
134
|
-
annex isoxml, out
|
135
|
-
bibliography isoxml, out
|
136
|
-
end
|
137
|
-
|
138
|
-
def make_body3(body, docxml)
|
139
|
-
super
|
140
|
-
commentary docxml, body
|
141
|
-
end
|
142
|
-
|
143
112
|
def footnote_parse(node, out)
|
144
113
|
return table_footnote_parse(node, out) if @in_table || @in_figure # &&
|
145
114
|
|
@@ -161,23 +130,20 @@ module IsoDoc
|
|
161
130
|
@seen_footnote << fn
|
162
131
|
end
|
163
132
|
|
164
|
-
def annex(
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
amd(
|
133
|
+
def annex(node, out)
|
134
|
+
node["commentary"] == "true" and return commentary(node, out)
|
135
|
+
amd(node.document.root) and
|
136
|
+
@suppressheadingnumbers = @oldsuppressheadingnumbers
|
137
|
+
page_break(out)
|
138
|
+
render_annex(out, node)
|
139
|
+
amd(node.document.root) and @suppressheadingnumbers = true
|
171
140
|
end
|
172
141
|
|
173
|
-
def commentary(
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
commentary_title(isoxml, div)
|
179
|
-
render_annex(div, c)
|
180
|
-
end
|
142
|
+
def commentary(node, out)
|
143
|
+
out.span style: "mso-bookmark:PRECOMMENTARYPAGEREF"
|
144
|
+
section_break(out)
|
145
|
+
out.div class: "WordSectionCommentary" do |div|
|
146
|
+
render_annex(div, node)
|
181
147
|
end
|
182
148
|
end
|
183
149
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.2.
|
20
|
+
<!-- VERSION v1.2.3 -->
|
21
21
|
<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">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
@@ -192,9 +192,11 @@
|
|
192
192
|
</attribute>
|
193
193
|
</optional>
|
194
194
|
<attribute name="citeas"/>
|
195
|
-
<
|
196
|
-
<
|
197
|
-
|
195
|
+
<optional>
|
196
|
+
<attribute name="type">
|
197
|
+
<ref name="ReferenceFormat"/>
|
198
|
+
</attribute>
|
199
|
+
</optional>
|
198
200
|
<optional>
|
199
201
|
<attribute name="alt"/>
|
200
202
|
</optional>
|
@@ -836,6 +838,26 @@
|
|
836
838
|
<ref name="paragraph"/>
|
837
839
|
</element>
|
838
840
|
</define>
|
841
|
+
<define name="stem">
|
842
|
+
<element name="stem">
|
843
|
+
<attribute name="type">
|
844
|
+
<choice>
|
845
|
+
<value>MathML</value>
|
846
|
+
<value>AsciiMath</value>
|
847
|
+
<value>LatexMath</value>
|
848
|
+
</choice>
|
849
|
+
</attribute>
|
850
|
+
<attribute name="block">
|
851
|
+
<data type="boolean"/>
|
852
|
+
</attribute>
|
853
|
+
<oneOrMore>
|
854
|
+
<choice>
|
855
|
+
<text/>
|
856
|
+
<ref name="AnyElement"/>
|
857
|
+
</choice>
|
858
|
+
</oneOrMore>
|
859
|
+
</element>
|
860
|
+
</define>
|
839
861
|
<define name="em">
|
840
862
|
<element name="em">
|
841
863
|
<zeroOrMore>
|
data/metanorma-jis.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
31
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
32
32
|
|
33
|
-
spec.add_dependency "metanorma-iso", "~> 2.
|
33
|
+
spec.add_dependency "metanorma-iso", "~> 2.5.0"
|
34
34
|
#spec.add_dependency "relaton-bipm", "~> 1.14.8"
|
35
35
|
#spec.add_dependency "relaton-iho", "~> 1.14.3"
|
36
36
|
spec.add_dependency "pubid-jis"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-jis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.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: 2023-07
|
11
|
+
date: 2023-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.5.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: 2.
|
26
|
+
version: 2.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pubid-jis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|