metanorma-iec 2.2.13 → 2.3.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/iec/base_convert.rb +1 -29
- data/lib/isodoc/iec/html/htmlstyle.css +24 -20
- data/lib/isodoc/iec/html/htmlstyle.scss +17 -17
- data/lib/isodoc/iec/i18n-en.yaml +3 -0
- data/lib/isodoc/iec/i18n-fr.yaml +3 -0
- data/lib/isodoc/iec/i18n-zh-Hans.yaml +3 -0
- data/lib/isodoc/iec/iec.international-standard.xsl +119 -67
- data/lib/isodoc/iec/presentation_terms.rb +185 -0
- data/lib/isodoc/iec/presentation_xml_convert.rb +26 -188
- data/lib/isodoc/iec/word_convert.rb +0 -12
- data/lib/metanorma/iec/front.rb +8 -2
- data/lib/metanorma/iec/iec_intro_en.xml +1 -1
- data/lib/metanorma/iec/iec_intro_fr.xml +1 -1
- data/lib/metanorma/iec/isodoc.rng +26 -4
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +2 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bbf4100356359c06914283c42cdc828b4af82024174d93a4d49d5a9f2b12902
|
4
|
+
data.tar.gz: 96c9f82aa720dfe3786e18737580b5634deedd70fca154442bbdab16b1620875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1b41a266e6b3a83a7be27392f8d0e3dcbe52767039b781b72f0a12424ee96f9ce35eb7450e6f02082b45927b044d03c1323cbaf12024f661155f3ac8a67d9f8
|
7
|
+
data.tar.gz: 370bc7e84e79e71194530fe5e9238da8ce89e55ad4babf7517bc57417268a6be5ccc443adba5859a1a3d297282a44581178691bd20d5508109bc838bef2ca6d6
|
@@ -15,35 +15,7 @@ module IsoDoc
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
title1, title2 = middle_title_parts(out)
|
20
|
-
out.p(class: "zzSTDTitle1") do |p|
|
21
|
-
p.b { |b| b << title1 }
|
22
|
-
end
|
23
|
-
if title2
|
24
|
-
out.p(class: "zzSTDTitle1") { |p| p << " " }
|
25
|
-
out.p(class: "zzSTDTitle2") do |p|
|
26
|
-
p.b { |b| b << title2 }
|
27
|
-
end
|
28
|
-
end
|
29
|
-
out.p(class: "zzSTDTitle1") { |p| p << " " }
|
30
|
-
end
|
31
|
-
|
32
|
-
def middle_title_parts(_out)
|
33
|
-
title1 = @meta.get[:doctitlemain]&.sub(/\s+$/, "")
|
34
|
-
@meta.get[:doctitleintro] and
|
35
|
-
title1 = "#{@meta.get[:doctitleintro]} — #{title1}"
|
36
|
-
title2 = nil
|
37
|
-
if @meta.get[:doctitlepart]
|
38
|
-
title1 += " —"
|
39
|
-
title2 = @meta.get[:doctitlepart]&.sub(/\s+$/, "")
|
40
|
-
@meta.get[:doctitlepartlabel] and
|
41
|
-
title2 = "#{@meta.get[:doctitlepartlabel]}: #{title2}"
|
42
|
-
end
|
43
|
-
[title1, title2]
|
44
|
-
end
|
45
|
-
|
46
|
-
def bibliography(isoxml, out)
|
18
|
+
def bibliography(node, out)
|
47
19
|
return super unless @is_iev
|
48
20
|
end
|
49
21
|
|
@@ -97,7 +97,7 @@ h1, h2, h3, h4, h5, h6 {
|
|
97
97
|
|
98
98
|
blockquote, q {
|
99
99
|
quotes: none; }
|
100
|
-
blockquote
|
100
|
+
blockquote::before, blockquote::after, q::before, q::after {
|
101
101
|
content: '';
|
102
102
|
content: none; }
|
103
103
|
|
@@ -120,14 +120,18 @@ b, strong {
|
|
120
120
|
div.document-stage-band, div.document-type-band {
|
121
121
|
background-color: #333333; }
|
122
122
|
|
123
|
-
a.FootnoteRef + a.FootnoteRef
|
123
|
+
a.FootnoteRef + a.FootnoteRef::before {
|
124
124
|
content: ", ";
|
125
125
|
vertical-align: super; }
|
126
126
|
|
127
|
-
a.TableFootnoteRef + a.TableFootnoteRef
|
127
|
+
a.TableFootnoteRef + a.TableFootnoteRef::before {
|
128
128
|
content: ", ";
|
129
129
|
vertical-align: super; }
|
130
130
|
|
131
|
+
a.TableFootnoteRef, span.TableFootnoteRef,
|
132
|
+
a.FootnoteRef, span.FootnoteRef {
|
133
|
+
vertical-align: super; }
|
134
|
+
|
131
135
|
.addition {
|
132
136
|
color: blue; }
|
133
137
|
|
@@ -385,7 +389,7 @@ h2 p, .h2 p {
|
|
385
389
|
ul > li {
|
386
390
|
list-style: none; }
|
387
391
|
|
388
|
-
ul > li > p:first-child
|
392
|
+
ul > li > p:first-child::before {
|
389
393
|
content: "\2014";
|
390
394
|
display: inline-block;
|
391
395
|
width: 1em;
|
@@ -397,7 +401,7 @@ li p {
|
|
397
401
|
margin-bottom: 0.6em;
|
398
402
|
line-height: 1.2; }
|
399
403
|
|
400
|
-
#toc li
|
404
|
+
#toc li::before {
|
401
405
|
content: " ";
|
402
406
|
display: none; }
|
403
407
|
|
@@ -757,57 +761,57 @@ ol > li {
|
|
757
761
|
list-style: none;
|
758
762
|
position: relative; }
|
759
763
|
|
760
|
-
ol > li
|
764
|
+
ol > li::before {
|
761
765
|
position: absolute;
|
762
766
|
left: -1.4em; }
|
763
767
|
|
764
|
-
ol[class="roman"] > li
|
768
|
+
ol[class="roman"] > li::before {
|
765
769
|
left: -2.0em; }
|
766
770
|
|
767
|
-
ol[class="roman_upper"] > li
|
771
|
+
ol[class="roman_upper"] > li::before {
|
768
772
|
left: -2.3em; }
|
769
773
|
|
770
|
-
ol[class="alphabet"] > li
|
774
|
+
ol[class="alphabet"] > li::before {
|
771
775
|
counter-increment: alphabet;
|
772
776
|
content: counter(alphabet, lower-alpha) ") "; }
|
773
777
|
|
774
|
-
ol[class="arabic"] > li
|
778
|
+
ol[class="arabic"] > li::before {
|
775
779
|
counter-increment: arabic;
|
776
780
|
content: counter(arabic, decimal) ") "; }
|
777
781
|
|
778
|
-
ol[class="roman"] > li
|
782
|
+
ol[class="roman"] > li::before {
|
779
783
|
counter-increment: roman;
|
780
784
|
content: counter(roman, lower-roman) ") "; }
|
781
785
|
|
782
|
-
ol[class="alphabet_upper"] > li
|
786
|
+
ol[class="alphabet_upper"] > li::before {
|
783
787
|
counter-increment: alphabet_upper;
|
784
788
|
content: counter(alphabet_upper, upper-alpha) ") "; }
|
785
789
|
|
786
|
-
ol[class="roman_upper"] > li
|
790
|
+
ol[class="roman_upper"] > li::before {
|
787
791
|
counter-increment: roman_upper;
|
788
792
|
content: counter(roman_upper, upper-roman) ") "; }
|
789
793
|
|
790
|
-
ol > li
|
794
|
+
ol > li::before {
|
791
795
|
counter-increment: alphabet;
|
792
796
|
content: counter(alphabet, lower-alpha) ") "; }
|
793
797
|
|
794
|
-
ol[class="alphabet"] ol[class="alphabet"] > li
|
798
|
+
ol[class="alphabet"] ol[class="alphabet"] > li::before {
|
795
799
|
counter-increment: alphabet2;
|
796
800
|
content: counter(alphabet2, lower-alpha) ") "; }
|
797
801
|
|
798
|
-
ol[class="arabic"] ol[class="arabic"] > li
|
802
|
+
ol[class="arabic"] ol[class="arabic"] > li::before {
|
799
803
|
counter-increment: arabic2;
|
800
804
|
content: counter(arabic2, decimal) ") "; }
|
801
805
|
|
802
|
-
ol[class="roman"] ol[class="roman"] > li
|
806
|
+
ol[class="roman"] ol[class="roman"] > li::before {
|
803
807
|
counter-increment: roman2;
|
804
808
|
content: counter(roman2, lower-roman) ") "; }
|
805
809
|
|
806
|
-
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li
|
810
|
+
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li::before {
|
807
811
|
counter-increment: alphabet_upper2;
|
808
812
|
content: counter(alphabet_upper2, upper-alpha) ") "; }
|
809
813
|
|
810
|
-
ol[class="roman_upper"] ol[class="roman_upper"] > li
|
814
|
+
ol[class="roman_upper"] ol[class="roman_upper"] > li::before {
|
811
815
|
counter-increment: roman_upper2;
|
812
816
|
content: counter(roman_upper2, upper-roman) ") "; }
|
813
817
|
|
@@ -994,7 +998,7 @@ ol.footnotes-list:first-child {
|
|
994
998
|
ol.footnotes-list p, aside.footnote p {
|
995
999
|
display: inline; }
|
996
1000
|
|
997
|
-
ol > li > p
|
1001
|
+
ol > li > p::before {
|
998
1002
|
content: "";
|
999
1003
|
display: none; }
|
1000
1004
|
|
@@ -161,7 +161,7 @@ h2 p, .h2 p {
|
|
161
161
|
list-style: none;
|
162
162
|
}
|
163
163
|
|
164
|
-
ul > li > p:first-child
|
164
|
+
ul > li > p:first-child::before {
|
165
165
|
content: "\2014";
|
166
166
|
display: inline-block;
|
167
167
|
width: 1em;
|
@@ -176,7 +176,7 @@ ul > li > p:first-child:before {
|
|
176
176
|
}
|
177
177
|
|
178
178
|
|
179
|
-
#toc li
|
179
|
+
#toc li::before {
|
180
180
|
content: " ";
|
181
181
|
display: none;
|
182
182
|
}
|
@@ -450,57 +450,57 @@ ol > li {
|
|
450
450
|
list-style: none;
|
451
451
|
position: relative;
|
452
452
|
}
|
453
|
-
ol > li
|
453
|
+
ol > li::before {
|
454
454
|
position: absolute;
|
455
455
|
left: -1.4em;
|
456
456
|
}
|
457
|
-
ol[class="roman"] > li
|
457
|
+
ol[class="roman"] > li::before {
|
458
458
|
left: -2.0em;
|
459
459
|
}
|
460
|
-
ol[class="roman_upper"] > li
|
460
|
+
ol[class="roman_upper"] > li::before {
|
461
461
|
left: -2.3em;
|
462
462
|
}
|
463
|
-
ol[class="alphabet"] > li
|
463
|
+
ol[class="alphabet"] > li::before {
|
464
464
|
counter-increment: alphabet;
|
465
465
|
content: counter(alphabet, lower-alpha)") "
|
466
466
|
}
|
467
|
-
ol[class="arabic"] > li
|
467
|
+
ol[class="arabic"] > li::before {
|
468
468
|
counter-increment: arabic;
|
469
469
|
content: counter(arabic, decimal)") "
|
470
470
|
}
|
471
|
-
ol[class="roman"] > li
|
471
|
+
ol[class="roman"] > li::before {
|
472
472
|
counter-increment: roman;
|
473
473
|
content: counter(roman, lower-roman)") "
|
474
474
|
}
|
475
|
-
ol[class="alphabet_upper"] > li
|
475
|
+
ol[class="alphabet_upper"] > li::before {
|
476
476
|
counter-increment: alphabet_upper;
|
477
477
|
content: counter(alphabet_upper, upper-alpha)") "
|
478
478
|
}
|
479
|
-
ol[class="roman_upper"] > li
|
479
|
+
ol[class="roman_upper"] > li::before {
|
480
480
|
counter-increment: roman_upper;
|
481
481
|
content: counter(roman_upper, upper-roman)") "
|
482
482
|
}
|
483
|
-
ol > li
|
483
|
+
ol > li::before {
|
484
484
|
counter-increment: alphabet;
|
485
485
|
content: counter(alphabet, lower-alpha)") "
|
486
486
|
}
|
487
|
-
ol[class="alphabet"] ol[class="alphabet"] > li
|
487
|
+
ol[class="alphabet"] ol[class="alphabet"] > li::before {
|
488
488
|
counter-increment: alphabet2;
|
489
489
|
content: counter(alphabet2, lower-alpha)") "
|
490
490
|
}
|
491
|
-
ol[class="arabic"] ol[class="arabic"] > li
|
491
|
+
ol[class="arabic"] ol[class="arabic"] > li::before {
|
492
492
|
counter-increment: arabic2;
|
493
493
|
content: counter(arabic2, decimal)") "
|
494
494
|
}
|
495
|
-
ol[class="roman"] ol[class="roman"] > li
|
495
|
+
ol[class="roman"] ol[class="roman"] > li::before {
|
496
496
|
counter-increment: roman2;
|
497
497
|
content: counter(roman2, lower-roman)") "
|
498
498
|
}
|
499
|
-
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li
|
499
|
+
ol[class="alphabet_upper"] ol[class="alphabet_upper"] > li::before {
|
500
500
|
counter-increment: alphabet_upper2;
|
501
501
|
content: counter(alphabet_upper2, upper-alpha)") "
|
502
502
|
}
|
503
|
-
ol[class="roman_upper"] ol[class="roman_upper"] > li
|
503
|
+
ol[class="roman_upper"] ol[class="roman_upper"] > li::before {
|
504
504
|
counter-increment: roman_upper2;
|
505
505
|
content: counter(roman_upper2, upper-roman)") "
|
506
506
|
}
|
@@ -672,7 +672,7 @@ ol.footnotes-list p, aside.footnote p {
|
|
672
672
|
display: inline;
|
673
673
|
}
|
674
674
|
|
675
|
-
ol > li > p
|
675
|
+
ol > li > p::before {
|
676
676
|
content: "";
|
677
677
|
display: none;
|
678
678
|
}
|
data/lib/isodoc/iec/i18n-en.yaml
CHANGED
@@ -6,6 +6,9 @@ formula: Equation
|
|
6
6
|
inequality: Inequality
|
7
7
|
section_iev: Section
|
8
8
|
price-code: Price Code
|
9
|
+
title: Title
|
10
|
+
proposed_stability_date: PROPOSED STABILITY DATE
|
11
|
+
tc_sc_note: Note from TC/SC officers
|
9
12
|
term_def_boilerplate: |
|
10
13
|
<p>ISO and IEC maintain terminological databases for use in
|
11
14
|
standardization at the following addresses:</p>
|
data/lib/isodoc/iec/i18n-fr.yaml
CHANGED
@@ -6,6 +6,9 @@ inequality: Inégalité
|
|
6
6
|
IEC: COMMISSION ELECTROTECHNIQUE INTERNATIONALE
|
7
7
|
section_iev: Section
|
8
8
|
price-code: Code prix
|
9
|
+
title: Titre
|
10
|
+
proposed_stability_date: DATE DE STABILITÉ PROPOSÉE
|
11
|
+
tc_sc_note: Note des officiers TC/SC
|
9
12
|
term_def_boilerplate: |
|
10
13
|
<p>L'ISO et l'IEC tiennent à jour des bases de données terminologiques
|
11
14
|
destinées à être utilisées en normalisation, consultables aux adresses
|
@@ -814,7 +814,13 @@
|
|
814
814
|
<fo:block-container background-color="rgb(219, 229, 241)" margin-top="4mm" padding="2mm" padding-top="1mm" border="1.5pt solid white">
|
815
815
|
<fo:block font-size="6.5pt" margin-bottom="6pt">
|
816
816
|
<xsl:call-template name="addLetterSpacingSmallCaps">
|
817
|
-
<xsl:with-param name="text">
|
817
|
+
<xsl:with-param name="text">
|
818
|
+
<!-- Title: -->
|
819
|
+
<xsl:call-template name="getLocalizedString">
|
820
|
+
<xsl:with-param name="key">title</xsl:with-param>
|
821
|
+
</xsl:call-template>
|
822
|
+
<xsl:text>:</xsl:text>
|
823
|
+
</xsl:with-param>
|
818
824
|
</xsl:call-template>
|
819
825
|
</fo:block>
|
820
826
|
<fo:block font-size="9pt" font-weight="bold">
|
@@ -829,7 +835,11 @@
|
|
829
835
|
<fo:block font-size="6.5pt">
|
830
836
|
<xsl:call-template name="addLetterSpacing">
|
831
837
|
<xsl:with-param name="text">
|
832
|
-
|
838
|
+
<!-- PROPOSED STABILITY DATE: -->
|
839
|
+
<xsl:call-template name="getLocalizedString">
|
840
|
+
<xsl:with-param name="key">proposed_stability_date</xsl:with-param>
|
841
|
+
</xsl:call-template>
|
842
|
+
<xsl:text>: </xsl:text>
|
833
843
|
</xsl:with-param>
|
834
844
|
</xsl:call-template>
|
835
845
|
<!-- 2023 -->
|
@@ -841,7 +851,13 @@
|
|
841
851
|
<fo:block-container border="1.5 solid" border-color="rgb(221, 213, 213)" padding="1mm" margin-top="3mm">
|
842
852
|
<fo:block font-size="6.5pt" margin-bottom="6pt">
|
843
853
|
<xsl:call-template name="addLetterSpacingSmallCaps">
|
844
|
-
<xsl:with-param name="text">
|
854
|
+
<xsl:with-param name="text">
|
855
|
+
<!-- Note from TC/SC officers: -->
|
856
|
+
<xsl:call-template name="getLocalizedString">
|
857
|
+
<xsl:with-param name="key">tc_sc_note</xsl:with-param>
|
858
|
+
</xsl:call-template>
|
859
|
+
<xsl:text>:</xsl:text>
|
860
|
+
</xsl:with-param>
|
845
861
|
</xsl:call-template>
|
846
862
|
</fo:block>
|
847
863
|
<!-- Example: This FDIS is the result of the discussion between the IEC SC21A experts WG 3 during the meeting held in -->
|
@@ -1334,10 +1350,13 @@
|
|
1334
1350
|
<fo:block break-after="page"/>
|
1335
1351
|
</xsl:template>
|
1336
1352
|
|
1337
|
-
<xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/iec:p[starts-with(@class, 'zzSTDTitle')]" priority="
|
1353
|
+
<xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/iec:p[starts-with(@class, 'zzSTDTitle')]" priority="4">
|
1338
1354
|
<fo:block-container font-size="12pt" text-align="center">
|
1339
1355
|
<xsl:if test="following-sibling::*[1][not(self::iec:p[starts-with(@class, 'zzSTDTitle')])]">
|
1340
1356
|
<xsl:attribute name="margin-bottom">18pt</xsl:attribute>
|
1357
|
+
<xsl:if test="ancestor::*[local-name() = 'sections']">
|
1358
|
+
<xsl:attribute name="margin-bottom">30pt</xsl:attribute>
|
1359
|
+
</xsl:if>
|
1341
1360
|
</xsl:if>
|
1342
1361
|
<fo:block>
|
1343
1362
|
<xsl:if test="iec:strong"> <!-- title -->
|
@@ -1348,6 +1367,10 @@
|
|
1348
1367
|
</fo:block-container>
|
1349
1368
|
</xsl:template>
|
1350
1369
|
|
1370
|
+
<xsl:template match="*[local-name() = 'sections']/iec:p[@class = 'zzSTDTitle1']//text()" priority="4">
|
1371
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
|
1372
|
+
</xsl:template>
|
1373
|
+
|
1351
1374
|
<xsl:template name="insertPrefacepages">
|
1352
1375
|
<xsl:param name="lang" select="$lang"/>
|
1353
1376
|
<fo:block break-after="page"/>
|
@@ -1392,17 +1415,17 @@
|
|
1392
1415
|
<xsl:call-template name="insertHeaderFooter"/>
|
1393
1416
|
<fo:flow flow-name="xsl-region-body">
|
1394
1417
|
|
1395
|
-
<fo:block-container font-size="12pt" text-align="center" margin-bottom="36pt">
|
1396
|
-
|
1397
|
-
<fo:block font-weight="bold" role="H1">
|
1398
|
-
|
1418
|
+
<!-- <fo:block-container font-size="12pt" text-align="center" margin-bottom="36pt">
|
1419
|
+
|
1420
|
+
<fo:block font-weight="bold" role="H1">
|
1421
|
+
|
1399
1422
|
<xsl:call-template name="printTitles">
|
1400
1423
|
<xsl:with-param name="lang" select="$lang"/>
|
1401
1424
|
</xsl:call-template>
|
1402
|
-
|
1403
|
-
<fo:block
|
1425
|
+
|
1426
|
+
<fo:block> </fo:block>
|
1404
1427
|
</fo:block>
|
1405
|
-
</fo:block-container>
|
1428
|
+
</fo:block-container> -->
|
1406
1429
|
|
1407
1430
|
<!-- Main sections -->
|
1408
1431
|
<fo:block>
|
@@ -2220,19 +2243,32 @@
|
|
2220
2243
|
<xsl:variable name="titles_">
|
2221
2244
|
|
2222
2245
|
<!-- These titles of Table of contents renders different than determined in localized-strings -->
|
2223
|
-
<title-toc lang="en">
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2246
|
+
<!-- <title-toc lang="en">
|
2247
|
+
<xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
|
2248
|
+
<xsl:text>Contents</xsl:text>
|
2249
|
+
</xsl:if>
|
2250
|
+
<xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
|
2251
|
+
<xsl:text>Table of Contents</xsl:text>
|
2252
|
+
</xsl:if>
|
2253
|
+
<xsl:if test="$namespace = 'gb'">
|
2254
|
+
<xsl:text>Table of contents</xsl:text>
|
2255
|
+
</xsl:if>
|
2256
|
+
</title-toc> -->
|
2257
|
+
<title-toc lang="en">Table of contents</title-toc>
|
2258
|
+
<!-- <title-toc lang="fr">
|
2227
2259
|
<xsl:text>Sommaire</xsl:text>
|
2228
|
-
</title-toc>
|
2229
|
-
<title-toc lang="zh">
|
2230
|
-
|
2260
|
+
</title-toc> -->
|
2261
|
+
<!-- <title-toc lang="zh">
|
2262
|
+
<xsl:choose>
|
2263
|
+
<xsl:when test="$namespace = 'gb'">
|
2264
|
+
<xsl:text>目次</xsl:text>
|
2265
|
+
</xsl:when>
|
2266
|
+
<xsl:otherwise>
|
2231
2267
|
<xsl:text>Contents</xsl:text>
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
<title-
|
2268
|
+
</xsl:otherwise>
|
2269
|
+
</xsl:choose>
|
2270
|
+
</title-toc> -->
|
2271
|
+
<title-toc lang="zh">目次</title-toc>
|
2236
2272
|
|
2237
2273
|
<title-part lang="en">
|
2238
2274
|
|
@@ -2254,20 +2290,6 @@
|
|
2254
2290
|
<title-subpart lang="en">Sub-part #</title-subpart>
|
2255
2291
|
<title-subpart lang="fr">Partie de sub #</title-subpart>
|
2256
2292
|
|
2257
|
-
<title-list-tables lang="en">List of Tables</title-list-tables>
|
2258
|
-
|
2259
|
-
<title-list-figures lang="en">List of Figures</title-list-figures>
|
2260
|
-
|
2261
|
-
<title-table-figures lang="en">Table of Figures</title-table-figures>
|
2262
|
-
|
2263
|
-
<title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
|
2264
|
-
|
2265
|
-
<title-summary lang="en">Summary</title-summary>
|
2266
|
-
|
2267
|
-
<title-continued lang="ru">(продолжение)</title-continued>
|
2268
|
-
<title-continued lang="en">(continued)</title-continued>
|
2269
|
-
<title-continued lang="fr">(continué)</title-continued>
|
2270
|
-
|
2271
2293
|
</xsl:variable>
|
2272
2294
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
2273
2295
|
|
@@ -2275,8 +2297,8 @@
|
|
2275
2297
|
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
2276
2298
|
<xsl:value-of select="$toc_table_title"/>
|
2277
2299
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
2278
|
-
<xsl:call-template name="
|
2279
|
-
<xsl:with-param name="
|
2300
|
+
<xsl:call-template name="getLocalizedString">
|
2301
|
+
<xsl:with-param name="key">toc_tables</xsl:with-param>
|
2280
2302
|
</xsl:call-template>
|
2281
2303
|
</xsl:if>
|
2282
2304
|
</xsl:variable>
|
@@ -2285,8 +2307,8 @@
|
|
2285
2307
|
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
2286
2308
|
<xsl:value-of select="$toc_figure_title"/>
|
2287
2309
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
2288
|
-
<xsl:call-template name="
|
2289
|
-
<xsl:with-param name="
|
2310
|
+
<xsl:call-template name="getLocalizedString">
|
2311
|
+
<xsl:with-param name="key">toc_figures</xsl:with-param>
|
2290
2312
|
</xsl:call-template>
|
2291
2313
|
</xsl:if>
|
2292
2314
|
</xsl:variable>
|
@@ -2295,8 +2317,8 @@
|
|
2295
2317
|
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
2296
2318
|
<xsl:value-of select="$toc_requirement_title"/>
|
2297
2319
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
2298
|
-
<xsl:call-template name="
|
2299
|
-
<xsl:with-param name="
|
2320
|
+
<xsl:call-template name="getLocalizedString">
|
2321
|
+
<xsl:with-param name="key">toc_recommendations</xsl:with-param>
|
2300
2322
|
</xsl:call-template>
|
2301
2323
|
</xsl:if>
|
2302
2324
|
</xsl:variable>
|
@@ -4815,13 +4837,13 @@
|
|
4815
4837
|
<fo:table-body>
|
4816
4838
|
|
4817
4839
|
<xsl:variable name="title_continued_">
|
4818
|
-
<xsl:call-template name="
|
4819
|
-
<xsl:with-param name="
|
4840
|
+
<xsl:call-template name="getLocalizedString">
|
4841
|
+
<xsl:with-param name="key">continued</xsl:with-param>
|
4820
4842
|
</xsl:call-template>
|
4821
4843
|
</xsl:variable>
|
4822
|
-
|
4844
|
+
<xsl:variable name="title_continued_in_parenthesis" select="concat('(',$title_continued_,')')"/>
|
4823
4845
|
<xsl:variable name="title_continued">
|
4824
|
-
<xsl:value-of select="$
|
4846
|
+
<xsl:value-of select="$title_continued_in_parenthesis"/>
|
4825
4847
|
|
4826
4848
|
</xsl:variable>
|
4827
4849
|
|
@@ -6146,6 +6168,9 @@
|
|
6146
6168
|
<!-- END Definition List -->
|
6147
6169
|
<!-- ===================== -->
|
6148
6170
|
|
6171
|
+
<!-- default: ignore title in sections/p -->
|
6172
|
+
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
|
6173
|
+
|
6149
6174
|
<!-- ========================= -->
|
6150
6175
|
<!-- Rich text formatting -->
|
6151
6176
|
<!-- ========================= -->
|
@@ -6223,7 +6248,7 @@
|
|
6223
6248
|
<xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
|
6224
6249
|
<xsl:template match="*[local-name()='tt']/text()" priority="2">
|
6225
6250
|
<xsl:choose>
|
6226
|
-
<xsl:when test="java:replaceAll(java:java.lang.String.new(.),
|
6251
|
+
<xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
|
6227
6252
|
<!-- url -->
|
6228
6253
|
<xsl:call-template name="add-zero-spaces-link-java"/>
|
6229
6254
|
</xsl:when>
|
@@ -6756,10 +6781,13 @@
|
|
6756
6781
|
</xsl:choose>
|
6757
6782
|
</xsl:variable>
|
6758
6783
|
|
6784
|
+
<!-- replace sequence #x200B to one ​ -->
|
6785
|
+
<xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '')"/>
|
6786
|
+
|
6759
6787
|
<!-- replace sequence #x200B and space TO space -->
|
6760
|
-
<xsl:variable name="
|
6788
|
+
<xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
|
6761
6789
|
|
6762
|
-
<xsl:value-of select="$
|
6790
|
+
<xsl:value-of select="$text11"/>
|
6763
6791
|
</xsl:template>
|
6764
6792
|
|
6765
6793
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -6769,8 +6797,12 @@
|
|
6769
6797
|
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
6770
6798
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
|
6771
6799
|
<xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1')"/>
|
6800
|
+
|
6801
|
+
<!-- replace sequence #x200B to one ​ -->
|
6802
|
+
<xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '')"/>
|
6803
|
+
|
6772
6804
|
<!-- remove zero-width space at the end -->
|
6773
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($
|
6805
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '$', '')"/>
|
6774
6806
|
</xsl:template>
|
6775
6807
|
|
6776
6808
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -8033,7 +8065,7 @@
|
|
8033
8065
|
|
8034
8066
|
<xsl:call-template name="refine_note_block_style"/>
|
8035
8067
|
|
8036
|
-
<fo:inline xsl:use-attribute-sets="note-name-style">
|
8068
|
+
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
|
8037
8069
|
|
8038
8070
|
<xsl:call-template name="refine_note-name-style"/>
|
8039
8071
|
|
@@ -8070,12 +8102,12 @@
|
|
8070
8102
|
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
8071
8103
|
<xsl:choose>
|
8072
8104
|
<xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
|
8073
|
-
<fo:inline xsl:use-attribute-sets="note-p-style">
|
8105
|
+
<fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
|
8074
8106
|
<xsl:apply-templates/>
|
8075
8107
|
</fo:inline>
|
8076
8108
|
</xsl:when>
|
8077
8109
|
<xsl:otherwise>
|
8078
|
-
<fo:block xsl:use-attribute-sets="note-p-style">
|
8110
|
+
<fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
|
8079
8111
|
<xsl:apply-templates/>
|
8080
8112
|
</fo:block>
|
8081
8113
|
</xsl:otherwise>
|
@@ -8294,25 +8326,45 @@
|
|
8294
8326
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
8295
8327
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
8296
8328
|
|
8297
|
-
<xsl:
|
8298
|
-
<xsl:
|
8299
|
-
<xsl:
|
8300
|
-
|
8301
|
-
|
8302
|
-
</xsl:variable>
|
8329
|
+
<xsl:if test="@width != '' and @width != 'auto'">
|
8330
|
+
<xsl:attribute name="width">
|
8331
|
+
<xsl:value-of select="@width"/>
|
8332
|
+
</xsl:attribute>
|
8333
|
+
</xsl:if>
|
8303
8334
|
|
8304
|
-
<xsl:
|
8335
|
+
<xsl:if test="@height != '' and @height != 'auto'">
|
8336
|
+
<xsl:attribute name="height">
|
8337
|
+
<xsl:value-of select="@height"/>
|
8338
|
+
</xsl:attribute>
|
8339
|
+
</xsl:if>
|
8305
8340
|
|
8306
|
-
|
8341
|
+
<xsl:choose>
|
8342
|
+
<xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
|
8343
|
+
<xsl:attribute name="scaling">non-uniform</xsl:attribute>
|
8344
|
+
</xsl:when>
|
8345
|
+
<xsl:otherwise>
|
8307
8346
|
|
8308
|
-
|
8347
|
+
<xsl:variable name="img_src">
|
8348
|
+
<xsl:choose>
|
8349
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
8350
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8351
|
+
</xsl:choose>
|
8352
|
+
</xsl:variable>
|
8309
8353
|
|
8310
|
-
|
8311
|
-
<xsl:if test="number($scale) < 100">
|
8354
|
+
<xsl:variable name="image_width_effective">
|
8312
8355
|
|
8313
|
-
|
8356
|
+
<xsl:value-of select="$width_effective"/>
|
8314
8357
|
|
8315
|
-
|
8358
|
+
</xsl:variable>
|
8359
|
+
|
8360
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
8361
|
+
<xsl:if test="number($scale) < 100">
|
8362
|
+
|
8363
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
8364
|
+
|
8365
|
+
</xsl:if>
|
8366
|
+
</xsl:otherwise>
|
8367
|
+
</xsl:choose>
|
8316
8368
|
|
8317
8369
|
</xsl:if>
|
8318
8370
|
|
@@ -11989,7 +12041,7 @@
|
|
11989
12041
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
11990
12042
|
<xsl:apply-templates mode="update_xml_step1"/>
|
11991
12043
|
</xsl:template>
|
11992
|
-
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
12044
|
+
<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">
|
11993
12045
|
<xsl:copy>
|
11994
12046
|
<xsl:copy-of select="@*"/>
|
11995
12047
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -0,0 +1,185 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module Iec
|
3
|
+
class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
|
4
|
+
def termclause1(elem)
|
5
|
+
@is_iev or return clause1(elem)
|
6
|
+
@suppressheadingnumbers || elem["unnumbered"] and return
|
7
|
+
lbl = @xrefs.anchor(elem["id"], :label, true) or return
|
8
|
+
prefix_name(elem, " ", "#{lbl}#{clausedelim}", "title")
|
9
|
+
end
|
10
|
+
|
11
|
+
def concept(docxml)
|
12
|
+
@is_iev and concept_iev(docxml)
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
def concept_iev(docxml)
|
17
|
+
labels = @xrefs.get_anchors.each_with_object({}) do |(k, v), m|
|
18
|
+
m[v[:label]] = k
|
19
|
+
end
|
20
|
+
docpart = docxml&.at(ns("//bibdata/ext/structuredidentifier/" \
|
21
|
+
"project-number/@part"))&.text or return
|
22
|
+
docxml.xpath(ns("//termref[@base = 'IEV']")).each do |t|
|
23
|
+
concept_iev1(t, docpart, labels)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def concept_iev1(termref, docpart, labels)
|
28
|
+
/^#{docpart}-/.match?(termref["target"]) or return
|
29
|
+
newtarget = labels[termref["target"]] or return
|
30
|
+
termref.name = "xref"
|
31
|
+
termref.delete("base")
|
32
|
+
termref["target"] = newtarget
|
33
|
+
end
|
34
|
+
|
35
|
+
def terms(docxml)
|
36
|
+
otherlang_designations(docxml)
|
37
|
+
super
|
38
|
+
merge_fr_into_en_term(docxml)
|
39
|
+
end
|
40
|
+
|
41
|
+
def merge_fr_into_en_term(docxml)
|
42
|
+
@is_iev or return
|
43
|
+
docxml.xpath(ns("//term[@language = 'en'][@tag]")).each do |en|
|
44
|
+
fr = docxml.at(ns("//term[@language = 'fr'][@tag = '#{en['tag']}']"))
|
45
|
+
merge_fr_into_en_term1(en, fr) if fr
|
46
|
+
end
|
47
|
+
@xrefs.parse_inclusions(clauses: true).parse docxml
|
48
|
+
docxml.xpath(ns("//term/name")).each(&:remove)
|
49
|
+
term(docxml)
|
50
|
+
end
|
51
|
+
|
52
|
+
def merge_fr_into_en_term1(en_term, fr_term)
|
53
|
+
dl = en_term&.at(ns("./dl[@type = 'other-lang']"))&.remove
|
54
|
+
en_term << fr_term.remove.children
|
55
|
+
en_term << dl if dl
|
56
|
+
en_term["language"] = "en,fr"
|
57
|
+
en_term.delete("tag")
|
58
|
+
end
|
59
|
+
|
60
|
+
def otherlang_designations(docxml)
|
61
|
+
@is_iev or return
|
62
|
+
docxml.xpath(ns("//term")).each do |t|
|
63
|
+
otherlang_designations1(t, t["language"]&.split(",") || %w(en fr))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def extract_otherlang_designations(term, lgs)
|
68
|
+
term.xpath(ns(".//preferred/expression[@language]"))
|
69
|
+
.each_with_object([]) do |d, m|
|
70
|
+
lg = d["language"]
|
71
|
+
d.delete("language")
|
72
|
+
next if lgs.include?(lg)
|
73
|
+
|
74
|
+
p = d.parent
|
75
|
+
designation_annotate(p, d.at(ns("./name")))
|
76
|
+
m << { lang: lg, script: Metanorma::Utils.default_script(lg),
|
77
|
+
designation: to_xml(l10n_recursive(p.remove, lg)).strip }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def l10n_recursive(xml, lang)
|
82
|
+
script = Metanorma::Utils.default_script(lang)
|
83
|
+
c = HTMLEntities.new
|
84
|
+
xml.traverse do |x|
|
85
|
+
x.text? or next
|
86
|
+
text = c.encode(c.decode(x.text), :hexadecimal)
|
87
|
+
x.replace(cleanup_entities(l10n(text, lang, script), is_xml: false))
|
88
|
+
end
|
89
|
+
xml
|
90
|
+
end
|
91
|
+
|
92
|
+
def merge_otherlang_designations(desgn)
|
93
|
+
h = desgn.each_with_object({}) do |e, m|
|
94
|
+
if m[e[:lang]]
|
95
|
+
m[e[:lang]][:designation] += e[:designation]
|
96
|
+
else m[e[:lang]] = e
|
97
|
+
end
|
98
|
+
end
|
99
|
+
h.keys.sort.each_with_object([]) { |k, m| m << h[k] }
|
100
|
+
end
|
101
|
+
|
102
|
+
def otherlang_designations1(term, lgs)
|
103
|
+
pr = merge_otherlang_designations(
|
104
|
+
extract_otherlang_designations(term, lgs),
|
105
|
+
)
|
106
|
+
pr.empty? and return
|
107
|
+
prefs = pr.map do |p|
|
108
|
+
"<dt>#{p[:lang]}</dt>" \
|
109
|
+
"<dd language='#{p[:lang]}' script='#{p[:script]}'>" \
|
110
|
+
"#{cleanup_entities(p[:designation])}</dd>"
|
111
|
+
end
|
112
|
+
term << "<dl type='other-lang'>#{prefs.join}</dl>"
|
113
|
+
end
|
114
|
+
|
115
|
+
def related(docxml)
|
116
|
+
docxml.xpath(ns("//term[related]")).each { |f| move_related(f) }
|
117
|
+
super
|
118
|
+
end
|
119
|
+
|
120
|
+
def move_related(term)
|
121
|
+
defn = term.at(ns("./definition")) or return
|
122
|
+
term.xpath(ns("./related")).reverse.each do |r|
|
123
|
+
defn.next = r.remove
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def related1(node)
|
128
|
+
lg = node&.at("./ancestor::xmlns:term/@language")&.text
|
129
|
+
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
130
|
+
p = node.at(ns("./preferred"))
|
131
|
+
ref = node.at(ns("./xref | ./eref | ./termref"))
|
132
|
+
label = @i18n.relatedterms[node["type"]].upcase
|
133
|
+
node.replace(l10n("<p>#{label}: " \
|
134
|
+
"#{to_xml(p.children)} (#{to_xml(ref)})</p>"))
|
135
|
+
@i18n = @i18n_lg["default"]
|
136
|
+
end
|
137
|
+
|
138
|
+
def termsource_modification(node)
|
139
|
+
lg = node&.at("./ancestor::xmlns:term/@language")&.text
|
140
|
+
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
141
|
+
super
|
142
|
+
@i18n = @i18n_lg["default"]
|
143
|
+
end
|
144
|
+
|
145
|
+
def termsource1(node)
|
146
|
+
lg = node&.at("./ancestor::xmlns:term/@language")&.text
|
147
|
+
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
148
|
+
if @is_iev then termsource1_iev(node)
|
149
|
+
else super
|
150
|
+
end
|
151
|
+
@i18n = @i18n_lg["default"]
|
152
|
+
end
|
153
|
+
|
154
|
+
def termsource1_iev(elem)
|
155
|
+
while elem&.next_element&.name == "termsource"
|
156
|
+
elem << "; #{to_xml(elem.next_element.remove.children)}"
|
157
|
+
end
|
158
|
+
elem.children = l10n("#{@i18n.source}: #{to_xml(elem.children).strip}")
|
159
|
+
end
|
160
|
+
|
161
|
+
def termexample(docxml)
|
162
|
+
docxml.xpath(ns("//termexample")).each do |f|
|
163
|
+
termexample1(f)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
def termexample1(elem)
|
168
|
+
lg = elem&.at("./ancestor::xmlns:term/@language")&.text
|
169
|
+
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
170
|
+
example1(elem)
|
171
|
+
@i18n = @i18n_lg["default"]
|
172
|
+
end
|
173
|
+
|
174
|
+
def termnote1(elem)
|
175
|
+
lg = elem&.at("./ancestor::xmlns:term/@language")&.text
|
176
|
+
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
177
|
+
|
178
|
+
val = @xrefs.anchor(elem["id"], :value) || "???"
|
179
|
+
lbl = @i18n.termnote.gsub("%", val)
|
180
|
+
prefix_name(elem, "", lower2cap(lbl), "name")
|
181
|
+
@i18n = @i18n_lg["default"]
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative "init"
|
2
2
|
require "isodoc"
|
3
3
|
require_relative "../../relaton/render-iec/general"
|
4
|
+
require_relative "presentation_terms"
|
4
5
|
|
5
6
|
module IsoDoc
|
6
7
|
module Iec
|
@@ -27,13 +28,6 @@ module IsoDoc
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
|
-
def termclause1(elem)
|
31
|
-
@is_iev or return clause1(elem)
|
32
|
-
@suppressheadingnumbers || elem["unnumbered"] and return
|
33
|
-
lbl = @xrefs.anchor(elem["id"], :label, true) or return
|
34
|
-
prefix_name(elem, " ", "#{lbl}#{clausedelim}", "title")
|
35
|
-
end
|
36
|
-
|
37
31
|
def clause1(elem)
|
38
32
|
IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self)
|
39
33
|
.call(elem)
|
@@ -56,179 +50,6 @@ module IsoDoc
|
|
56
50
|
end
|
57
51
|
end
|
58
52
|
|
59
|
-
def concept(docxml)
|
60
|
-
@is_iev and concept_iev(docxml)
|
61
|
-
super
|
62
|
-
end
|
63
|
-
|
64
|
-
def concept_iev(docxml)
|
65
|
-
labels = @xrefs.get_anchors.each_with_object({}) do |(k, v), m|
|
66
|
-
m[v[:label]] = k
|
67
|
-
end
|
68
|
-
docpart = docxml&.at(ns("//bibdata/ext/structuredidentifier/" \
|
69
|
-
"project-number/@part"))&.text or return
|
70
|
-
docxml.xpath(ns("//termref[@base = 'IEV']")).each do |t|
|
71
|
-
concept_iev1(t, docpart, labels)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def concept_iev1(termref, docpart, labels)
|
76
|
-
/^#{docpart}-/.match?(termref["target"]) or return
|
77
|
-
newtarget = labels[termref["target"]] or return
|
78
|
-
termref.name = "xref"
|
79
|
-
termref.delete("base")
|
80
|
-
termref["target"] = newtarget
|
81
|
-
end
|
82
|
-
|
83
|
-
def terms(docxml)
|
84
|
-
otherlang_designations(docxml)
|
85
|
-
super
|
86
|
-
merge_fr_into_en_term(docxml)
|
87
|
-
end
|
88
|
-
|
89
|
-
def merge_fr_into_en_term(docxml)
|
90
|
-
@is_iev or return
|
91
|
-
docxml.xpath(ns("//term[@language = 'en'][@tag]")).each do |en|
|
92
|
-
fr = docxml.at(ns("//term[@language = 'fr'][@tag = '#{en['tag']}']"))
|
93
|
-
merge_fr_into_en_term1(en, fr) if fr
|
94
|
-
end
|
95
|
-
@xrefs.parse_inclusions(clauses: true).parse docxml
|
96
|
-
docxml.xpath(ns("//term/name")).each(&:remove)
|
97
|
-
term(docxml)
|
98
|
-
end
|
99
|
-
|
100
|
-
def merge_fr_into_en_term1(en_term, fr_term)
|
101
|
-
dl = en_term&.at(ns("./dl[@type = 'other-lang']"))&.remove
|
102
|
-
en_term << fr_term.remove.children
|
103
|
-
en_term << dl if dl
|
104
|
-
en_term["language"] = "en,fr"
|
105
|
-
en_term.delete("tag")
|
106
|
-
end
|
107
|
-
|
108
|
-
def otherlang_designations(docxml)
|
109
|
-
@is_iev or return
|
110
|
-
docxml.xpath(ns("//term")).each do |t|
|
111
|
-
otherlang_designations1(t, t["language"]&.split(/,/) || %w(en fr))
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
def extract_otherlang_designations(term, lgs)
|
116
|
-
term.xpath(ns(".//preferred/expression[@language]"))
|
117
|
-
.each_with_object([]) do |d, m|
|
118
|
-
lg = d["language"]
|
119
|
-
d.delete("language")
|
120
|
-
next if lgs.include?(lg)
|
121
|
-
|
122
|
-
p = d.parent
|
123
|
-
designation_annotate(p, d.at(ns("./name")))
|
124
|
-
m << { lang: lg, script: Metanorma::Utils.default_script(lg),
|
125
|
-
designation: to_xml(l10n_recursive(p.remove, lg)).strip }
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
def l10n_recursive(xml, lang)
|
130
|
-
script = Metanorma::Utils.default_script(lang)
|
131
|
-
c = HTMLEntities.new
|
132
|
-
xml.traverse do |x|
|
133
|
-
x.text? or next
|
134
|
-
text = c.encode(c.decode(x.text), :hexadecimal)
|
135
|
-
x.replace(cleanup_entities(l10n(text, lang, script), is_xml: false))
|
136
|
-
end
|
137
|
-
xml
|
138
|
-
end
|
139
|
-
|
140
|
-
def merge_otherlang_designations(desgn)
|
141
|
-
h = desgn.each_with_object({}) do |e, m|
|
142
|
-
if m[e[:lang]]
|
143
|
-
m[e[:lang]][:designation] += e[:designation]
|
144
|
-
else m[e[:lang]] = e
|
145
|
-
end
|
146
|
-
end
|
147
|
-
h.keys.sort.each_with_object([]) { |k, m| m << h[k] }
|
148
|
-
end
|
149
|
-
|
150
|
-
def otherlang_designations1(term, lgs)
|
151
|
-
pr = merge_otherlang_designations(
|
152
|
-
extract_otherlang_designations(term, lgs),
|
153
|
-
)
|
154
|
-
pr.empty? and return
|
155
|
-
prefs = pr.map do |p|
|
156
|
-
"<dt>#{p[:lang]}</dt>" \
|
157
|
-
"<dd language='#{p[:lang]}' script='#{p[:script]}'>" \
|
158
|
-
"#{cleanup_entities(p[:designation])}</dd>"
|
159
|
-
end
|
160
|
-
term << "<dl type='other-lang'>#{prefs.join}</dl>"
|
161
|
-
end
|
162
|
-
|
163
|
-
def related(docxml)
|
164
|
-
docxml.xpath(ns("//term[related]")).each { |f| move_related(f) }
|
165
|
-
super
|
166
|
-
end
|
167
|
-
|
168
|
-
def move_related(term)
|
169
|
-
defn = term.at(ns("./definition")) or return
|
170
|
-
term.xpath(ns("./related")).reverse.each do |r|
|
171
|
-
defn.next = r.remove
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
def related1(node)
|
176
|
-
lg = node&.at("./ancestor::xmlns:term/@language")&.text
|
177
|
-
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
178
|
-
p = node.at(ns("./preferred"))
|
179
|
-
ref = node.at(ns("./xref | ./eref | ./termref"))
|
180
|
-
label = @i18n.relatedterms[node["type"]].upcase
|
181
|
-
node.replace(l10n("<p>#{label}: " \
|
182
|
-
"#{to_xml(p.children)} (#{to_xml(ref)})</p>"))
|
183
|
-
@i18n = @i18n_lg["default"]
|
184
|
-
end
|
185
|
-
|
186
|
-
def termsource_modification(node)
|
187
|
-
lg = node&.at("./ancestor::xmlns:term/@language")&.text
|
188
|
-
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
189
|
-
super
|
190
|
-
@i18n = @i18n_lg["default"]
|
191
|
-
end
|
192
|
-
|
193
|
-
def termsource1(node)
|
194
|
-
lg = node&.at("./ancestor::xmlns:term/@language")&.text
|
195
|
-
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
196
|
-
if @is_iev then termsource1_iev(node)
|
197
|
-
else super
|
198
|
-
end
|
199
|
-
@i18n = @i18n_lg["default"]
|
200
|
-
end
|
201
|
-
|
202
|
-
def termsource1_iev(elem)
|
203
|
-
while elem&.next_element&.name == "termsource"
|
204
|
-
elem << "; #{to_xml(elem.next_element.remove.children)}"
|
205
|
-
end
|
206
|
-
elem.children = l10n("#{@i18n.source}: #{to_xml(elem.children).strip}")
|
207
|
-
end
|
208
|
-
|
209
|
-
def termexample(docxml)
|
210
|
-
docxml.xpath(ns("//termexample")).each do |f|
|
211
|
-
termexample1(f)
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
def termexample1(elem)
|
216
|
-
lg = elem&.at("./ancestor::xmlns:term/@language")&.text
|
217
|
-
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
218
|
-
example1(elem)
|
219
|
-
@i18n = @i18n_lg["default"]
|
220
|
-
end
|
221
|
-
|
222
|
-
def termnote1(elem)
|
223
|
-
lg = elem&.at("./ancestor::xmlns:term/@language")&.text
|
224
|
-
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
225
|
-
|
226
|
-
val = @xrefs.anchor(elem["id"], :value) || "???"
|
227
|
-
lbl = @i18n.termnote.gsub(/%/, val)
|
228
|
-
prefix_name(elem, "", lower2cap(lbl), "name")
|
229
|
-
@i18n = @i18n_lg["default"]
|
230
|
-
end
|
231
|
-
|
232
53
|
def bibrenderer
|
233
54
|
::Relaton::Render::Iec::General.new(language: @lang,
|
234
55
|
i18nhash: @i18n.get)
|
@@ -257,27 +78,30 @@ module IsoDoc
|
|
257
78
|
|
258
79
|
def insert_middle_title(docxml)
|
259
80
|
ins = docxml.at(ns("//preface/clause[@type = 'toc']")) or return
|
260
|
-
title1, title2 = middle_title_parts
|
81
|
+
title1, title2 = middle_title_parts
|
261
82
|
title2out = ""
|
262
83
|
title2 and title2out = <<~OUTPUT
|
263
84
|
<p class="zzSTDTitle1"> </p>
|
264
85
|
<p class="zzSTDTitle2"><strong>#{title2}</strong></p>
|
265
86
|
OUTPUT
|
266
87
|
ins.next = <<~OUTPUT
|
267
|
-
<pagebreak
|
268
|
-
<p class="zzSTDTitle1"
|
269
|
-
<p class="zzSTDTitle1"
|
270
|
-
<p class="zzSTDTitle1"> </p>
|
271
|
-
<p class="zzSTDTitle1"><strong>#{title1.upcase}</strong></p>#{title2out}
|
88
|
+
<pagebreak/><p class="zzSTDTitle1">#{@i18n.get['IEC']}</p>
|
89
|
+
<p class="zzSTDTitle1">____________</p><p class="zzSTDTitle1"> </p>
|
90
|
+
<p class="zzSTDTitle1"><strong>#{title1&.upcase}</strong></p>#{title2out}
|
272
91
|
<p class="zzSTDTitle1"> </p>
|
273
92
|
OUTPUT
|
274
93
|
end
|
275
94
|
|
276
|
-
def middle_title_parts
|
95
|
+
def middle_title_parts
|
277
96
|
title1 = @meta.get[:doctitlemain]&.sub(/\s+$/, "")
|
278
97
|
@meta.get[:doctitleintro] and
|
279
98
|
title1 = "#{@meta.get[:doctitleintro]} \u2014 #{title1}"
|
280
|
-
title2 = nil
|
99
|
+
title1, title2 = middle_title_part(title1, nil)
|
100
|
+
title1&.empty? and title1 = nil
|
101
|
+
[title1, title2]
|
102
|
+
end
|
103
|
+
|
104
|
+
def middle_title_part(title1, title2)
|
281
105
|
if @meta.get[:doctitlepart]
|
282
106
|
title1 += " \u2014"
|
283
107
|
title2 = @meta.get[:doctitlepart]&.sub(/\s+$/, "")
|
@@ -287,6 +111,20 @@ module IsoDoc
|
|
287
111
|
[title1, title2]
|
288
112
|
end
|
289
113
|
|
114
|
+
def middle_title(docxml)
|
115
|
+
s = docxml.at(ns("//sections")) or return
|
116
|
+
title1, title2 = middle_title_parts
|
117
|
+
title1 || title2 or return
|
118
|
+
ret = ""
|
119
|
+
title1 and ret = "<p class='zzSTDTitle1'><strong>#{title1}</strong></p>"
|
120
|
+
title2 and ret += <<~TITLE
|
121
|
+
<p class='zzSTDTitle1'> </p>
|
122
|
+
<p class='zzSTDTitle2'><strong>#{title2}</strong><p>
|
123
|
+
TITLE
|
124
|
+
ret += "<p class='zzSTDTitle1'> </p>"
|
125
|
+
s.children.first.previous = ret
|
126
|
+
end
|
127
|
+
|
290
128
|
include Init
|
291
129
|
end
|
292
130
|
end
|
@@ -202,19 +202,7 @@ module IsoDoc
|
|
202
202
|
{ class: "TableTitle", style: "text-align:center;" }
|
203
203
|
end
|
204
204
|
|
205
|
-
def para_class(node)
|
206
|
-
case node["class"]
|
207
|
-
when "zzSTDTitle1", "zzSTDTitle2" then node["class"]
|
208
|
-
else
|
209
|
-
classtype = nil
|
210
|
-
classtype = "MsoCommentText" if @in_comment
|
211
|
-
classtype = "Sourcecode" if @annotation
|
212
|
-
classtype
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
205
|
def annex_name(_annex, name, div)
|
217
|
-
preceding_floating_titles(name, div)
|
218
206
|
return if name.nil?
|
219
207
|
|
220
208
|
div.h1 class: "Annex" do |t|
|
data/lib/metanorma/iec/front.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "pubid-iec"
|
2
|
+
|
1
3
|
module Metanorma
|
2
4
|
module Iec
|
3
5
|
class Converter < ISO::Converter
|
@@ -42,8 +44,7 @@ module Metanorma
|
|
42
44
|
end
|
43
45
|
|
44
46
|
def iso_id(node, xml)
|
45
|
-
|
46
|
-
|
47
|
+
node.attr("docnumber") || node.attr("docidentifier") or return
|
47
48
|
unless dn = node.attr("docidentifier")
|
48
49
|
part, subpart = node&.attr("partnumber")&.split(/-/)
|
49
50
|
dn = add_id_parts(node.attr("docnumber"), part, subpart)
|
@@ -220,6 +221,7 @@ module Metanorma
|
|
220
221
|
abbr
|
221
222
|
end
|
222
223
|
|
224
|
+
# TODO: replace by ISO call
|
223
225
|
def metadata_status(node, xml)
|
224
226
|
stage = get_stage(node)
|
225
227
|
substage = get_substage(node)
|
@@ -231,6 +233,10 @@ module Metanorma
|
|
231
233
|
s.substage substage, **attr_code(abbreviation: subst)
|
232
234
|
node.attr("iteration") && (s.iteration node.attr("iteration"))
|
233
235
|
end
|
236
|
+
iso_id_default(iso_id_params(node))
|
237
|
+
rescue Pubid::Core::Errors::HarmonizedStageCodeInvalidError,
|
238
|
+
Pubid::Core::Errors::TypeStageParseError
|
239
|
+
report_illegal_stage(stage, substage)
|
234
240
|
end
|
235
241
|
|
236
242
|
def metadata_subdoctype(node, xml)
|
@@ -105,7 +105,7 @@
|
|
105
105
|
<p>More than 55 000 electrotechnical terminology entries in English and French extracted from the Terms and Definitions clause of IEC publications issued since 2002. Some entries have been collected from earlier publications of IEC TC 37, 77, 86 and CISPR.</p>
|
106
106
|
</clause>
|
107
107
|
<clause><title>IEC Customer Service Centre - <link target="https://webstore.iec.ch/csc">webstore.iec.ch/csc</link></title>
|
108
|
-
<p>If you wish to give us your feedback on this publication or need further assistance, please contact the Customer Service Centre: <link target="mailto
|
108
|
+
<p>If you wish to give us your feedback on this publication or need further assistance, please contact the Customer Service Centre: <link target="mailto:csc@iec.ch">csc@iec.ch</link>.</p>
|
109
109
|
</clause>
|
110
110
|
</clause>
|
111
111
|
{% endif %}
|
@@ -108,7 +108,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
108
108
|
<p>Plus de 55 000 entrées terminologiques électrotechniques, en anglais et en français, extraites des articles Termes et Définitions des publications IEC parues depuis 2002. Plus certaines entrées antérieures extraites des publications des CE 37, 77, 86 et CISPR de l'IEC.</p>
|
109
109
|
</clause>
|
110
110
|
<clause><title>Service Clients - <link target="https://webstore.iec.ch/csc">webstore.iec.ch/csc</link></title>
|
111
|
-
<p>Si vous désirez nous donner des commentaires sur cette publication ou si vous avez des questions contactez-nous: <link target="mailto
|
111
|
+
<p>Si vous désirez nous donner des commentaires sur cette publication ou si vous avez des questions contactez-nous: <link target="mailto:csc@iec.ch">csc@iec.ch</link>.</p>
|
112
112
|
</clause>
|
113
113
|
</clause>
|
114
114
|
{% endif %}
|
@@ -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-iec.gemspec
CHANGED
@@ -30,7 +30,8 @@ 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
|
+
spec.add_dependency "pubid-iec"
|
34
35
|
spec.add_dependency "ruby-jing"
|
35
36
|
|
36
37
|
spec.add_development_dependency "debug"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.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-
|
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,28 @@ 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
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pubid-iec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: ruby-jing
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,6 +245,7 @@ files:
|
|
231
245
|
- lib/isodoc/iec/init.rb
|
232
246
|
- lib/isodoc/iec/metadata.rb
|
233
247
|
- lib/isodoc/iec/pdf_convert.rb
|
248
|
+
- lib/isodoc/iec/presentation_terms.rb
|
234
249
|
- lib/isodoc/iec/presentation_xml_convert.rb
|
235
250
|
- lib/isodoc/iec/word_convert.rb
|
236
251
|
- lib/isodoc/iec/xref.rb
|