metanorma-iec 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iec/front.rb +5 -3
- data/lib/asciidoctor/iec/isodoc.rng +0 -1
- data/lib/isodoc/iec/html/htmlstyle.css +1 -1
- data/lib/isodoc/iec/iec.international-standard.xsl +273 -47
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- data/spec/asciidoctor-iec/validate_spec.rb +21 -1
- data/spec/assets/xref_error.adoc +7 -0
- data/spec/isodoc/metadata_spec.rb +2 -21
- data/spec/spec_helper.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc326d356e558e21523ffcc8690c5170fcfdf0fa18814ab0fb9164321f6fcea9
|
4
|
+
data.tar.gz: 46ead1e820327d2c8470bf0128e910003e19b6089dc78d3788e91f8721138afc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 160e78ca27fc0e649fc0e60a1932fe5fd18ea10e3f812c6bee16646032b8fd40f046d244466b3a8ba143cec6716ee88a2eae695ffc46d9816f92bc0b99072138
|
7
|
+
data.tar.gz: ef5fa5a588ff0593f32830103c897f98173cdcb07b1ca1913c7b4e084f561439292983512ac7d00f6475af12d0c5c8b001161caf510ed87a1f6d316c0ebc2738
|
@@ -6,7 +6,7 @@ module Asciidoctor
|
|
6
6
|
csv_split(publishers)&.each do |p|
|
7
7
|
xml.contributor do |c|
|
8
8
|
c.role **{ type: "author" }
|
9
|
-
c.organization { |a| organization(a, p) }
|
9
|
+
c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -16,7 +16,7 @@ module Asciidoctor
|
|
16
16
|
csv_split(publishers)&.each do |p|
|
17
17
|
xml.contributor do |c|
|
18
18
|
c.role **{ type: "publisher" }
|
19
|
-
c.organization { |a| organization(a, p) }
|
19
|
+
c.organization { |a| organization(a, p, node, !node.attr("publisher")) }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -27,7 +27,9 @@ module Asciidoctor
|
|
27
27
|
xml.copyright do |c|
|
28
28
|
c.from (node.attr("copyright-year") || Date.today.year)
|
29
29
|
c.owner do |owner|
|
30
|
-
owner.organization
|
30
|
+
owner.organization do |o|
|
31
|
+
organization(o, p, node, !node.attr("copyright-holder") || node.attr("publisher"))
|
32
|
+
end
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -16,7 +16,7 @@ fieldset, form, label, legend,
|
|
16
16
|
table, caption, tbody, tfoot, thead, tr, th, td,
|
17
17
|
article, aside, canvas, details, embed,
|
18
18
|
figure, figcaption, footer, header, hgroup,
|
19
|
-
menu,
|
19
|
+
menu, output, ruby, section, summary,
|
20
20
|
time, mark, audio, video {
|
21
21
|
margin: 0;
|
22
22
|
padding: 0; }
|
@@ -136,7 +136,7 @@
|
|
136
136
|
<xsl:call-template name="namespaceCheck"/>
|
137
137
|
<!-- https://stackoverflow.com/questions/25261949/xsl-fo-letter-spacing-with-text-align -->
|
138
138
|
<!-- https://xmlgraphics.apache.org/fop/knownissues.html -->
|
139
|
-
<fo:root font-family="Arial, Times New Roman,
|
139
|
+
<fo:root font-family="Arial, Times New Roman, STIX Two Math, HanSans" font-size="10pt" xml:lang="{$lang}">
|
140
140
|
<fo:layout-master-set>
|
141
141
|
<!-- cover pages -->
|
142
142
|
<fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
@@ -2163,7 +2163,12 @@
|
|
2163
2163
|
|
2164
2164
|
|
2165
2165
|
</title-toc>
|
2166
|
-
<title-toc lang="fr">
|
2166
|
+
<title-toc lang="fr">
|
2167
|
+
|
2168
|
+
<xsl:text>Sommaire</xsl:text>
|
2169
|
+
|
2170
|
+
|
2171
|
+
</title-toc>
|
2167
2172
|
|
2168
2173
|
<title-toc lang="zh">Contents</title-toc>
|
2169
2174
|
|
@@ -2255,10 +2260,19 @@
|
|
2255
2260
|
|
2256
2261
|
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
|
2257
2262
|
<xsl:param name="name"/>
|
2258
|
-
<xsl:
|
2259
|
-
|
2263
|
+
<xsl:param name="lang"/>
|
2264
|
+
<xsl:variable name="lang_">
|
2265
|
+
<xsl:choose>
|
2266
|
+
<xsl:when test="$lang != ''">
|
2267
|
+
<xsl:value-of select="$lang"/>
|
2268
|
+
</xsl:when>
|
2269
|
+
<xsl:otherwise>
|
2270
|
+
<xsl:call-template name="getLang"/>
|
2271
|
+
</xsl:otherwise>
|
2272
|
+
</xsl:choose>
|
2260
2273
|
</xsl:variable>
|
2261
|
-
<xsl:variable name="
|
2274
|
+
<xsl:variable name="language" select="normalize-space($lang_)"/>
|
2275
|
+
<xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
|
2262
2276
|
<xsl:choose>
|
2263
2277
|
<xsl:when test="normalize-space($title_) != ''">
|
2264
2278
|
<xsl:value-of select="$title_"/>
|
@@ -2398,6 +2412,7 @@
|
|
2398
2412
|
|
2399
2413
|
|
2400
2414
|
|
2415
|
+
|
2401
2416
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2402
2417
|
|
2403
2418
|
|
@@ -2646,6 +2661,8 @@
|
|
2646
2661
|
|
2647
2662
|
|
2648
2663
|
|
2664
|
+
|
2665
|
+
|
2649
2666
|
<!-- $namespace = 'iso' or -->
|
2650
2667
|
|
2651
2668
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -2683,6 +2700,7 @@
|
|
2683
2700
|
<xsl:with-param name="table" select="$simple-table"/>
|
2684
2701
|
</xsl:call-template>
|
2685
2702
|
</xsl:variable>
|
2703
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2686
2704
|
|
2687
2705
|
<!-- <xsl:variable name="colwidths2">
|
2688
2706
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2704,37 +2722,57 @@
|
|
2704
2722
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
2705
2723
|
|
2706
2724
|
|
2725
|
+
|
2726
|
+
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
2707
2727
|
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
2708
2728
|
<xsl:if test="ancestor::*[local-name() = 'preface']">
|
2709
2729
|
<xsl:attribute name="space-after">16pt</xsl:attribute>
|
2710
2730
|
</xsl:if>
|
2731
|
+
|
2732
|
+
|
2733
|
+
|
2711
2734
|
|
2712
2735
|
|
2736
|
+
|
2713
2737
|
|
2714
2738
|
|
2715
|
-
|
2716
2739
|
|
2717
2740
|
|
2718
2741
|
|
2719
|
-
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2742
|
+
|
2743
|
+
|
2744
|
+
<xsl:variable name="table_attributes">
|
2745
|
+
<attribute name="table-layout">fixed</attribute>
|
2746
|
+
<attribute name="width">100%</attribute>
|
2747
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2748
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2727
2749
|
|
2728
2750
|
|
2751
|
+
<attribute name="border">0.5pt solid black</attribute>
|
2729
2752
|
|
2730
2753
|
|
2731
2754
|
|
2755
|
+
|
2756
|
+
|
2757
|
+
|
2732
2758
|
|
2733
|
-
|
2734
|
-
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
2759
|
+
|
2735
2760
|
|
2761
|
+
</xsl:variable>
|
2762
|
+
|
2763
|
+
|
2764
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
2736
2765
|
|
2766
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
2767
|
+
<xsl:attribute name="{@name}">
|
2768
|
+
<xsl:value-of select="."/>
|
2769
|
+
</xsl:attribute>
|
2770
|
+
</xsl:for-each>
|
2737
2771
|
|
2772
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2773
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
2774
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
2775
|
+
</xsl:if>
|
2738
2776
|
|
2739
2777
|
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2740
2778
|
<xsl:choose>
|
@@ -2758,6 +2796,33 @@
|
|
2758
2796
|
|
2759
2797
|
</fo:table>
|
2760
2798
|
|
2799
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
2800
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
2801
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
2802
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
2803
|
+
</xsl:call-template>
|
2804
|
+
</xsl:for-each>
|
2805
|
+
|
2806
|
+
<!-- insert footer as table -->
|
2807
|
+
<!-- <fo:table>
|
2808
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
2809
|
+
<xsl:attribute name="{@name}">
|
2810
|
+
<xsl:value-of select="."/>
|
2811
|
+
</xsl:attribute>
|
2812
|
+
</xsl:for-each>
|
2813
|
+
|
2814
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2815
|
+
<xsl:choose>
|
2816
|
+
<xsl:when test=". = 1 or . = 0">
|
2817
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2818
|
+
</xsl:when>
|
2819
|
+
<xsl:otherwise>
|
2820
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2821
|
+
</xsl:otherwise>
|
2822
|
+
</xsl:choose>
|
2823
|
+
</xsl:for-each>
|
2824
|
+
</fo:table>-->
|
2825
|
+
|
2761
2826
|
|
2762
2827
|
|
2763
2828
|
|
@@ -2822,6 +2887,13 @@
|
|
2822
2887
|
<xsl:for-each select="xalan:nodeset($table)//tr">
|
2823
2888
|
<xsl:variable name="td_text">
|
2824
2889
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
2890
|
+
|
2891
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2892
|
+
<xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
|
2893
|
+
<word><xsl:value-of select="normalize-space(.)"/></word>
|
2894
|
+
</xsl:for-each>
|
2895
|
+
</xsl:if> -->
|
2896
|
+
|
2825
2897
|
</xsl:variable>
|
2826
2898
|
<xsl:variable name="words">
|
2827
2899
|
<xsl:variable name="string_with_added_zerospaces">
|
@@ -2881,11 +2953,14 @@
|
|
2881
2953
|
<xsl:value-of select="*[local-name()='origin']/@citeas"/>
|
2882
2954
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
2883
2955
|
<xsl:value-of select="@target"/>
|
2956
|
+
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
2957
|
+
<xsl:variable name="math_text" select="normalize-space(.)"/>
|
2958
|
+
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
2884
2959
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
2885
2960
|
<xsl:param name="cols-count"/>
|
2886
2961
|
<!-- font-weight="bold" -->
|
2887
2962
|
<fo:table-header>
|
2888
|
-
|
2963
|
+
|
2889
2964
|
<xsl:apply-templates/>
|
2890
2965
|
</fo:table-header>
|
2891
2966
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -2910,6 +2985,13 @@
|
|
2910
2985
|
</xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
|
2911
2986
|
<xsl:apply-templates/>
|
2912
2987
|
</xsl:template><xsl:template name="insertTableFooter">
|
2988
|
+
<xsl:param name="cols-count"/>
|
2989
|
+
<xsl:if test="../*[local-name()='tfoot']">
|
2990
|
+
<fo:table-footer>
|
2991
|
+
<xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
|
2992
|
+
</fo:table-footer>
|
2993
|
+
</xsl:if>
|
2994
|
+
</xsl:template><xsl:template name="insertTableFooter2">
|
2913
2995
|
<xsl:param name="cols-count"/>
|
2914
2996
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2915
2997
|
<xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
|
@@ -2937,11 +3019,15 @@
|
|
2937
3019
|
</xsl:if>
|
2938
3020
|
|
2939
3021
|
|
2940
|
-
|
3022
|
+
|
3023
|
+
<!-- except gb and bipm -->
|
2941
3024
|
|
2942
3025
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
2943
3026
|
|
2944
3027
|
|
3028
|
+
|
3029
|
+
|
3030
|
+
|
2945
3031
|
<!-- horizontal row separator -->
|
2946
3032
|
|
2947
3033
|
<xsl:if test="../*[local-name()='note']">
|
@@ -2961,6 +3047,96 @@
|
|
2961
3047
|
</fo:table-footer>
|
2962
3048
|
|
2963
3049
|
</xsl:if>
|
3050
|
+
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
3051
|
+
<xsl:param name="table_attributes"/>
|
3052
|
+
<xsl:param name="colwidths"/>
|
3053
|
+
|
3054
|
+
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
3055
|
+
|
3056
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
3057
|
+
|
3058
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
|
3059
|
+
|
3060
|
+
<fo:table keep-with-previous="always">
|
3061
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
3062
|
+
<xsl:choose>
|
3063
|
+
<xsl:when test="@name = 'border-top'">
|
3064
|
+
<xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
|
3065
|
+
</xsl:when>
|
3066
|
+
<xsl:when test="@name = 'border'">
|
3067
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
3068
|
+
<xsl:attribute name="border-top">0pt solid black</xsl:attribute>
|
3069
|
+
</xsl:when>
|
3070
|
+
<xsl:otherwise>
|
3071
|
+
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
|
3072
|
+
</xsl:otherwise>
|
3073
|
+
</xsl:choose>
|
3074
|
+
</xsl:for-each>
|
3075
|
+
|
3076
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
3077
|
+
<xsl:choose>
|
3078
|
+
<xsl:when test=". = 1 or . = 0">
|
3079
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
3080
|
+
</xsl:when>
|
3081
|
+
<xsl:otherwise>
|
3082
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
3083
|
+
</xsl:otherwise>
|
3084
|
+
</xsl:choose>
|
3085
|
+
</xsl:for-each>
|
3086
|
+
|
3087
|
+
<fo:table-body>
|
3088
|
+
<fo:table-row>
|
3089
|
+
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
3090
|
+
|
3091
|
+
|
3092
|
+
<xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
|
3093
|
+
|
3094
|
+
|
3095
|
+
<!-- fn will be processed inside 'note' processing -->
|
3096
|
+
|
3097
|
+
<xsl:if test="../*[local-name()='note']">
|
3098
|
+
<fo:block margin-bottom="6pt"> </fo:block>
|
3099
|
+
</xsl:if>
|
3100
|
+
|
3101
|
+
|
3102
|
+
|
3103
|
+
<!-- except gb and bipm -->
|
3104
|
+
|
3105
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
3106
|
+
|
3107
|
+
|
3108
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
3109
|
+
<xsl:choose>
|
3110
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
3111
|
+
show Note under table in preface (ex. abstract) sections
|
3112
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
3113
|
+
</xsl:when>
|
3114
|
+
<xsl:otherwise>
|
3115
|
+
empty, because notes show at page side in main sections
|
3116
|
+
<fo:block/>
|
3117
|
+
</xsl:otherwise>
|
3118
|
+
</xsl:choose>
|
3119
|
+
</xsl:if> -->
|
3120
|
+
|
3121
|
+
|
3122
|
+
<!-- horizontal row separator -->
|
3123
|
+
|
3124
|
+
<xsl:if test="../*[local-name()='note']">
|
3125
|
+
<fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
|
3126
|
+
<fo:block font-size="1pt"> </fo:block>
|
3127
|
+
</fo:block-container>
|
3128
|
+
</xsl:if>
|
3129
|
+
|
3130
|
+
|
3131
|
+
<!-- fn processing -->
|
3132
|
+
<xsl:call-template name="fn_display"/>
|
3133
|
+
|
3134
|
+
</fo:table-cell>
|
3135
|
+
</fo:table-row>
|
3136
|
+
</fo:table-body>
|
3137
|
+
|
3138
|
+
</fo:table>
|
3139
|
+
</xsl:if>
|
2964
3140
|
</xsl:template><xsl:template match="*[local-name()='tbody']">
|
2965
3141
|
|
2966
3142
|
<xsl:variable name="cols-count">
|
@@ -3019,8 +3195,8 @@
|
|
3019
3195
|
|
3020
3196
|
</xsl:if>
|
3021
3197
|
|
3022
|
-
|
3023
|
-
|
3198
|
+
|
3199
|
+
|
3024
3200
|
|
3025
3201
|
<xsl:apply-templates/>
|
3026
3202
|
</fo:table-row>
|
@@ -3052,6 +3228,7 @@
|
|
3052
3228
|
|
3053
3229
|
|
3054
3230
|
|
3231
|
+
|
3055
3232
|
<xsl:if test="@colspan">
|
3056
3233
|
<xsl:attribute name="number-columns-spanned">
|
3057
3234
|
<xsl:value-of select="@colspan"/>
|
@@ -3097,7 +3274,7 @@
|
|
3097
3274
|
<xsl:attribute name="border">solid black 0</xsl:attribute>
|
3098
3275
|
</xsl:if>
|
3099
3276
|
|
3100
|
-
|
3277
|
+
|
3101
3278
|
|
3102
3279
|
<xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
|
3103
3280
|
<xsl:if test="ancestor::*[local-name()='preface']">
|
@@ -3109,6 +3286,7 @@
|
|
3109
3286
|
|
3110
3287
|
|
3111
3288
|
|
3289
|
+
|
3112
3290
|
<xsl:if test="@colspan">
|
3113
3291
|
<xsl:attribute name="number-columns-spanned">
|
3114
3292
|
<xsl:value-of select="@colspan"/>
|
@@ -3135,14 +3313,17 @@
|
|
3135
3313
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3136
3314
|
|
3137
3315
|
|
3316
|
+
|
3317
|
+
|
3138
3318
|
<fo:inline padding-right="2mm">
|
3139
3319
|
|
3140
3320
|
|
3141
3321
|
|
3142
|
-
|
3322
|
+
|
3143
3323
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3144
3324
|
|
3145
3325
|
</fo:inline>
|
3326
|
+
|
3146
3327
|
<xsl:apply-templates mode="process"/>
|
3147
3328
|
</fo:block>
|
3148
3329
|
|
@@ -3171,6 +3352,7 @@
|
|
3171
3352
|
<xsl:attribute name="margin-left">6mm</xsl:attribute>
|
3172
3353
|
|
3173
3354
|
|
3355
|
+
|
3174
3356
|
<fo:inline font-size="80%" padding-right="5mm" id="{@id}">
|
3175
3357
|
|
3176
3358
|
|
@@ -3181,12 +3363,15 @@
|
|
3181
3363
|
|
3182
3364
|
|
3183
3365
|
|
3366
|
+
|
3184
3367
|
<xsl:value-of select="@reference"/>
|
3185
3368
|
|
3369
|
+
|
3186
3370
|
</fo:inline>
|
3187
3371
|
<fo:inline>
|
3188
3372
|
|
3189
|
-
<xsl:apply-templates/>
|
3373
|
+
<!-- <xsl:apply-templates /> -->
|
3374
|
+
<xsl:copy-of select="./node()"/>
|
3190
3375
|
</fo:inline>
|
3191
3376
|
</fo:block>
|
3192
3377
|
</xsl:if>
|
@@ -3223,7 +3408,20 @@
|
|
3223
3408
|
<xsl:variable name="following_dl_colwidths">
|
3224
3409
|
<xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
|
3225
3410
|
<xsl:variable name="html-table">
|
3226
|
-
<xsl:variable name="
|
3411
|
+
<xsl:variable name="doc_ns">
|
3412
|
+
|
3413
|
+
</xsl:variable>
|
3414
|
+
<xsl:variable name="ns">
|
3415
|
+
<xsl:choose>
|
3416
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
3417
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
3418
|
+
</xsl:when>
|
3419
|
+
<xsl:otherwise>
|
3420
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
3421
|
+
</xsl:otherwise>
|
3422
|
+
</xsl:choose>
|
3423
|
+
</xsl:variable>
|
3424
|
+
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
3227
3425
|
<xsl:element name="{$ns}:table">
|
3228
3426
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
3229
3427
|
<tbody>
|
@@ -3297,7 +3495,8 @@
|
|
3297
3495
|
|
3298
3496
|
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
|
3299
3497
|
|
3300
|
-
<xsl:apply-templates/>
|
3498
|
+
<!-- <xsl:apply-templates /> -->
|
3499
|
+
<xsl:copy-of select="./node()"/>
|
3301
3500
|
</fo:block>
|
3302
3501
|
</fo:table-cell>
|
3303
3502
|
</fo:table-row>
|
@@ -3322,9 +3521,12 @@
|
|
3322
3521
|
|
3323
3522
|
|
3324
3523
|
|
3524
|
+
|
3325
3525
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
3326
3526
|
|
3527
|
+
|
3327
3528
|
<xsl:value-of select="@reference"/>
|
3529
|
+
|
3328
3530
|
</fo:basic-link>
|
3329
3531
|
</fo:inline>
|
3330
3532
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -3438,7 +3640,20 @@
|
|
3438
3640
|
</xsl:choose>
|
3439
3641
|
<!-- create virtual html table for dl/[dt and dd] -->
|
3440
3642
|
<xsl:variable name="html-table">
|
3441
|
-
<xsl:variable name="
|
3643
|
+
<xsl:variable name="doc_ns">
|
3644
|
+
|
3645
|
+
</xsl:variable>
|
3646
|
+
<xsl:variable name="ns">
|
3647
|
+
<xsl:choose>
|
3648
|
+
<xsl:when test="normalize-space($doc_ns) != ''">
|
3649
|
+
<xsl:value-of select="normalize-space($doc_ns)"/>
|
3650
|
+
</xsl:when>
|
3651
|
+
<xsl:otherwise>
|
3652
|
+
<xsl:value-of select="substring-before(name(/*), '-')"/>
|
3653
|
+
</xsl:otherwise>
|
3654
|
+
</xsl:choose>
|
3655
|
+
</xsl:variable>
|
3656
|
+
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
3442
3657
|
<xsl:element name="{$ns}:table">
|
3443
3658
|
<tbody>
|
3444
3659
|
<xsl:apply-templates mode="dl"/>
|
@@ -3586,6 +3801,7 @@
|
|
3586
3801
|
|
3587
3802
|
|
3588
3803
|
|
3804
|
+
|
3589
3805
|
<xsl:apply-templates/>
|
3590
3806
|
<!-- <xsl:if test="$namespace = 'gb'">
|
3591
3807
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -3652,18 +3868,18 @@
|
|
3652
3868
|
</xsl:template><xsl:template match="*[local-name()='tt']">
|
3653
3869
|
<fo:inline xsl:use-attribute-sets="tt-style">
|
3654
3870
|
<xsl:variable name="_font-size">
|
3655
|
-
|
3656
|
-
|
3657
|
-
|
3871
|
+
|
3872
|
+
|
3873
|
+
|
3658
3874
|
10
|
3659
3875
|
|
3660
3876
|
|
3661
3877
|
|
3662
3878
|
|
3663
3879
|
|
3664
|
-
|
3665
3880
|
|
3666
|
-
|
3881
|
+
|
3882
|
+
|
3667
3883
|
|
3668
3884
|
|
3669
3885
|
</xsl:variable>
|
@@ -4001,7 +4217,7 @@
|
|
4001
4217
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
4002
4218
|
<xsl:value-of select="substring($str, 2)"/>
|
4003
4219
|
</xsl:template><xsl:template match="mathml:math">
|
4004
|
-
<fo:inline font-family="
|
4220
|
+
<fo:inline font-family="STIX Two Math"> <!-- -->
|
4005
4221
|
<xsl:variable name="mathml">
|
4006
4222
|
<xsl:apply-templates select="." mode="mathml"/>
|
4007
4223
|
</xsl:variable>
|
@@ -4095,7 +4311,7 @@
|
|
4095
4311
|
<xsl:apply-templates/>
|
4096
4312
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
4097
4313
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
4098
|
-
|
4314
|
+
|
4099
4315
|
<xsl:apply-templates/>
|
4100
4316
|
</fo:basic-link>
|
4101
4317
|
</xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
|
@@ -4303,18 +4519,9 @@
|
|
4303
4519
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
4304
4520
|
<fo:bookmark-title>
|
4305
4521
|
<xsl:variable name="bookmark-title_">
|
4306
|
-
<xsl:
|
4307
|
-
<xsl:
|
4308
|
-
|
4309
|
-
|
4310
|
-
</xsl:when>
|
4311
|
-
<xsl:when test="@lang = 'fr'">
|
4312
|
-
Français
|
4313
|
-
|
4314
|
-
</xsl:when>
|
4315
|
-
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
4316
|
-
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
4317
|
-
</xsl:choose>
|
4522
|
+
<xsl:call-template name="getLangVersion">
|
4523
|
+
<xsl:with-param name="lang" select="@lang"/>
|
4524
|
+
</xsl:call-template>
|
4318
4525
|
</xsl:variable>
|
4319
4526
|
<xsl:choose>
|
4320
4527
|
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
@@ -4376,13 +4583,27 @@
|
|
4376
4583
|
</fo:bookmark>
|
4377
4584
|
</xsl:for-each>
|
4378
4585
|
</fo:bookmark>
|
4379
|
-
</xsl:if>
|
4586
|
+
</xsl:if>
|
4380
4587
|
|
4381
4588
|
|
4382
4589
|
|
4383
4590
|
|
4384
4591
|
</fo:bookmark-tree>
|
4385
4592
|
</xsl:if>
|
4593
|
+
</xsl:template><xsl:template name="getLangVersion">
|
4594
|
+
<xsl:param name="lang"/>
|
4595
|
+
<xsl:choose>
|
4596
|
+
<xsl:when test="$lang = 'en'">
|
4597
|
+
English
|
4598
|
+
|
4599
|
+
</xsl:when>
|
4600
|
+
<xsl:when test="$lang = 'fr'">
|
4601
|
+
Français
|
4602
|
+
|
4603
|
+
</xsl:when>
|
4604
|
+
<xsl:when test="$lang = 'de'">Deutsche</xsl:when>
|
4605
|
+
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
4606
|
+
</xsl:choose>
|
4386
4607
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
4387
4608
|
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
4388
4609
|
<fo:bookmark-title>
|
@@ -4397,7 +4618,7 @@
|
|
4397
4618
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
4398
4619
|
<xsl:if test="normalize-space() != ''">
|
4399
4620
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
4400
|
-
|
4621
|
+
|
4401
4622
|
<xsl:apply-templates/>
|
4402
4623
|
</fo:block>
|
4403
4624
|
</xsl:if>
|
@@ -5031,6 +5252,7 @@
|
|
5031
5252
|
</xsl:template><xsl:template match="*[local-name() = 'clause']">
|
5032
5253
|
<fo:block>
|
5033
5254
|
<xsl:call-template name="setId"/>
|
5255
|
+
|
5034
5256
|
<xsl:apply-templates/>
|
5035
5257
|
</fo:block>
|
5036
5258
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -5066,6 +5288,7 @@
|
|
5066
5288
|
</xsl:choose>
|
5067
5289
|
</xsl:attribute>
|
5068
5290
|
|
5291
|
+
|
5069
5292
|
<fo:block-container margin-left="0mm">
|
5070
5293
|
<fo:block>
|
5071
5294
|
<xsl:apply-templates select="." mode="ul_ol"/>
|
@@ -5251,6 +5474,7 @@
|
|
5251
5474
|
|
5252
5475
|
|
5253
5476
|
|
5477
|
+
|
5254
5478
|
|
5255
5479
|
</xsl:variable>
|
5256
5480
|
<xsl:choose>
|
@@ -5265,6 +5489,7 @@
|
|
5265
5489
|
<dc:creator>
|
5266
5490
|
|
5267
5491
|
|
5492
|
+
|
5268
5493
|
</dc:creator>
|
5269
5494
|
<dc:description>
|
5270
5495
|
<xsl:variable name="abstract">
|
@@ -5274,6 +5499,7 @@
|
|
5274
5499
|
|
5275
5500
|
|
5276
5501
|
|
5502
|
+
|
5277
5503
|
</xsl:variable>
|
5278
5504
|
<xsl:value-of select="normalize-space($abstract)"/>
|
5279
5505
|
</dc:description>
|
data/metanorma-iec.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
31
|
spec.add_dependency "isodoc", "~> 1.2.0"
|
32
|
-
spec.add_dependency "metanorma-iso", "~> 1.5.
|
32
|
+
spec.add_dependency "metanorma-iso", "~> 1.5.10"
|
33
33
|
|
34
34
|
spec.add_development_dependency "byebug"
|
35
35
|
spec.add_development_dependency "sassc", "2.4.0"
|
@@ -2,10 +2,30 @@ require "spec_helper"
|
|
2
2
|
require "fileutils"
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::Iec do
|
5
|
+
context "when xref_error.adoc compilation" do
|
6
|
+
around do |example|
|
7
|
+
FileUtils.rm_f "spec/assets/xref_error.err"
|
8
|
+
example.run
|
9
|
+
Dir["spec/assets/xref_error*"].each do |file|
|
10
|
+
next if file.match?(/adoc$/)
|
11
|
+
|
12
|
+
FileUtils.rm_f(file)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
it "generates error file" do
|
17
|
+
expect do
|
18
|
+
Metanorma::Compile
|
19
|
+
.new
|
20
|
+
.compile("spec/assets/xref_error.adoc", type: "iec")
|
21
|
+
end.to(change { File.exist?("spec/assets/xref_error.err") }
|
22
|
+
.from(false).to(true))
|
23
|
+
end
|
24
|
+
end
|
5
25
|
|
6
26
|
it "Warns of illegal doctype" do
|
7
27
|
FileUtils.rm_f "test.err"
|
8
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
|
28
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
|
9
29
|
= Document title
|
10
30
|
Author
|
11
31
|
:docfile: test.adoc
|
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc::Iec::Metadata do
|
|
7
7
|
arr = c.convert_init(<<~"INPUT", "test", false)
|
8
8
|
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
9
9
|
INPUT
|
10
|
-
expect(
|
10
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil)).to_s.gsub(/, :/, ",\n:")).to be_equivalent_to <<~"OUTPUT"
|
11
11
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
12
12
|
<bibdata type="standard">
|
13
13
|
<title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
|
@@ -76,12 +76,8 @@ INPUT
|
|
76
76
|
{:accesseddate=>"2012",
|
77
77
|
:activateddate=>"2013",
|
78
78
|
:agency=>"ISO",
|
79
|
-
:authors=>[],
|
80
|
-
:authors_affiliations=>{},
|
81
79
|
:createddate=>"2010–2011",
|
82
80
|
:docnumber=>"ISO/PreCD3 17301-1",
|
83
|
-
:docnumber_lang=>nil,
|
84
|
-
:docnumber_reference=>nil,
|
85
81
|
:docnumeric=>"1730",
|
86
82
|
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz",
|
87
83
|
:docsubtitleintro=>"Céréales et légumineuses",
|
@@ -99,11 +95,7 @@ INPUT
|
|
99
95
|
:draftinfo=>" (draft 0.4, 2016-05-01)",
|
100
96
|
:edition=>"2",
|
101
97
|
:editorialgroup=>["TC 34", "SC 4", "WG 3"],
|
102
|
-
:ics=>nil,
|
103
|
-
:keywords=>[],
|
104
98
|
:obsoleteddate=>"2014",
|
105
|
-
:obsoletes=>nil,
|
106
|
-
:obsoletes_part=>nil,
|
107
99
|
:publisheddate=>"2011",
|
108
100
|
:publisher=>"International Organization for Standardization",
|
109
101
|
:revdate=>"2016-05-01",
|
@@ -126,7 +118,7 @@ OUTPUT
|
|
126
118
|
arr = c.convert_init(<<~"INPUT", "test", false)
|
127
119
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
128
120
|
INPUT
|
129
|
-
expect(
|
121
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil)).to_s.gsub(/, :/, ",\n:")).to be_equivalent_to <<~"OUTPUT"
|
130
122
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
131
123
|
<bibdata type="standard">
|
132
124
|
<title>
|
@@ -197,12 +189,7 @@ OUTPUT
|
|
197
189
|
</iso-standard>
|
198
190
|
INPUT
|
199
191
|
{:agency=>"ISO/IEC",
|
200
|
-
:authors=>[],
|
201
|
-
:authors_affiliations=>{},
|
202
192
|
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
203
|
-
:docnumber_lang=>nil,
|
204
|
-
:docnumber_reference=>nil,
|
205
|
-
:docnumeric=>nil,
|
206
193
|
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
207
194
|
:docsubtitleintro=>"Céréales et légumineuses",
|
208
195
|
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
@@ -215,17 +202,11 @@ INPUT
|
|
215
202
|
:doctitlepartlabel=>"Part 1–3",
|
216
203
|
:doctype=>"Technical Report",
|
217
204
|
:docyear=>"2016",
|
218
|
-
:draft=>nil,
|
219
|
-
:draftinfo=>"",
|
220
|
-
:edition=>nil,
|
221
205
|
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
222
206
|
:ics=>"1.2.3, 1.2.3",
|
223
|
-
:keywords=>[],
|
224
207
|
:obsoletes=>"IEC 8121",
|
225
208
|
:obsoletes_part=>"3.1",
|
226
209
|
:publisher=>"International Organization for Standardization and International Electrotechnical Commission",
|
227
|
-
:revdate=>nil,
|
228
|
-
:revdate_monthyear=>nil,
|
229
210
|
:sc=>"DEF 4",
|
230
211
|
:secretariat=>"XXXX",
|
231
212
|
:stage=>"50",
|
data/spec/spec_helper.rb
CHANGED
@@ -25,6 +25,10 @@ RSpec.configure do |config|
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
def metadata(x)
|
29
|
+
Hash[x.sort].delete_if{ |k, v| v.nil? || v.respond_to?(:empty?) && v.empty? }
|
30
|
+
end
|
31
|
+
|
28
32
|
def strip_guid(x)
|
29
33
|
x.gsub(%r{ id="_[^"]+"}, ' id="_"').gsub(%r{ target="_[^"]+"}, ' target="_"')
|
30
34
|
end
|
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: 1.2.
|
4
|
+
version: 1.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.5.
|
47
|
+
version: 1.5.10
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.5.
|
54
|
+
version: 1.5.10
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: byebug
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,6 +282,7 @@ files:
|
|
282
282
|
- spec/assets/rice_image1.png
|
283
283
|
- spec/assets/word.css
|
284
284
|
- spec/assets/wordintro.html
|
285
|
+
- spec/assets/xref_error.adoc
|
285
286
|
- spec/examples/rice.adoc
|
286
287
|
- spec/examples/rice.doc
|
287
288
|
- spec/examples/rice.html
|