metanorma-jis 0.6.5 → 0.6.6

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: cb5c64ea8744feaed4b20df04ae5dd8f8f42d9908252adf5e7c1e853e19f13e2
4
- data.tar.gz: 62081c0dd8d64b004146712e132e5b5ab65cc276f6647f90f180c05e5e10c6dc
3
+ metadata.gz: 5ab0b01630fb8d1bfe5b00f02e1a2b5bdec5d25747bdb0cff159637bf113aca4
4
+ data.tar.gz: f6c399abfa6e0eb718c699442c94c0bf697ed62860320b4c4cd998192e1676af
5
5
  SHA512:
6
- metadata.gz: 69a2eb26de40e52c826ef40f95630d101a0367ec61b6ce7c03389e5cc038f4e3ef1f5edff5fba17b5af105e18c5790238210f161ef12897436c061e55b080c28
7
- data.tar.gz: 05e2a234f7a545d02249ba02374f45590fbe755a19e746734597e08c567e3142b0ee9357f5462221494ec2602312137b7cc52a114afc879d4053f7da82673d71
6
+ metadata.gz: ca03cf008a8456cb07057dd40ff491a2354f8b46c4f85b9b2debf1a3305301d10419155296821ae154707c52e4ca66e858d0e07d5380f4cd64366b1466773646
7
+ data.tar.gz: 06c7813d7204d9257c8eb3da0666b2196b1a22d979d839411961b5a5cc7a441d781b5173e55b632834bf9981b151c8c77ae8db9f1f0372bc95650ef2f4bd32c4
@@ -1339,7 +1339,7 @@ span.TableFootnoteRef {
1339
1339
  font-size: {{footnotefontsize}};
1340
1340
  }
1341
1341
 
1342
- sup a {
1342
+ sup {
1343
1343
  vertical-align: super;
1344
1344
  font-size: 0.8em;
1345
1345
  }
@@ -655,7 +655,7 @@ span.TableFootnoteRef {
655
655
  font-size: $footnotefontsize;
656
656
  }
657
657
 
658
- sup a {
658
+ sup {
659
659
  vertical-align: super;
660
660
  font-size: 0.8em;
661
661
  }
@@ -21,7 +21,7 @@ module IsoDoc
21
21
 
22
22
  def bibrenderer(options = {})
23
23
  ::Relaton::Render::Jis::General.new(options
24
- .merge(language: @lang, i18nhash: @i18n.get))
24
+ .merge(language: @lang, script: @script, i18nhash: @i18n.get))
25
25
  end
26
26
 
27
27
  def std_docid_semantic(text)
@@ -534,6 +534,8 @@
534
534
  <xsl:with-param name="docidentifier" select="$docidentifier"/>
535
535
  </xsl:call-template>
536
536
 
537
+ <xsl:call-template name="inner-cover-page"/>
538
+
537
539
  <!-- ========================== -->
538
540
  <!-- Contents and preface pages -->
539
541
  <!-- ========================== -->
@@ -1024,6 +1026,9 @@
1024
1026
  </xsl:if>
1025
1027
  </xsl:template>
1026
1028
 
1029
+ <xsl:template name="inner-cover-page">
1030
+ </xsl:template>
1031
+
1027
1032
  <xsl:template match="mn:references[not(@hidden = 'true')]" mode="linear_xml" priority="2">
1028
1033
  <xsl:copy>
1029
1034
  <xsl:apply-templates select="@*|node()" mode="linear_xml"/>
@@ -2869,7 +2874,7 @@
2869
2874
  <!-- mn:term/mn:preferred2//text() | -->
2870
2875
 
2871
2876
  <!-- <name>注記 1</name> to <name>注記<font_en> 1</font_en></name> -->
2872
- <xsl:template match="mn:title/text() | mn:fmt-title/text() | mn:term/mn:name/text() | mn:term/mn:fmt-name/text() | mn:note/mn:name/text() | mn:note/mn:fmt-name/text() | mn:termnote/mn:name/text() |mn:termnote/mn:fmt-name/text() | mn:table/mn:name/text() |mn:table/mn:fmt-name/text() | mn:figure/mn:name/text() |mn:figure/mn:fmt-name/text() | mn:termexample/mn:name/text() |mn:termexample/mn:fmtname/text() | mn:xref//text() | mn:fmt-xref//text() | mn:origin/text() | mn:fmt-origin/text()" mode="update_xml_step1">
2877
+ <xsl:template match="mn:title/text() | mn:fmt-title/text() | mn:term/mn:name/text() | mn:term/mn:fmt-name/text() | mn:note/mn:name/text() | mn:note/mn:fmt-name/text() | mn:termnote/mn:name/text() |mn:termnote/mn:fmt-name/text() | mn:table/mn:name/text() |mn:table/mn:fmt-name/text() | mn:figure/mn:name/text() |mn:figure/mn:fmt-name/text() | mn:termexample/mn:name/text() |mn:termexample/mn:fmtname/text() | mn:xref//text() | mn:fmt-xref//text() | mn:origin/text() | mn:fmt-origin/text() | mn:fmt-link/text()" mode="update_xml_step1">
2873
2878
  <xsl:choose>
2874
2879
  <xsl:when test="$vertical_layout = 'true'">
2875
2880
  <xsl:choose>
@@ -7324,7 +7329,6 @@
7324
7329
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
7325
7330
 
7326
7331
  <xsl:template name="refine_feedback-statement-title-style">
7327
-
7328
7332
  </xsl:template>
7329
7333
 
7330
7334
  <xsl:attribute-set name="feedback-statement-p-style">
@@ -13148,15 +13152,22 @@
13148
13152
  <xsl:if test="ancestor::mn:li">
13149
13153
  <xsl:attribute name="margin-left">7.5mm</xsl:attribute>
13150
13154
  </xsl:if>
13151
- </xsl:template>
13155
+ </xsl:template> <!-- refine_quote-style -->
13152
13156
 
13153
13157
  <xsl:attribute-set name="quote-source-style">
13154
13158
  <xsl:attribute name="text-align">right</xsl:attribute>
13155
- </xsl:attribute-set>
13159
+ </xsl:attribute-set> <!-- quote-source-style -->
13156
13160
 
13157
13161
  <xsl:template name="refine_quote-source-style">
13158
13162
  </xsl:template>
13159
13163
 
13164
+ <xsl:attribute-set name="source-style">
13165
+ </xsl:attribute-set> <!-- source-style -->
13166
+
13167
+ <xsl:template name="refine_source-style">
13168
+
13169
+ </xsl:template> <!-- refine_source-style -->
13170
+
13160
13171
  <!-- ====== -->
13161
13172
  <!-- quote -->
13162
13173
  <!-- source -->
@@ -13208,7 +13219,9 @@
13208
13219
  </xsl:if>
13209
13220
  <xsl:choose>
13210
13221
  <xsl:when test="not(parent::quote)">
13211
- <fo:block>
13222
+ <fo:block xsl:use-attribute-sets="source-style">
13223
+ <xsl:call-template name="refine_source-style"/>
13224
+
13212
13225
  <xsl:call-template name="insert_basic_link">
13213
13226
  <xsl:with-param name="element">
13214
13227
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -15427,7 +15440,7 @@
15427
15440
  <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
15428
15441
  </xsl:if>
15429
15442
  <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
15430
- <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
15443
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">, </xsl:if><!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas'"></xsl:if> -->
15431
15444
  </xsl:template> <!-- refine_fn-reference-style -->
15432
15445
 
15433
15446
  <xsl:attribute-set name="fn-style">
@@ -15438,7 +15451,9 @@
15438
15451
  </xsl:template>
15439
15452
 
15440
15453
  <xsl:attribute-set name="fn-num-style">
15454
+ <xsl:attribute name="role">Reference</xsl:attribute>
15441
15455
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
15456
+ <xsl:attribute name="font-size">65%</xsl:attribute>
15442
15457
  <xsl:attribute name="font-size">67%</xsl:attribute>
15443
15458
  <xsl:attribute name="font-weight">bold</xsl:attribute>
15444
15459
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -15537,33 +15552,16 @@
15537
15552
  <xsl:variable name="ref_id" select="@target"/>
15538
15553
 
15539
15554
  <xsl:variable name="footnote_inline">
15540
- <fo:inline role="Reference">
15541
-
15542
- <xsl:variable name="fn_styles">
15543
- <xsl:choose>
15544
- <xsl:when test="ancestor::mn:bibitem">
15545
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
15546
- <xsl:call-template name="refine_bibitem-note-fn-style"/>
15547
- </fn_styles>
15548
- </xsl:when>
15549
- <xsl:otherwise>
15550
- <fn_styles xsl:use-attribute-sets="fn-num-style">
15551
- <xsl:call-template name="refine_fn-num-style"/>
15552
- </fn_styles>
15553
- </xsl:otherwise>
15554
- </xsl:choose>
15555
- </xsl:variable>
15555
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
15556
15556
 
15557
- <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
15558
- <xsl:copy-of select="."/>
15559
- </xsl:for-each>
15557
+ <xsl:call-template name="refine_fn-num-style"/>
15560
15558
 
15561
15559
  <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
15562
15560
  <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
15563
15561
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
15564
15562
  </xsl:if> -->
15565
15563
 
15566
- <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
15564
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">, </xsl:if>
15567
15565
 
15568
15566
  <xsl:call-template name="insert_basic_link">
15569
15567
  <xsl:with-param name="element">
@@ -15902,33 +15900,6 @@
15902
15900
  <xsl:template name="refine_bibitem-non-normative-list-body-style">
15903
15901
  </xsl:template>
15904
15902
 
15905
- <!-- footnote reference number for bibitem, in the text -->
15906
- <xsl:attribute-set name="bibitem-note-fn-style">
15907
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
15908
- <xsl:attribute name="font-size">65%</xsl:attribute>
15909
- <xsl:attribute name="font-size">67%</xsl:attribute>
15910
- <xsl:attribute name="font-weight">bold</xsl:attribute>
15911
- <xsl:attribute name="vertical-align">super</xsl:attribute>
15912
- </xsl:attribute-set> <!-- bibitem-note-fn-style -->
15913
-
15914
- <xsl:template name="refine_bibitem-note-fn-style">
15915
- <xsl:if test="not($vertical_layout = 'true')">
15916
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
15917
- </xsl:if>
15918
- </xsl:template>
15919
-
15920
- <!-- footnote number on the page bottom -->
15921
- <xsl:attribute-set name="bibitem-note-fn-number-style">
15922
- <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
15923
- </xsl:attribute-set> <!-- bibitem-note-fn-number-style -->
15924
-
15925
- <!-- footnote body (text) on the page bottom -->
15926
- <xsl:attribute-set name="bibitem-note-fn-body-style">
15927
- <xsl:attribute name="font-size">10pt</xsl:attribute>
15928
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
15929
- <xsl:attribute name="start-indent">0pt</xsl:attribute>
15930
- </xsl:attribute-set> <!-- bibitem-note-fn-body-style -->
15931
-
15932
15903
  <xsl:attribute-set name="references-non-normative-style">
15933
15904
  </xsl:attribute-set> <!-- references-non-normative-style -->
15934
15905
 
@@ -18316,6 +18287,17 @@
18316
18287
  </xsl:attribute-set>
18317
18288
 
18318
18289
  <xsl:template name="refine_clause-style">
18290
+ <!-- commented for https://github.com/metanorma/metanorma-ribose/issues/421 -->
18291
+ <!-- <xsl:if test="$namespace = 'rsd'">
18292
+ <xsl:variable name="level">
18293
+ <xsl:call-template name="getLevel">
18294
+ <xsl:with-param name="depth" select="mn:fmt-title/@depth"/>
18295
+ </xsl:call-template>
18296
+ </xsl:variable>
18297
+ <xsl:if test="$level &gt;= 4">
18298
+ <xsl:attribute name="margin-left">13mm</xsl:attribute>
18299
+ </xsl:if>
18300
+ </xsl:if> -->
18319
18301
  </xsl:template>
18320
18302
 
18321
18303
  <!-- main sections -->
@@ -48,11 +48,13 @@ module IsoDoc
48
48
  end
49
49
 
50
50
  def source1_label(elem, sources, ancestor)
51
- case ancestor
52
- when :table
53
- elem.children = l10n("#{@i18n.source}: #{sources}")
54
- else super
55
- end
51
+ elem.children = if ancestor == :table
52
+ l10n("#{@i18n.source}: #{sources}")
53
+ elsif /\(.+\)/.match?(sources)
54
+ l10n("[#{@i18n.source}: #{sources}]")
55
+ else
56
+ l10n("(#{@i18n.source}: #{sources})")
57
+ end
56
58
  end
57
59
 
58
60
  def bibdata_i18n(bibdata)
@@ -147,6 +149,36 @@ module IsoDoc
147
149
  docxml.xpath(ns("//table//fn"))
148
150
  end
149
151
 
152
+ # if termsource xref has no SDO identifier, cite instead by full reference
153
+ def citeas(xmldoc)
154
+ super
155
+ xmldoc.xpath(ns("//fmt-origin")).each do |e|
156
+ fmt_origin_cite_full?(e) or next
157
+ bibitem = @bibitem_lookup[e["bibitemid"]]
158
+ cit = bibitem.at(ns("./formattedref")) or next
159
+ e["citeas"] = citeas_cleanup(to_xml(cit.children).strip)
160
+ end
161
+ end
162
+
163
+ def fmt_origin_cite_full?(elem)
164
+ sem_xml_descendant?(elem) and return
165
+ id = elem["bibitemid"] or return
166
+ b = @bibitem_lookup[id] or return
167
+ !b.at(ns(<<~XPATH))
168
+ ./docidentifier[not(#{SKIP_DOCID} or @scope = 'biblio-tag' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type='title')]
169
+ XPATH
170
+ end
171
+
172
+ def termsource_join_delim(_elem)
173
+ @lang == "ja" ? "、" : "; "
174
+ end
175
+
176
+ def source_join_delim(_elem)
177
+ @lang == "ja" ? "、" : "; "
178
+ end
179
+
180
+ def bracketed_refs_processing(docxml); end
181
+
150
182
  include Init
151
183
  end
152
184
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Jis
3
- VERSION = "0.6.5".freeze
3
+ VERSION = "0.6.6".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.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: 2025-09-15 00:00:00.000000000 Z
11
+ date: 2025-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: japanese_calendar