metanorma-jis 1.1.4 → 1.1.5

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: b87cd55f0519a978c4ae4be412172919a6e7eae9acfeb1d690dfc7a500af99e2
4
- data.tar.gz: 863e8655d1d0f61baa970b21f218f755a5e8ff6d61e34c8855faf63d7c8ec9b7
3
+ metadata.gz: 45a55b154f22819867e78c58cd9c5e6b5df3f2945fe2b5c59ff1ed82da5d0e3b
4
+ data.tar.gz: 6395393aa0b1aab58c787cf32f910a6d195d3445ea9ccc678c7ef238732a16f5
5
5
  SHA512:
6
- metadata.gz: 77f3f33959afc2eb072cfa70ea734cb6b9529c194a898fdcf5f65358d9cf7a98048f69f95d96f48dd282f3272e218e8fff974da50803c67d9ce3140a57ea9e35
7
- data.tar.gz: d9600c009eccb9731c8ea7312adb5bf5010a55ba65e90abdcd223ba697ff48daf3f4b752d5ac922915496fe8a18c7ea0f4448be5699660446b1e1b4c57cb8a15
6
+ metadata.gz: fb5a4666ba5423f52ce5a54018c1af773188121226295c8edcdba55695f9e2734d57f99de637195dab0924a40906f5aec35c1985565b3745947bd1dc02363041
7
+ data.tar.gz: 9103861c122a615b858716a4802f6f43836e87c937b417dcd29dd97390a915696848cf7082ba080119b9c5f776ee721102460149a3c38b99013bb5a716a97359
data/.rubocop.yml CHANGED
@@ -2,6 +2,15 @@
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
+ # .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
6
+ # if listed before oss-guides, the shared config's stricter Metrics/
7
+ # (MethodLength, BlockLength, etc.) rules override the todo's per-file
8
+ # grandfathering, and the todo becomes inert on those cops. Empirically
9
+ # verified on suma 2026-07-06: with todo listed first, 34 Metrics/* offenses
10
+ # remained; moved last, cleared. Every gem in the metanorma-org fleet
11
+ # already ships a `.rubocop_todo.yml` on its live tree (audited 2026-07-06,
12
+ # 54/54 have it), so this reference is safe to emit unconditionally.
13
+ - .rubocop_todo.yml
5
14
 
6
15
  # Rubocop plugins enabled centrally so every metanorma-org gem picks them up
7
16
  # on cimas sync — best practice belongs at the shared-template layer, not
@@ -150,6 +150,11 @@ a.FootnoteRef, span.FootnoteRef {
150
150
  vertical-align: super;
151
151
  }
152
152
 
153
+ a.TableFootnoteRef, a.FootnoteRef, a.footnote-number,
154
+ sup a, a:has(> sup) {
155
+ vertical-align: baseline;
156
+ }
157
+
153
158
  .addition {
154
159
  color: blue;
155
160
  }
@@ -150,6 +150,11 @@ a.FootnoteRef, span.FootnoteRef {
150
150
  vertical-align: super;
151
151
  }
152
152
 
153
+ a.TableFootnoteRef, a.FootnoteRef, a.footnote-number,
154
+ sup a, a:has(> sup) {
155
+ vertical-align: baseline;
156
+ }
157
+
153
158
  .addition {
154
159
  color: blue;
155
160
  }
@@ -5644,45 +5644,59 @@
5644
5644
 
5645
5645
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
5646
5646
 
5647
- <xsl:variable name="title-list-tables">
5648
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
5649
- <xsl:value-of select="$toc_table_title"/>
5650
- <xsl:if test="normalize-space($toc_table_title) = ''">
5651
- <xsl:call-template name="getLocalizedString">
5652
- <xsl:with-param name="key">toc_tables</xsl:with-param>
5653
- </xsl:call-template>
5654
- </xsl:if>
5655
- </xsl:variable>
5647
+ <xsl:variable name="toc_title_lists_">
5648
+ <xsl:for-each select="//mn:metanorma">
5649
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
5650
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
5651
+ <xsl:variable name="current_document">
5652
+ <xsl:copy-of select="."/>
5653
+ </xsl:variable>
5654
+ <xsl:for-each select="xalan:nodeset($current_document)">
5655
+ <mnx:doc id="{$docid}" num="{$num}">
5656
+ <mnx:title-list-tables>
5657
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
5658
+ <xsl:value-of select="$toc_table_title"/>
5659
+ <xsl:if test="normalize-space($toc_table_title) = ''">
5660
+ <xsl:call-template name="getLocalizedString">
5661
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
5662
+ </xsl:call-template>
5663
+ </xsl:if>
5664
+ </mnx:title-list-tables>
5656
5665
 
5657
- <xsl:variable name="title-list-figures">
5658
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
5659
- <xsl:value-of select="$toc_figure_title"/>
5660
- <xsl:if test="normalize-space($toc_figure_title) = ''">
5661
- <xsl:call-template name="getLocalizedString">
5662
- <xsl:with-param name="key">toc_figures</xsl:with-param>
5663
- </xsl:call-template>
5664
- </xsl:if>
5665
- </xsl:variable>
5666
+ <mnx:title-list-figures>
5667
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
5668
+ <xsl:value-of select="$toc_figure_title"/>
5669
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
5670
+ <xsl:call-template name="getLocalizedString">
5671
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
5672
+ </xsl:call-template>
5673
+ </xsl:if>
5674
+ </mnx:title-list-figures>
5666
5675
 
5667
- <xsl:variable name="title-list-examples">
5668
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
5669
- <xsl:value-of select="$toc_example_title"/>
5670
- <xsl:if test="normalize-space($toc_example_title) = ''">
5671
- <xsl:call-template name="getLocalizedString">
5672
- <xsl:with-param name="key">toc_examples</xsl:with-param>
5673
- </xsl:call-template>
5674
- </xsl:if>
5675
- </xsl:variable>
5676
+ <mnx:title-list-examples>
5677
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
5678
+ <xsl:value-of select="$toc_example_title"/>
5679
+ <xsl:if test="normalize-space($toc_example_title) = ''">
5680
+ <xsl:call-template name="getLocalizedString">
5681
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
5682
+ </xsl:call-template>
5683
+ </xsl:if>
5684
+ </mnx:title-list-examples>
5676
5685
 
5677
- <xsl:variable name="title-list-recommendations">
5678
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
5679
- <xsl:value-of select="$toc_requirement_title"/>
5680
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
5681
- <xsl:call-template name="getLocalizedString">
5682
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
5683
- </xsl:call-template>
5684
- </xsl:if>
5686
+ <mnx:title-list-recommendations>
5687
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
5688
+ <xsl:value-of select="$toc_requirement_title"/>
5689
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
5690
+ <xsl:call-template name="getLocalizedString">
5691
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
5692
+ </xsl:call-template>
5693
+ </xsl:if>
5694
+ </mnx:title-list-recommendations>
5695
+ </mnx:doc>
5696
+ </xsl:for-each>
5697
+ </xsl:for-each>
5685
5698
  </xsl:variable>
5699
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
5686
5700
 
5687
5701
  <xsl:variable name="bibdata">
5688
5702
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -6514,7 +6528,7 @@
6514
6528
  <xsl:apply-templates mode="update_xml_step1"/>
6515
6529
  </xsl:template>
6516
6530
 
6517
- <xsl:template match="mn:semx" mode="update_xml_step1">
6531
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
6518
6532
  <xsl:apply-templates mode="update_xml_step1"/>
6519
6533
  </xsl:template>
6520
6534
 
@@ -6900,7 +6914,7 @@
6900
6914
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
6901
6915
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
6902
6916
 
6903
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
6917
+ <xsl:template match="text()[not( (ancestor::mn:bibdata and not(ancestor::mn:title)) or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or (ancestor::mn:fmt-name and not(ancestor::mn:semx[@element = 'name'])) or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
6904
6918
 
6905
6919
  <xsl:variable name="parent" select="local-name(..)"/>
6906
6920
 
@@ -6945,7 +6959,7 @@
6945
6959
  <xsl:variable name="text">
6946
6960
  <xsl:element name="text" namespace="{$namespace_full}">
6947
6961
  <xsl:choose>
6948
- <xsl:when test="ancestor::mn:table"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
6962
+ <xsl:when test="ancestor::mn:table and not(ancestor::mn:fmt-name)"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
6949
6963
  <xsl:otherwise>
6950
6964
  <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
6951
6965
  <!-- <xsl:value-of select="$text__"/> -->
@@ -7023,6 +7037,10 @@
7023
7037
  <xsl:copy-of select="."/>
7024
7038
  </xsl:template>
7025
7039
 
7040
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
7041
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
7042
+ </xsl:template>
7043
+
7026
7044
  <xsl:template name="replace_text_tags">
7027
7045
  <xsl:param name="tag_open"/>
7028
7046
  <xsl:param name="tag_close"/>
@@ -14415,6 +14433,7 @@
14415
14433
  <xsl:variable name="svg_content">
14416
14434
  <xsl:apply-templates select="." mode="svg_update"/>
14417
14435
  </xsl:variable>
14436
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
14418
14437
 
14419
14438
  <xsl:variable name="alt-text">
14420
14439
  <xsl:choose>
@@ -14629,7 +14648,7 @@
14629
14648
  </xsl:copy>
14630
14649
  </xsl:template>
14631
14650
 
14632
- <xsl:template match="mn:image/@href" mode="svg_update">
14651
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
14633
14652
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
14634
14653
  <xsl:value-of select="."/>
14635
14654
  </xsl:attribute>
@@ -17326,13 +17345,13 @@
17326
17345
 
17327
17346
  <xsl:template name="processTablesFigures_Contents">
17328
17347
  <xsl:param name="always"/>
17329
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
17348
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
17330
17349
  <xsl:call-template name="processTables_Contents"/>
17331
17350
  </xsl:if>
17332
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
17351
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
17333
17352
  <xsl:call-template name="processFigures_Contents"/>
17334
17353
  </xsl:if>
17335
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
17354
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
17336
17355
  <xsl:call-template name="processExamples_Contents"/>
17337
17356
  </xsl:if>
17338
17357
  </xsl:template>
@@ -17383,22 +17402,22 @@
17383
17402
 
17384
17403
  <xsl:template name="processExamples_Contents">
17385
17404
  <mnx:examples>
17386
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
17387
- <xsl:choose>
17388
- <xsl:when test="mn:fmt-name">
17389
- <xsl:variable name="fmt_name">
17390
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
17391
- </xsl:variable>
17392
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
17393
- <xsl:copy-of select="$fmt_name"/>
17394
- </mnx:example>
17395
- </xsl:when>
17396
- <xsl:otherwise>
17397
- <mnx:example id="{@id}" alt-text="{mn:name}">
17398
- <xsl:copy-of select="mn:name"/>
17399
- </mnx:example>
17400
- </xsl:otherwise>
17401
- </xsl:choose>
17405
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
17406
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
17407
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
17408
+ with the last two elements dropped if //example/name does not exist. -->
17409
+ <xsl:variable name="example_name">
17410
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
17411
+ </xsl:variable>
17412
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
17413
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
17414
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
17415
+ <xsl:if test="normalize-space($example_name) != ''">
17416
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
17417
+ <xsl:copy-of select="$example_name"/>
17418
+ </xsl:if>
17419
+ </xsl:element>
17420
+ </mnx:example>
17402
17421
  </xsl:for-each>
17403
17422
  </mnx:examples>
17404
17423
  </xsl:template>
@@ -17671,15 +17690,18 @@
17671
17690
 
17672
17691
  <xsl:call-template name="insertFigureBookmarks">
17673
17692
  <xsl:with-param name="contents" select="mnx:contents"/>
17693
+ <xsl:with-param name="num" select="@num"/>
17674
17694
  </xsl:call-template>
17675
17695
 
17676
17696
  <xsl:call-template name="insertTableBookmarks">
17677
17697
  <xsl:with-param name="contents" select="mnx:contents"/>
17698
+ <xsl:with-param name="num" select="@num"/>
17678
17699
  <xsl:with-param name="lang" select="@lang"/>
17679
17700
  </xsl:call-template>
17680
17701
 
17681
17702
  <xsl:call-template name="insertExampleBookmarks">
17682
17703
  <xsl:with-param name="contents" select="mnx:contents"/>
17704
+ <xsl:with-param name="num" select="@num"/>
17683
17705
  <xsl:with-param name="lang" select="@lang"/>
17684
17706
  </xsl:call-template>
17685
17707
 
@@ -17694,15 +17716,18 @@
17694
17716
 
17695
17717
  <xsl:call-template name="insertFigureBookmarks">
17696
17718
  <xsl:with-param name="contents" select="mnx:contents"/>
17719
+ <xsl:with-param name="num" select="@num"/>
17697
17720
  </xsl:call-template>
17698
17721
 
17699
17722
  <xsl:call-template name="insertTableBookmarks">
17700
17723
  <xsl:with-param name="contents" select="mnx:contents"/>
17724
+ <xsl:with-param name="num" select="@num"/>
17701
17725
  <xsl:with-param name="lang" select="@lang"/>
17702
17726
  </xsl:call-template>
17703
17727
 
17704
17728
  <xsl:call-template name="insertExampleBookmarks">
17705
17729
  <xsl:with-param name="contents" select="mnx:contents"/>
17730
+ <xsl:with-param name="num" select="@num"/>
17706
17731
  <xsl:with-param name="lang" select="@lang"/>
17707
17732
  </xsl:call-template>
17708
17733
 
@@ -17715,15 +17740,18 @@
17715
17740
 
17716
17741
  <xsl:call-template name="insertFigureBookmarks">
17717
17742
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
17743
+ <xsl:with-param name="num" select="@num"/>
17718
17744
  </xsl:call-template>
17719
17745
 
17720
17746
  <xsl:call-template name="insertTableBookmarks">
17721
17747
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
17748
+ <xsl:with-param name="num" select="@num"/>
17722
17749
  <xsl:with-param name="lang" select="@lang"/>
17723
17750
  </xsl:call-template>
17724
17751
 
17725
17752
  <xsl:call-template name="insertExampleBookmarks">
17726
17753
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
17754
+ <xsl:with-param name="num" select="@num"/>
17727
17755
  <xsl:with-param name="lang" select="@lang"/>
17728
17756
  </xsl:call-template>
17729
17757
 
@@ -17739,6 +17767,7 @@
17739
17767
 
17740
17768
  <xsl:template name="insertFigureBookmarks">
17741
17769
  <xsl:param name="contents"/>
17770
+ <xsl:param name="num"/>
17742
17771
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
17743
17772
  <xsl:if test="$contents_nodes/mnx:figure">
17744
17773
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -17756,7 +17785,7 @@
17756
17785
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
17757
17786
 
17758
17787
  <xsl:variable name="bookmark-title">
17759
- <xsl:value-of select="$title-list-figures"/>
17788
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
17760
17789
  </xsl:variable>
17761
17790
  <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
17762
17791
  <xsl:for-each select="$contents_nodes//mnx:figures/mnx:figure">
@@ -17770,6 +17799,7 @@
17770
17799
 
17771
17800
  <xsl:template name="insertTableBookmarks">
17772
17801
  <xsl:param name="contents"/>
17802
+ <xsl:param name="num"/>
17773
17803
  <xsl:param name="lang"/>
17774
17804
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
17775
17805
  <xsl:if test="$contents_nodes/mnx:table">
@@ -17793,7 +17823,7 @@
17793
17823
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
17794
17824
 
17795
17825
  <xsl:variable name="bookmark-title">
17796
- <xsl:value-of select="$title-list-tables"/>
17826
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
17797
17827
  </xsl:variable>
17798
17828
 
17799
17829
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -17808,8 +17838,9 @@
17808
17838
  </xsl:if>
17809
17839
  </xsl:template> <!-- insertTableBookmarks -->
17810
17840
 
17811
- <xsl:template name="insertExampleBookmarks">
17841
+ <xsl:template name="insertExampleBookmarks">
17812
17842
  <xsl:param name="contents"/>
17843
+ <xsl:param name="num"/>
17813
17844
  <xsl:param name="lang"/>
17814
17845
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
17815
17846
  <xsl:if test="$contents_nodes/mnx:example">
@@ -17833,7 +17864,7 @@
17833
17864
  <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
17834
17865
 
17835
17866
  <xsl:variable name="bookmark-title">
17836
- <xsl:value-of select="$title-list-examples"/>
17867
+ <xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
17837
17868
  </xsl:variable>
17838
17869
 
17839
17870
  <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
@@ -17994,6 +18025,18 @@
17994
18025
  </xsl:copy>
17995
18026
  </xsl:template>
17996
18027
 
18028
+ <xsl:template match="mn:tt" mode="contents_item">
18029
+ <xsl:copy>
18030
+ <xsl:apply-templates mode="contents_item"/>
18031
+ </xsl:copy>
18032
+ </xsl:template>
18033
+
18034
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
18035
+ <xsl:copy>
18036
+ <xsl:apply-templates mode="contents_item"/>
18037
+ </xsl:copy>
18038
+ </xsl:template>
18039
+
17997
18040
  <xsl:template match="mn:stem" mode="contents_item"/>
17998
18041
  <xsl:template match="mn:fmt-stem" mode="contents_item">
17999
18042
  <xsl:copy-of select="."/>
@@ -1931,7 +1931,7 @@ or as the string "auto"</a:documentation>
1931
1931
  </element>
1932
1932
  </define>
1933
1933
  <define name="mathml">
1934
- <a:documentation>Encoding of MathML: the official W3C MathML 3.0 grammar (namespace
1934
+ <a:documentation>Encoding of MathML: the official W3C MathML 4 grammar (namespace
1935
1935
  http://www.w3.org/1998/Math/MathML), via the metanorma wrapper in
1936
1936
  grammars/mathml/. See grammars/mathml/README.adoc and basicdoc-models#35.</a:documentation>
1937
1937
  <externalRef href="metanorma-mathml.rng"/>
@@ -93,29 +93,31 @@ module Metanorma
93
93
  end
94
94
  end
95
95
 
96
- def pub_class_prep(bib)
97
- iso = bib.at("#{PUBLISHER}[abbreviation = 'ISO']") ||
98
- bib.at("#{PUBLISHER}[name = 'International Organization " \
99
- "for Standardization']")
100
- iec = bib.at("#{PUBLISHER}[abbreviation = 'IEC']") ||
101
- bib.at("#{PUBLISHER}[name = 'International " \
102
- "Electrotechnical Commission']")
103
- jis = bib.at("#{PUBLISHER}[abbreviation = 'JIS']") ||
104
- bib.at("#{PUBLISHER}[name = '#{@conv.pub_hash['ja']}']") ||
105
- bib.at("#{PUBLISHER}[name = '#{@conv.pub_hash['en']}']")
106
- [iso, iec, jis]
96
+ # JIS first, then ISO, then IEC, then other standards, then everything
97
+ # else. A co-publisher is ordered by the secondary key (see
98
+ # Standoc::Ref#publisher_sort_second), which reproduces the historical
99
+ # JIS ordering: JIS+IEC before JIS+ISO, JIS+IEC+ISO alongside JIS+IEC.
100
+ # Built at runtime because the JIS publisher name is language-dependent
101
+ # (@conv.pub_hash). Overridable per-document / per-taste via
102
+ # :sort-biblio-<abbrev>:.
103
+ def default_publisher_sort
104
+ [
105
+ { abbrev: "JIS",
106
+ name: [@conv.pub_hash["ja"], @conv.pub_hash["en"]].compact,
107
+ rank: 1 },
108
+ { abbrev: "ISO",
109
+ name: "International Organization for Standardization", rank: 2 },
110
+ { abbrev: "IEC", name: "International Electrotechnical Commission",
111
+ rank: 3 },
112
+ ]
107
113
  end
108
114
 
109
115
  def pub_class(bib)
110
- iso, iec, jis = pub_class_prep(bib)
111
- jis && iec && iso and return 2
112
- jis && iec and return 2
113
- jis && iso and return 3
114
- jis and return 1
115
- iso && iec and return 4
116
- iso and return 4
117
- iec and return 5
118
- 6
116
+ publisher_sort_rank(bib, default_publisher_sort)
117
+ end
118
+
119
+ def second_pub_class(bib, _first_pub = nil)
120
+ publisher_sort_second(bib, default_publisher_sort)
119
121
  end
120
122
  end
121
123
  end