metanorma-ieee 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e84f9dd6b6e556837d431e572dbe1bacfaae32997260f02d900b0186a54d01de
4
- data.tar.gz: ae742824b749285c825ebe9d4c88d259c318addfe2982ff5ef19211b4937ddad
3
+ metadata.gz: ce9955b8968a1534d4fc1b605ee76152571bea23ac0786a21457eef8913b1a18
4
+ data.tar.gz: b0a2ba7f21ae16443fd949829d2017868fd2e846267f95ce66dffbeac0516c55
5
5
  SHA512:
6
- metadata.gz: db667c8dc612dd9f66c20e74cef3488b205fe3fa7c5715993667baedf0694a5fc9bb0d2c68dc3ce9fc308531c34f2a09b584a97103198199136c330cbcd36d7d
7
- data.tar.gz: 57354088005c3641e05791bb3a05665d82d1257bd9dd2ae3cdeca56052a4bfd3ea203ef4a91173a9c31ef695eb05cc53b48e5f4b56c415b6374462421d641086
6
+ metadata.gz: 3178aaf73b61959ef92471f141520518642487cb6bdf0db6851072f6ba7d2b8faae964b7944d17aef5c77300e08dd667eb342a31c42a78f1bbd1fb151d32523c
7
+ data.tar.gz: c5585016209917c885b8801a099eb2efaed24d3c8b0ed0e566ee4690c3cb9867f23c6150957610cb3cd475d2ca09fc61d71336b4276580c5c92f79c159314590
@@ -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-weigth: 400; }
926
+ font-weight: 400; }
898
927
 
899
928
  td,
900
929
  th {
@@ -3,7 +3,7 @@
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <!-- mandatory 'key' -->
6
- <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
+ <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"/>
7
7
 
8
8
  <!-- mandatory variable -->
9
9
 
@@ -2080,7 +2080,7 @@
2080
2080
  </fn>
2081
2081
  -->
2082
2082
 
2083
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" mode="flatxml">
2083
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="flatxml">
2084
2084
  <xsl:variable name="p_fn_">
2085
2085
  <xsl:call-template name="get_fn_list"/>
2086
2086
  </xsl:variable>
@@ -2643,7 +2643,7 @@
2643
2643
  </xsl:choose>
2644
2644
  </xsl:template>
2645
2645
 
2646
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="3">
2646
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="3">
2647
2647
  <xsl:call-template name="fn"/>
2648
2648
  </xsl:template>
2649
2649
 
@@ -6379,7 +6379,7 @@
6379
6379
  </fn>
6380
6380
  -->
6381
6381
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
6382
- <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">
6382
+ <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">
6383
6383
 
6384
6384
  <!-- list of footnotes to calculate actual footnotes number -->
6385
6385
  <xsl:variable name="p_fn_">
@@ -6436,8 +6436,7 @@
6436
6436
  </fo:basic-link>
6437
6437
  </fo:inline>
6438
6438
  </xsl:variable>
6439
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
6440
- gen_id=<xsl:value-of select="$gen_id"/> -->
6439
+
6441
6440
  <xsl:choose>
6442
6441
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
6443
6442
  <xsl:copy-of select="$footnote_inline"/>
@@ -6501,7 +6500,7 @@
6501
6500
  <!-- commented:
6502
6501
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
6503
6502
  because 'fn' there is in biblio-tag -->
6504
- <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])]">
6503
+ <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])]">
6505
6504
  <!-- copy unique fn -->
6506
6505
  <fn gen_id="{generate-id(.)}">
6507
6506
  <xsl:copy-of select="@*"/>
@@ -9057,7 +9056,9 @@
9057
9056
 
9058
9057
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
9059
9058
  <xsl:if test="number($scale) &lt; 100">
9060
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
9059
+
9060
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
9061
+
9061
9062
  </xsl:if>
9062
9063
 
9063
9064
  </xsl:if>
@@ -10075,6 +10076,12 @@
10075
10076
  </xsl:attribute>
10076
10077
  </xsl:for-each>
10077
10078
 
10079
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
10080
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
10081
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
10082
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10083
+ </xsl:if>
10084
+
10078
10085
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10079
10086
  </fo:block>
10080
10087
 
@@ -10123,7 +10130,7 @@
10123
10130
  </xsl:template>
10124
10131
 
10125
10132
  <!-- outer table with line numbers for sourcecode -->
10126
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
10133
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
10127
10134
  <fo:block>
10128
10135
  <fo:table width="100%" table-layout="fixed">
10129
10136
  <xsl:copy-of select="@id"/>
@@ -10135,16 +10142,16 @@
10135
10142
  </fo:table>
10136
10143
  </fo:block>
10137
10144
  </xsl:template>
10138
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
10145
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
10139
10146
  <xsl:apply-templates/>
10140
10147
  </xsl:template>
10141
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
10148
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
10142
10149
  <fo:table-row>
10143
10150
  <xsl:apply-templates/>
10144
10151
  </fo:table-row>
10145
10152
  </xsl:template>
10146
10153
  <!-- first td with line numbers -->
10147
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
10154
+ <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'] -->
10148
10155
  <fo:table-cell>
10149
10156
  <fo:block>
10150
10157
 
@@ -10164,8 +10171,9 @@
10164
10171
  </fo:block>
10165
10172
  </fo:table-cell>
10166
10173
  </xsl:template>
10174
+
10167
10175
  <!-- second td with sourcecode -->
10168
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
10176
+ <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'] -->
10169
10177
  <fo:table-cell>
10170
10178
  <fo:block>
10171
10179
  <xsl:apply-templates/>
@@ -10403,7 +10411,25 @@
10403
10411
  <xsl:template match="*[local-name()='pre']" name="pre">
10404
10412
  <fo:block xsl:use-attribute-sets="pre-style">
10405
10413
  <xsl:copy-of select="@id"/>
10406
- <xsl:apply-templates/>
10414
+ <xsl:choose>
10415
+
10416
+ <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' -->
10417
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
10418
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
10419
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10420
+ </xsl:if>
10421
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
10422
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
10423
+ <mtext><xsl:value-of select="."/></mtext>
10424
+ </math>
10425
+ </fo:instream-foreign-object>
10426
+ </xsl:when>
10427
+
10428
+ <xsl:otherwise>
10429
+ <xsl:apply-templates/>
10430
+ </xsl:otherwise>
10431
+
10432
+ </xsl:choose>
10407
10433
  </fo:block>
10408
10434
  </xsl:template>
10409
10435
  <!-- =============== -->
@@ -3,7 +3,7 @@
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <!-- mandatory 'key' -->
6
- <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
+ <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"/>
7
7
 
8
8
  <!-- mandatory variable -->
9
9
 
@@ -2080,7 +2080,7 @@
2080
2080
  </fn>
2081
2081
  -->
2082
2082
 
2083
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" mode="flatxml">
2083
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="flatxml">
2084
2084
  <xsl:variable name="p_fn_">
2085
2085
  <xsl:call-template name="get_fn_list"/>
2086
2086
  </xsl:variable>
@@ -2643,7 +2643,7 @@
2643
2643
  </xsl:choose>
2644
2644
  </xsl:template>
2645
2645
 
2646
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="3">
2646
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="3">
2647
2647
  <xsl:call-template name="fn"/>
2648
2648
  </xsl:template>
2649
2649
 
@@ -6379,7 +6379,7 @@
6379
6379
  </fn>
6380
6380
  -->
6381
6381
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
6382
- <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">
6382
+ <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">
6383
6383
 
6384
6384
  <!-- list of footnotes to calculate actual footnotes number -->
6385
6385
  <xsl:variable name="p_fn_">
@@ -6436,8 +6436,7 @@
6436
6436
  </fo:basic-link>
6437
6437
  </fo:inline>
6438
6438
  </xsl:variable>
6439
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
6440
- gen_id=<xsl:value-of select="$gen_id"/> -->
6439
+
6441
6440
  <xsl:choose>
6442
6441
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
6443
6442
  <xsl:copy-of select="$footnote_inline"/>
@@ -6501,7 +6500,7 @@
6501
6500
  <!-- commented:
6502
6501
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
6503
6502
  because 'fn' there is in biblio-tag -->
6504
- <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])]">
6503
+ <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])]">
6505
6504
  <!-- copy unique fn -->
6506
6505
  <fn gen_id="{generate-id(.)}">
6507
6506
  <xsl:copy-of select="@*"/>
@@ -9057,7 +9056,9 @@
9057
9056
 
9058
9057
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
9059
9058
  <xsl:if test="number($scale) &lt; 100">
9060
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
9059
+
9060
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
9061
+
9061
9062
  </xsl:if>
9062
9063
 
9063
9064
  </xsl:if>
@@ -10075,6 +10076,12 @@
10075
10076
  </xsl:attribute>
10076
10077
  </xsl:for-each>
10077
10078
 
10079
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
10080
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
10081
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
10082
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10083
+ </xsl:if>
10084
+
10078
10085
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10079
10086
  </fo:block>
10080
10087
 
@@ -10123,7 +10130,7 @@
10123
10130
  </xsl:template>
10124
10131
 
10125
10132
  <!-- outer table with line numbers for sourcecode -->
10126
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
10133
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
10127
10134
  <fo:block>
10128
10135
  <fo:table width="100%" table-layout="fixed">
10129
10136
  <xsl:copy-of select="@id"/>
@@ -10135,16 +10142,16 @@
10135
10142
  </fo:table>
10136
10143
  </fo:block>
10137
10144
  </xsl:template>
10138
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
10145
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
10139
10146
  <xsl:apply-templates/>
10140
10147
  </xsl:template>
10141
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
10148
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
10142
10149
  <fo:table-row>
10143
10150
  <xsl:apply-templates/>
10144
10151
  </fo:table-row>
10145
10152
  </xsl:template>
10146
10153
  <!-- first td with line numbers -->
10147
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
10154
+ <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'] -->
10148
10155
  <fo:table-cell>
10149
10156
  <fo:block>
10150
10157
 
@@ -10164,8 +10171,9 @@
10164
10171
  </fo:block>
10165
10172
  </fo:table-cell>
10166
10173
  </xsl:template>
10174
+
10167
10175
  <!-- second td with sourcecode -->
10168
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
10176
+ <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'] -->
10169
10177
  <fo:table-cell>
10170
10178
  <fo:block>
10171
10179
  <xsl:apply-templates/>
@@ -10403,7 +10411,25 @@
10403
10411
  <xsl:template match="*[local-name()='pre']" name="pre">
10404
10412
  <fo:block xsl:use-attribute-sets="pre-style">
10405
10413
  <xsl:copy-of select="@id"/>
10406
- <xsl:apply-templates/>
10414
+ <xsl:choose>
10415
+
10416
+ <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' -->
10417
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
10418
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
10419
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10420
+ </xsl:if>
10421
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
10422
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
10423
+ <mtext><xsl:value-of select="."/></mtext>
10424
+ </math>
10425
+ </fo:instream-foreign-object>
10426
+ </xsl:when>
10427
+
10428
+ <xsl:otherwise>
10429
+ <xsl:apply-templates/>
10430
+ </xsl:otherwise>
10431
+
10432
+ </xsl:choose>
10407
10433
  </fo:block>
10408
10434
  </xsl:template>
10409
10435
  <!-- =============== -->
@@ -51,9 +51,9 @@ module IsoDoc
51
51
  def bibrender_relaton(xml, renderings)
52
52
  f = renderings[xml["id"]][:formattedref]
53
53
  f &&= "<formattedref>#{f}</formattedref>"
54
+ keep = "./docidentifier | ./uri | ./note | ./title | ./biblio-tag"
54
55
  xml.children =
55
- "#{f}#{xml.xpath(ns('./docidentifier | ./uri | ./note | ./title'))
56
- .to_xml}"
56
+ "#{f}#{xml.xpath(ns(keep)).to_xml}"
57
57
  @author[xml["id"]] = renderings[xml["id"]][:author]
58
58
  end
59
59
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IEEE
3
- VERSION = "1.0.2".freeze
3
+ VERSION = "1.0.3".freeze
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ extenttemplate:
9
9
  misc: "{{ volume }}, {{issue}}, {{ page }}, {{ duration }}"
10
10
  template:
11
11
  # skip authoritative_identifier, it is inserted in front of formattedref within metanorma
12
- standard: "{{ title }}."
12
+ standard: "{% if home_standard %}{{ title }}.{% else %}{{ creatornames }}, “{{ title }},” {{ extent }}, {{ labels['version'] }}_{{ edition_raw }}, {{date}}, {{labels['updated'] | capitalize }}_{{date_updated}}, {{status }}, {{ authorizer }}, {{ uri }} .{% endif %}"
13
13
  article: "{{creatornames}}, “{{title}},” <em>{{ series }}</em>, {{ extent }}, {{ date }}, {{ labels['viewed'] }}_{{date_accessed}}, {{ uri }} ."
14
14
  book: "{{creatornames}}, <em>{{title}}</em>, {{ edition }}, {{place}}: {{publisher}}, {{date}}, {{ labels['viewed'] }}_{{date_accessed}}, {{ uri }} ."
15
15
  techreport: 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::IEEE::Parse
15
+ end
10
16
  end
11
17
  end
12
18
  end
@@ -0,0 +1,21 @@
1
+ module Relaton
2
+ module Render
3
+ module IEEE
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
+ "Institute of Electrical and Electronics Engineers",
15
+ "IEEE"].include?(r[:nonpersonal])
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -279,6 +279,7 @@ files:
279
279
  - lib/metanorma/ieee/version.rb
280
280
  - lib/relaton/render/config.yml
281
281
  - lib/relaton/render/general.rb
282
+ - lib/relaton/render/parse.rb
282
283
  - metanorma-ieee.gemspec
283
284
  homepage: https://github.com/metanorma/metanorma-ieee
284
285
  licenses: