metanorma-iso 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/style-human.css +30 -1
- data/lib/isodoc/iso/html/style-iso.css +30 -1
- data/lib/isodoc/iso/iso.amendment.xsl +38 -12
- data/lib/isodoc/iso/iso.international-standard.xsl +38 -12
- data/lib/isodoc/iso/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/iso/word_dis_cleanup.rb +10 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/relaton/render/config.yml +1 -1
- data/lib/relaton/render/general.rb +6 -0
- data/lib/relaton/render/parse.rb +20 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81070b729e77856b0d083c3be2d81856202fd3040a8fed0e62873144b9eefcec
|
|
4
|
+
data.tar.gz: 51d711e98ec5b9b998bf5e8efbddd2d1fafc726f2144b4a87cf6386b78d7c69e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 725b067fa1e85403afd5645149652b3047ec4bda0587ceee1da3613165c80547110c23a2225154f13ee3ed8bfe84a57f0fe5cd9e2a5b6f368e71e195877d5bb4
|
|
7
|
+
data.tar.gz: 1c9fede3fbdc0d623c02d247298d4dde37d96b1ac3051620f3aa167ebb2949268b5d1c3447e28533da1f48b23506b68f93a7adfdaa5c9713ba0dae065d369b6a
|
|
@@ -131,6 +131,35 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
|
131
131
|
color: red;
|
|
132
132
|
text-decoration: line-through; }
|
|
133
133
|
|
|
134
|
+
/* code highlighting with line numbers */
|
|
135
|
+
table.rouge-line-table td.rouge-gutter {
|
|
136
|
+
-moz-user-select: none;
|
|
137
|
+
-ms-user-select: none;
|
|
138
|
+
-webkit-user-select: none;
|
|
139
|
+
user-select: none;
|
|
140
|
+
padding-right: 1em; }
|
|
141
|
+
|
|
142
|
+
table.rouge-line-table td.rouge-code {
|
|
143
|
+
-moz-user-select: all;
|
|
144
|
+
-ms-user-select: all;
|
|
145
|
+
-webkit-user-select: all;
|
|
146
|
+
user-select: all; }
|
|
147
|
+
|
|
148
|
+
table.rouge-line-table,
|
|
149
|
+
table.rouge-line-table th,
|
|
150
|
+
table.rouge-line-table td {
|
|
151
|
+
width: auto;
|
|
152
|
+
border: none;
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
font-size: 100%; }
|
|
156
|
+
|
|
157
|
+
table.rouge-line-table pre {
|
|
158
|
+
margin: 0;
|
|
159
|
+
padding: 0;
|
|
160
|
+
overflow-x: visible;
|
|
161
|
+
font-size: 100%; }
|
|
162
|
+
|
|
134
163
|
#standard-band {
|
|
135
164
|
background-color: #0AC442; }
|
|
136
165
|
|
|
@@ -894,7 +923,7 @@ table {
|
|
|
894
923
|
table th, table td {
|
|
895
924
|
padding: 1em; }
|
|
896
925
|
table td.header {
|
|
897
|
-
font-
|
|
926
|
+
font-weight: 400; }
|
|
898
927
|
|
|
899
928
|
td > p:first-child, th > p:first-child {
|
|
900
929
|
margin-top: 0em; }
|
|
@@ -131,6 +131,35 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
|
131
131
|
color: red;
|
|
132
132
|
text-decoration: line-through; }
|
|
133
133
|
|
|
134
|
+
/* code highlighting with line numbers */
|
|
135
|
+
table.rouge-line-table td.rouge-gutter {
|
|
136
|
+
-moz-user-select: none;
|
|
137
|
+
-ms-user-select: none;
|
|
138
|
+
-webkit-user-select: none;
|
|
139
|
+
user-select: none;
|
|
140
|
+
padding-right: 1em; }
|
|
141
|
+
|
|
142
|
+
table.rouge-line-table td.rouge-code {
|
|
143
|
+
-moz-user-select: all;
|
|
144
|
+
-ms-user-select: all;
|
|
145
|
+
-webkit-user-select: all;
|
|
146
|
+
user-select: all; }
|
|
147
|
+
|
|
148
|
+
table.rouge-line-table,
|
|
149
|
+
table.rouge-line-table th,
|
|
150
|
+
table.rouge-line-table td {
|
|
151
|
+
width: auto;
|
|
152
|
+
border: none;
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
font-size: 100%; }
|
|
156
|
+
|
|
157
|
+
table.rouge-line-table pre {
|
|
158
|
+
margin: 0;
|
|
159
|
+
padding: 0;
|
|
160
|
+
overflow-x: visible;
|
|
161
|
+
font-size: 100%; }
|
|
162
|
+
|
|
134
163
|
#standard-band {
|
|
135
164
|
background-color: #0AC442; }
|
|
136
165
|
|
|
@@ -936,7 +965,7 @@ table {
|
|
|
936
965
|
table th, table td {
|
|
937
966
|
padding: 1em; }
|
|
938
967
|
table td.header {
|
|
939
|
-
font-
|
|
968
|
+
font-weight: 400; }
|
|
940
969
|
|
|
941
970
|
td,
|
|
942
971
|
th {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
|
4
4
|
|
|
5
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
|
5
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
|
6
6
|
|
|
7
7
|
<xsl:key name="attachments" match="iso:eref[java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" use="@bibitemid"/>
|
|
8
8
|
<xsl:key name="attachments2" match="iso:eref[contains(@bibitemid,'.exp_')]" use="@bibitemid"/>
|
|
@@ -4986,7 +4986,7 @@
|
|
|
4986
4986
|
</fn>
|
|
4987
4987
|
-->
|
|
4988
4988
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
|
4989
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
|
4989
|
+
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
|
4990
4990
|
|
|
4991
4991
|
<!-- list of footnotes to calculate actual footnotes number -->
|
|
4992
4992
|
<xsl:variable name="p_fn_">
|
|
@@ -5045,8 +5045,7 @@
|
|
|
5045
5045
|
</fo:basic-link>
|
|
5046
5046
|
</fo:inline>
|
|
5047
5047
|
</xsl:variable>
|
|
5048
|
-
|
|
5049
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
|
5048
|
+
|
|
5050
5049
|
<xsl:choose>
|
|
5051
5050
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
|
5052
5051
|
<xsl:copy-of select="$footnote_inline"/>
|
|
@@ -5101,7 +5100,7 @@
|
|
|
5101
5100
|
<!-- commented:
|
|
5102
5101
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
|
5103
5102
|
because 'fn' there is in biblio-tag -->
|
|
5104
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
|
5103
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
|
5105
5104
|
<!-- copy unique fn -->
|
|
5106
5105
|
<fn gen_id="{generate-id(.)}">
|
|
5107
5106
|
<xsl:copy-of select="@*"/>
|
|
@@ -7748,7 +7747,9 @@
|
|
|
7748
7747
|
|
|
7749
7748
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
|
7750
7749
|
<xsl:if test="number($scale) < 100">
|
|
7751
|
-
|
|
7750
|
+
|
|
7751
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
|
7752
|
+
|
|
7752
7753
|
</xsl:if>
|
|
7753
7754
|
|
|
7754
7755
|
</xsl:if>
|
|
@@ -8761,6 +8762,12 @@
|
|
|
8761
8762
|
</xsl:attribute>
|
|
8762
8763
|
</xsl:for-each>
|
|
8763
8764
|
|
|
8765
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
|
8766
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
|
8767
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
|
8768
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
8769
|
+
</xsl:if>
|
|
8770
|
+
|
|
8764
8771
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
|
8765
8772
|
</fo:block>
|
|
8766
8773
|
|
|
@@ -8809,7 +8816,7 @@
|
|
|
8809
8816
|
</xsl:template>
|
|
8810
8817
|
|
|
8811
8818
|
<!-- outer table with line numbers for sourcecode -->
|
|
8812
|
-
<xsl:template match="*[local-name()='
|
|
8819
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
|
8813
8820
|
<fo:block>
|
|
8814
8821
|
<fo:table width="100%" table-layout="fixed">
|
|
8815
8822
|
<xsl:copy-of select="@id"/>
|
|
@@ -8821,16 +8828,16 @@
|
|
|
8821
8828
|
</fo:table>
|
|
8822
8829
|
</fo:block>
|
|
8823
8830
|
</xsl:template>
|
|
8824
|
-
<xsl:template match="*[local-name()='
|
|
8831
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
|
8825
8832
|
<xsl:apply-templates/>
|
|
8826
8833
|
</xsl:template>
|
|
8827
|
-
<xsl:template match="*[local-name()='
|
|
8834
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
|
8828
8835
|
<fo:table-row>
|
|
8829
8836
|
<xsl:apply-templates/>
|
|
8830
8837
|
</fo:table-row>
|
|
8831
8838
|
</xsl:template>
|
|
8832
8839
|
<!-- first td with line numbers -->
|
|
8833
|
-
<xsl:template match="*[local-name()='
|
|
8840
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
|
8834
8841
|
<fo:table-cell>
|
|
8835
8842
|
<fo:block>
|
|
8836
8843
|
|
|
@@ -8850,8 +8857,9 @@
|
|
|
8850
8857
|
</fo:block>
|
|
8851
8858
|
</fo:table-cell>
|
|
8852
8859
|
</xsl:template>
|
|
8860
|
+
|
|
8853
8861
|
<!-- second td with sourcecode -->
|
|
8854
|
-
<xsl:template match="*[local-name()='
|
|
8862
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
|
8855
8863
|
<fo:table-cell>
|
|
8856
8864
|
<fo:block>
|
|
8857
8865
|
<xsl:apply-templates/>
|
|
@@ -9089,7 +9097,25 @@
|
|
|
9089
9097
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
|
9090
9098
|
<fo:block xsl:use-attribute-sets="pre-style">
|
|
9091
9099
|
<xsl:copy-of select="@id"/>
|
|
9092
|
-
<xsl:
|
|
9100
|
+
<xsl:choose>
|
|
9101
|
+
|
|
9102
|
+
<xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
|
|
9103
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
|
9104
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
|
9105
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
9106
|
+
</xsl:if>
|
|
9107
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
|
9108
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
9109
|
+
<mtext><xsl:value-of select="."/></mtext>
|
|
9110
|
+
</math>
|
|
9111
|
+
</fo:instream-foreign-object>
|
|
9112
|
+
</xsl:when>
|
|
9113
|
+
|
|
9114
|
+
<xsl:otherwise>
|
|
9115
|
+
<xsl:apply-templates/>
|
|
9116
|
+
</xsl:otherwise>
|
|
9117
|
+
|
|
9118
|
+
</xsl:choose>
|
|
9093
9119
|
</fo:block>
|
|
9094
9120
|
</xsl:template>
|
|
9095
9121
|
<!-- =============== -->
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
|
4
4
|
|
|
5
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
|
5
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
|
6
6
|
|
|
7
7
|
<xsl:key name="attachments" match="iso:eref[java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" use="@bibitemid"/>
|
|
8
8
|
<xsl:key name="attachments2" match="iso:eref[contains(@bibitemid,'.exp_')]" use="@bibitemid"/>
|
|
@@ -4986,7 +4986,7 @@
|
|
|
4986
4986
|
</fn>
|
|
4987
4987
|
-->
|
|
4988
4988
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
|
4989
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
|
4989
|
+
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
|
4990
4990
|
|
|
4991
4991
|
<!-- list of footnotes to calculate actual footnotes number -->
|
|
4992
4992
|
<xsl:variable name="p_fn_">
|
|
@@ -5045,8 +5045,7 @@
|
|
|
5045
5045
|
</fo:basic-link>
|
|
5046
5046
|
</fo:inline>
|
|
5047
5047
|
</xsl:variable>
|
|
5048
|
-
|
|
5049
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
|
5048
|
+
|
|
5050
5049
|
<xsl:choose>
|
|
5051
5050
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
|
5052
5051
|
<xsl:copy-of select="$footnote_inline"/>
|
|
@@ -5101,7 +5100,7 @@
|
|
|
5101
5100
|
<!-- commented:
|
|
5102
5101
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
|
5103
5102
|
because 'fn' there is in biblio-tag -->
|
|
5104
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
|
5103
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
|
5105
5104
|
<!-- copy unique fn -->
|
|
5106
5105
|
<fn gen_id="{generate-id(.)}">
|
|
5107
5106
|
<xsl:copy-of select="@*"/>
|
|
@@ -7748,7 +7747,9 @@
|
|
|
7748
7747
|
|
|
7749
7748
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
|
7750
7749
|
<xsl:if test="number($scale) < 100">
|
|
7751
|
-
|
|
7750
|
+
|
|
7751
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
|
7752
|
+
|
|
7752
7753
|
</xsl:if>
|
|
7753
7754
|
|
|
7754
7755
|
</xsl:if>
|
|
@@ -8761,6 +8762,12 @@
|
|
|
8761
8762
|
</xsl:attribute>
|
|
8762
8763
|
</xsl:for-each>
|
|
8763
8764
|
|
|
8765
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
|
8766
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
|
8767
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
|
8768
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
8769
|
+
</xsl:if>
|
|
8770
|
+
|
|
8764
8771
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
|
8765
8772
|
</fo:block>
|
|
8766
8773
|
|
|
@@ -8809,7 +8816,7 @@
|
|
|
8809
8816
|
</xsl:template>
|
|
8810
8817
|
|
|
8811
8818
|
<!-- outer table with line numbers for sourcecode -->
|
|
8812
|
-
<xsl:template match="*[local-name()='
|
|
8819
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
|
8813
8820
|
<fo:block>
|
|
8814
8821
|
<fo:table width="100%" table-layout="fixed">
|
|
8815
8822
|
<xsl:copy-of select="@id"/>
|
|
@@ -8821,16 +8828,16 @@
|
|
|
8821
8828
|
</fo:table>
|
|
8822
8829
|
</fo:block>
|
|
8823
8830
|
</xsl:template>
|
|
8824
|
-
<xsl:template match="*[local-name()='
|
|
8831
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
|
8825
8832
|
<xsl:apply-templates/>
|
|
8826
8833
|
</xsl:template>
|
|
8827
|
-
<xsl:template match="*[local-name()='
|
|
8834
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
|
8828
8835
|
<fo:table-row>
|
|
8829
8836
|
<xsl:apply-templates/>
|
|
8830
8837
|
</fo:table-row>
|
|
8831
8838
|
</xsl:template>
|
|
8832
8839
|
<!-- first td with line numbers -->
|
|
8833
|
-
<xsl:template match="*[local-name()='
|
|
8840
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
|
8834
8841
|
<fo:table-cell>
|
|
8835
8842
|
<fo:block>
|
|
8836
8843
|
|
|
@@ -8850,8 +8857,9 @@
|
|
|
8850
8857
|
</fo:block>
|
|
8851
8858
|
</fo:table-cell>
|
|
8852
8859
|
</xsl:template>
|
|
8860
|
+
|
|
8853
8861
|
<!-- second td with sourcecode -->
|
|
8854
|
-
<xsl:template match="*[local-name()='
|
|
8862
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
|
8855
8863
|
<fo:table-cell>
|
|
8856
8864
|
<fo:block>
|
|
8857
8865
|
<xsl:apply-templates/>
|
|
@@ -9089,7 +9097,25 @@
|
|
|
9089
9097
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
|
9090
9098
|
<fo:block xsl:use-attribute-sets="pre-style">
|
|
9091
9099
|
<xsl:copy-of select="@id"/>
|
|
9092
|
-
<xsl:
|
|
9100
|
+
<xsl:choose>
|
|
9101
|
+
|
|
9102
|
+
<xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
|
|
9103
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
|
9104
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
|
9105
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
9106
|
+
</xsl:if>
|
|
9107
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
|
9108
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
9109
|
+
<mtext><xsl:value-of select="."/></mtext>
|
|
9110
|
+
</math>
|
|
9111
|
+
</fo:instream-foreign-object>
|
|
9112
|
+
</xsl:when>
|
|
9113
|
+
|
|
9114
|
+
<xsl:otherwise>
|
|
9115
|
+
<xsl:apply-templates/>
|
|
9116
|
+
</xsl:otherwise>
|
|
9117
|
+
|
|
9118
|
+
</xsl:choose>
|
|
9093
9119
|
</fo:block>
|
|
9094
9120
|
</xsl:template>
|
|
9095
9121
|
<!-- =============== -->
|
|
@@ -43,6 +43,7 @@ module IsoDoc
|
|
|
43
43
|
amd_style(docxml)
|
|
44
44
|
code_style(docxml)
|
|
45
45
|
figure_style(docxml)
|
|
46
|
+
formula_style(docxml)
|
|
46
47
|
note_style(docxml)
|
|
47
48
|
example_style(docxml)
|
|
48
49
|
dis_style_interactions(docxml)
|
|
@@ -162,6 +163,14 @@ module IsoDoc
|
|
|
162
163
|
end
|
|
163
164
|
end
|
|
164
165
|
|
|
166
|
+
def formula_style(docxml)
|
|
167
|
+
docxml.xpath("//div[@class = 'Formula']").each do |f|
|
|
168
|
+
f.xpath(".//p[not(@class)]").each do |p|
|
|
169
|
+
p["class"] = "Formula"
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
165
174
|
def code_style(doc)
|
|
166
175
|
span_style((doc.xpath("//tt//b") - doc.xpath("//tt//i//b")),
|
|
167
176
|
"ISOCodebold")
|
|
@@ -210,7 +219,7 @@ module IsoDoc
|
|
|
210
219
|
p["class"] = "zzCopyright"
|
|
211
220
|
p["style"] = "text-indent:20.15pt;"
|
|
212
221
|
p.replace(to_xml(p).gsub(%r{<br/>}, "</p>\n<p class='zzCopyright' " \
|
|
213
|
-
|
|
222
|
+
"style='text-indent:20.15pt;'>"))
|
|
214
223
|
end
|
|
215
224
|
docxml.xpath("//p[@class = 'zzCopyrightHdr']")&.each do |p|
|
|
216
225
|
# p["class"] = "zzCopyright"
|
|
@@ -18,7 +18,7 @@ seriestemplate: "{% if series_formatted %}{{ series_formatted }}{%else%}{% if se
|
|
|
18
18
|
journaltemplate: "<em>{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %}</em> ({{series_run}}) {{ labels['volume'] }}_{{series_num}} {{ labels['part'] }}_{{series_partnumber}}"
|
|
19
19
|
template:
|
|
20
20
|
# skip standardidentifier, it is inserted in front of formattedref within metanorma
|
|
21
|
-
standard: "<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}."
|
|
21
|
+
standard: "{% if home_standard %}<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}{% else %}<smallcap>{{ creatornames }}</smallcap>. <em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{labels['updated'] | capitalize }}_{{date_updated}}. {{status | capitalize}}. {{ authorizer }}. {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>.{% endif %}"
|
|
22
22
|
website: "<smallcap>{{ creatornames }}</smallcap> ({{ role }}) . <em><span_class='stddocTitle'>{{ title }}</span></em> [website]. {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{place}}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
|
|
23
23
|
book: "<smallcap>{{ creatornames }}</smallcap> ({{role}}) . <em>{{ title }}</em> . {{ edition | capitalize_first }}. ({{ series }}). {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
|
24
24
|
booklet: book
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require "relaton-render"
|
|
2
|
+
require_relative "parse"
|
|
2
3
|
|
|
3
4
|
module Relaton
|
|
4
5
|
module Render
|
|
@@ -7,6 +8,11 @@ module Relaton
|
|
|
7
8
|
def config_loc
|
|
8
9
|
YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
|
|
9
10
|
end
|
|
11
|
+
|
|
12
|
+
def klass_initialize(_options)
|
|
13
|
+
super
|
|
14
|
+
@parseklass = Relaton::Render::ISO::Parse
|
|
15
|
+
end
|
|
10
16
|
end
|
|
11
17
|
end
|
|
12
18
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Relaton
|
|
2
|
+
module Render
|
|
3
|
+
module ISO
|
|
4
|
+
class Parse < ::Relaton::Render::Parse
|
|
5
|
+
def simple_or_host_xml2hash(doc, host)
|
|
6
|
+
ret = super
|
|
7
|
+
ret.merge(home_standard: home_standard(doc, ret[:publisher_raw]))
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def home_standard(_doc, pubs)
|
|
11
|
+
pubs&.any? do |r|
|
|
12
|
+
["International Organization for Standardization", "ISO",
|
|
13
|
+
"International Electrotechnical Commission", "IEC"]
|
|
14
|
+
.include?(r[:nonpersonal])
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-iso
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.
|
|
4
|
+
version: 2.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-12-
|
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: metanorma-standoc
|
|
@@ -395,6 +395,7 @@ files:
|
|
|
395
395
|
- lib/metanorma/requirements/requirements.rb
|
|
396
396
|
- lib/relaton/render/config.yml
|
|
397
397
|
- lib/relaton/render/general.rb
|
|
398
|
+
- lib/relaton/render/parse.rb
|
|
398
399
|
- metanorma-iso.gemspec
|
|
399
400
|
homepage: https://github.com/metanorma/metanorma-iso
|
|
400
401
|
licenses:
|