metanorma-jis 0.6.7 → 1.0.1

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: cc35660a3519ecd96fc405bb9b779a5faa4e0beec0c5c8e9f3d10b097ec59383
4
- data.tar.gz: 338cc7fa6625b69488b162d8d9d859c4def0715213b6bbe6d8312df083b5c6cf
3
+ metadata.gz: 4f4b866779290adcd5a6ebfa304c2bcd11efdcfa039ad8e32b9bf1a7fd0d8420
4
+ data.tar.gz: ff89ac0602425434bdc8711c4ce6856475aed99f509f4b39cb4d7cec898da379
5
5
  SHA512:
6
- metadata.gz: 940badc26918dc33e357b8d7e3ae290f5f4ba9f4ac2adc21893d6e4af347125171ceeb498c72ecb045a1d4ef620d1efac8adf1f45f25c11a81a8d344e26ba68c
7
- data.tar.gz: 04fb252ad1bab143b1c08be8121e4859ef26e33d79d97515aadb149e023b2c0c3f7a89ae8a487dbd7c4e5de19177fafeaacf1ce432224fec21724284d270b226
6
+ metadata.gz: 3b4b622379cda25fb154f58be052fd2dd102bf9c18d7c8e6bdb2ac97827ba41b7f0bea44525690a1ac644257ddeff9cfaec1d2542c38ec7ab9b36e58415169e4
7
+ data.tar.gz: 14a62cf400fa6142ec8d4f4e39d3e86c10d85a5a0c2374fbd93d4e8723b95cc501f6875480fcd0dd531881e052f9b88676d6c3e95bf42323342f422c7d36a512
@@ -9,6 +9,10 @@ chairperson: chairperson
9
9
  membership_table: Membership Table
10
10
  full_name: Full Name
11
11
  affiliation: Affiliation
12
+ norm_with_refs_pref_all_dated: The following reference standards, when cited in this Standard, constitute the requirements of this Standard in whole or in part. The editions of these reference standards in the years indicated apply, and subsequent revisions (including amendments) do not apply.
13
+ norm_with_refs_pref_none_dated: The following reference standards, when incorporated into this Standard, constitute requirements of this Standard in whole or in part. The latest editions (including amendments) of these reference standards shall apply.
14
+ modified_detail: modified
15
+ version_cardinal: "Version {{ var1 }}"
12
16
  doctype_dict:
13
17
  international-standard: International standard
14
18
  japanese-industrial-standard: International standard
@@ -22,3 +26,8 @@ doctype_dict:
22
26
  directive: Directive
23
27
  stage_dict:
24
28
  international-standard: International standard
29
+ punct:
30
+ open-title:
31
+ close-title:
32
+ open-secondary-title:
33
+ close-secondary-title:
@@ -15,6 +15,8 @@ membership_table: 構成表
15
15
  full_name: 氏名
16
16
  affiliation: 所属
17
17
  toc_page: 頁
18
+ modified_detail: を一部変更し
19
+ version_cardinal: "第{{ var1 }}版"
18
20
  doctype_dict:
19
21
  international-standard: 日本産業規格
20
22
  japanese-industrial-standard: 日本産業規格
@@ -28,3 +30,11 @@ doctype_dict:
28
30
  directive: Directive
29
31
  stage_dict:
30
32
  international-standard: 日本産業規格
33
+ punct:
34
+ open-title:
35
+ close-title:
36
+ open-secondary-title:
37
+ close-secondary-title:
38
+ # We need the trailing half-width space, to allow it to be converted to cjk-latin-separator if Latn text follows
39
+ biblio-field-delimiter: "。 "
40
+ biblio-terminator: ""
@@ -1900,57 +1900,6 @@
1900
1900
  <xsl:call-template name="getLevel"/>
1901
1901
  </xsl:variable>
1902
1902
 
1903
- <xsl:variable name="font-family">
1904
- <xsl:choose>
1905
- <xsl:when test="$vertical_layout = 'true'">Noto Sans JP</xsl:when>
1906
- <xsl:otherwise>IPAexGothic</xsl:otherwise>
1907
- </xsl:choose>
1908
- </xsl:variable>
1909
-
1910
- <xsl:variable name="font-size">
1911
- <xsl:choose>
1912
- <xsl:when test="$vertical_layout = 'true'">12pt</xsl:when>
1913
- <xsl:otherwise>
1914
- <xsl:choose>
1915
- <xsl:when test="@type = 'section-title'">18pt</xsl:when>
1916
- <xsl:when test="@ancestor = 'foreword' and $level = '1'">14pt</xsl:when>
1917
- <xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::mn:annex[1][@commentary = 'true']">16pt</xsl:when>
1918
- <xsl:when test="@ancestor = 'annex' and $level = '1'">14pt</xsl:when>
1919
- <xsl:otherwise>10pt</xsl:otherwise>
1920
- </xsl:choose>
1921
- </xsl:otherwise>
1922
- </xsl:choose>
1923
- </xsl:variable>
1924
-
1925
- <xsl:variable name="font-weight">
1926
- <xsl:choose>
1927
- <xsl:when test="$vertical_layout = 'true'">500</xsl:when> <!-- bold, or 500 (medium) ? -->
1928
- <xsl:otherwise>normal</xsl:otherwise>
1929
- </xsl:choose>
1930
- </xsl:variable>
1931
-
1932
- <xsl:variable name="text-align">
1933
- <xsl:choose>
1934
- <xsl:when test="@ancestor = 'foreword' and $level = 1">center</xsl:when>
1935
- <xsl:when test="@ancestor = 'annex' and $level = 1">center</xsl:when>
1936
- <xsl:otherwise>left</xsl:otherwise>
1937
- </xsl:choose>
1938
- </xsl:variable>
1939
-
1940
- <xsl:variable name="margin-top">
1941
- <xsl:choose>
1942
- <xsl:when test="@ancestor = 'foreword' and $level = 1">9mm</xsl:when>
1943
- <xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::mn:annex[1][@commentary = 'true']">1mm</xsl:when>
1944
- <xsl:when test="$level = 1">6.5mm</xsl:when>
1945
- <xsl:when test="@ancestor = 'foreword' and $level = 2">0mm</xsl:when>
1946
- <xsl:when test="@ancestor = 'annex' and $level = 2">4.5mm</xsl:when>
1947
- <xsl:when test="@ancestor = 'bibliography' and $level = 2">0mm</xsl:when>
1948
- <xsl:when test="$level = 2">2mm</xsl:when>
1949
- <xsl:when test="$level &gt;= 3">2mm</xsl:when>
1950
- <xsl:otherwise>0mm</xsl:otherwise>
1951
- </xsl:choose>
1952
- </xsl:variable>
1953
-
1954
1903
  <xsl:variable name="element-name">
1955
1904
  <xsl:choose>
1956
1905
  <xsl:when test="@inline-header = 'true'">fo:inline</xsl:when>
@@ -1958,24 +1907,11 @@
1958
1907
  </xsl:choose>
1959
1908
  </xsl:variable>
1960
1909
 
1961
- <xsl:variable name="margin-bottom">
1962
- <xsl:choose>
1963
- <xsl:when test="@ancestor = 'foreword' and $level = 1">9mm</xsl:when>
1964
- <xsl:when test="@ancestor = 'annex' and $level = '1' and preceding-sibling::mn:annex[1][@commentary = 'true']">7mm</xsl:when>
1965
- <xsl:when test="$level = 1 and following-sibling::mn:clause">8pt</xsl:when>
1966
- <xsl:when test="$level = 1">12pt</xsl:when>
1967
- <xsl:when test="$level = 2 and following-sibling::mn:clause">8pt</xsl:when>
1968
- <xsl:when test="$level &gt;= 2">12pt</xsl:when>
1969
- <xsl:when test="@type = 'section-title'">6mm</xsl:when>
1970
- <xsl:when test="@inline-header = 'true'">0pt</xsl:when>
1971
- <xsl:when test="@ancestor = 'annex' and $level = 1">6mm</xsl:when>
1972
- <xsl:otherwise>0mm</xsl:otherwise>
1973
- </xsl:choose>
1974
- </xsl:variable>
1975
-
1976
1910
  <!-- to space-before Foreword -->
1977
1911
  <xsl:if test="@ancestor = 'foreword' and $level = '1'"><fo:block/></xsl:if>
1978
1912
 
1913
+ <xsl:variable name="title_styles"><styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles></xsl:variable>
1914
+
1979
1915
  <xsl:choose>
1980
1916
  <xsl:when test="@inline-header = 'true' and following-sibling::*[1][self::mn:p]">
1981
1917
  <fo:block role="H{$level}">
@@ -1988,25 +1924,7 @@
1988
1924
  </xsl:when>
1989
1925
  <xsl:otherwise>
1990
1926
  <xsl:element name="{$element-name}">
1991
- <xsl:attribute name="font-family"><xsl:value-of select="$font-family"/></xsl:attribute>
1992
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
1993
- <xsl:attribute name="font-weight"><xsl:value-of select="$font-weight"/></xsl:attribute>
1994
- <xsl:attribute name="text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
1995
- <xsl:attribute name="space-before"><xsl:value-of select="$margin-top"/></xsl:attribute>
1996
- <xsl:attribute name="margin-bottom"><xsl:value-of select="$margin-bottom"/></xsl:attribute>
1997
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1998
- <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
1999
-
2000
- <xsl:if test="@type = 'floating-title' or @type = 'section-title'">
2001
- <xsl:copy-of select="@id"/>
2002
- </xsl:if>
2003
-
2004
- <xsl:if test="$vertical_layout = 'true'">
2005
- <!-- <xsl:attribute name="letter-spacing">1mm</xsl:attribute> -->
2006
- <xsl:if test="not($text-align = 'center')">
2007
- <xsl:attribute name="margin-left">-6mm</xsl:attribute>
2008
- </xsl:if>
2009
- </xsl:if>
1927
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
2010
1928
 
2011
1929
  <!-- if first and last childs are `add` ace-tag, then move start ace-tag before title -->
2012
1930
  <xsl:if test="mn:tab[1]/following-sibling::node()[last()][self::mn:add][starts-with(text(), $ace_tag)]">
@@ -2165,46 +2083,14 @@
2165
2083
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
2166
2084
  <xsl:variable name="element-name">fo:block</xsl:variable>
2167
2085
 
2168
- <xsl:element name="{$element-name}">
2169
- <xsl:call-template name="setBlockAttributes">
2170
- <xsl:with-param name="text_align_default">justify</xsl:with-param>
2171
- </xsl:call-template>
2172
- <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
2173
-
2174
- <xsl:if test="not(parent::mn:note or parent::mn:li or ancestor::mn:table)">
2175
- <xsl:attribute name="text-indent"><xsl:value-of select="$text_indent"/>mm</xsl:attribute>
2176
- </xsl:if>
2177
-
2178
- <xsl:copy-of select="@id"/>
2179
-
2180
- <xsl:attribute name="line-height">1.5</xsl:attribute>
2181
- <!-- bookmarks only in paragraph -->
2182
-
2183
- <xsl:if test="count(mn:bookmark) != 0 and count(*) = count(mn:bookmark) and normalize-space() = ''">
2184
- <xsl:attribute name="font-size">0</xsl:attribute>
2185
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2186
- <xsl:attribute name="line-height">0</xsl:attribute>
2187
- </xsl:if>
2188
-
2189
- <xsl:if test="ancestor::*[@key = 'true']">
2190
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2191
- </xsl:if>
2192
-
2193
- <xsl:if test="parent::mn:fmt-definition">
2194
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2195
- </xsl:if>
2196
-
2197
- <xsl:if test="parent::mn:li or following-sibling::*[1][self::mn:ol or self::mn:ul or self::mn:note or self::mn:example] or parent::mn:quote">
2198
- <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
2199
- </xsl:if>
2200
-
2201
- <xsl:if test="parent::mn:td or parent::mn:th or parent::mn:dd">
2202
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2203
- </xsl:if>
2086
+ <xsl:variable name="p_styles">
2087
+ <styles xsl:use-attribute-sets="p-style">
2088
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
2089
+ </styles>
2090
+ </xsl:variable>
2204
2091
 
2205
- <xsl:if test="parent::mn:clause[@type = 'inner-cover-note'] or ancestor::mn:boilerplate">
2206
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2207
- </xsl:if>
2092
+ <xsl:element name="{$element-name}">
2093
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
2208
2094
 
2209
2095
  <xsl:apply-templates>
2210
2096
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -7680,6 +7566,10 @@
7680
7566
  </xsl:element>
7681
7567
  </xsl:template>
7682
7568
 
7569
+ <!-- show sourcecode's name 'before' or 'after' source code -->
7570
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
7571
+ </xsl:variable>
7572
+
7683
7573
  <xsl:template match="mn:sourcecode" name="sourcecode">
7684
7574
 
7685
7575
  <xsl:variable name="sourcecode_attributes">
@@ -7703,7 +7593,12 @@
7703
7593
 
7704
7594
  <xsl:call-template name="refine_sourcecode-container-style"/>
7705
7595
 
7706
- <fo:block-container margin-left="0mm" role="SKIP">
7596
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
7597
+
7598
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
7599
+ <xsl:if test="$sourcecode-name-position = 'before'">
7600
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
7601
+ </xsl:if>
7707
7602
 
7708
7603
  <fo:block xsl:use-attribute-sets="sourcecode-style">
7709
7604
 
@@ -7725,7 +7620,16 @@
7725
7620
  </fo:block>
7726
7621
 
7727
7622
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
7728
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
7623
+
7624
+ <!-- <xsl:choose>
7625
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
7626
+ <xsl:otherwise>
7627
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
7628
+ <!-- </xsl:otherwise>
7629
+ </xsl:choose> -->
7630
+ <xsl:if test="$sourcecode-name-position = 'after'">
7631
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
7632
+ </xsl:if>
7729
7633
 
7730
7634
  </fo:block-container>
7731
7635
  </fo:block-container>
@@ -13623,6 +13527,10 @@
13623
13527
  <!-- image -->
13624
13528
  <!-- ====== -->
13625
13529
 
13530
+ <!-- show figure's name 'before' or 'after' image -->
13531
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
13532
+ </xsl:variable>
13533
+
13626
13534
  <xsl:template match="mn:figure" name="figure">
13627
13535
  <xsl:variable name="isAdded" select="@added"/>
13628
13536
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -13635,6 +13543,10 @@
13635
13543
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
13636
13544
  </xsl:call-template>
13637
13545
 
13546
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
13547
+ <xsl:apply-templates select="mn:fmt-name"/>
13548
+ </xsl:if>
13549
+
13638
13550
  <!-- Example: Dimensions in millimeters -->
13639
13551
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
13640
13552
 
@@ -13660,7 +13572,16 @@
13660
13572
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
13661
13573
  <xsl:call-template name="showFigureKey"/>
13662
13574
  </xsl:if>
13663
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
13575
+
13576
+ <!-- <xsl:choose>
13577
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
13578
+ <xsl:otherwise>
13579
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
13580
+ <!-- </xsl:otherwise>
13581
+ </xsl:choose> -->
13582
+ <xsl:if test="$figure-name-position = 'after'">
13583
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
13584
+ </xsl:if>
13664
13585
 
13665
13586
  </fo:block-container>
13666
13587
  <xsl:if test="$vertical_layout = 'true'">
@@ -15852,11 +15773,10 @@
15852
15773
  <!-- END Admonition -->
15853
15774
  <!-- ================ -->
15854
15775
 
15855
- <xsl:attribute-set name="references-non-normative-title-style">
15776
+ <xsl:attribute-set name="bibliography-title-style">
15856
15777
  </xsl:attribute-set>
15857
15778
 
15858
- <xsl:template name="refine_references-non-normative-title-style">
15859
-
15779
+ <xsl:template name="refine_bibliography-title-style">
15860
15780
  </xsl:template>
15861
15781
 
15862
15782
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -17946,9 +17866,18 @@
17946
17866
  <!-- ===================================== -->
17947
17867
 
17948
17868
  <xsl:attribute-set name="annex-title-style">
17949
- </xsl:attribute-set>
17869
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
17870
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
17871
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
17872
+ <xsl:attribute name="text-align">center</xsl:attribute>
17873
+ </xsl:attribute-set> <!-- annex-title-style -->
17950
17874
 
17951
17875
  <xsl:template name="refine_annex-title-style">
17876
+ <xsl:if test="preceding-sibling::mn:annex[1][@commentary = 'true']">
17877
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
17878
+ <xsl:attribute name="space-before">1mm</xsl:attribute>
17879
+ <xsl:attribute name="margin-bottom">7mm</xsl:attribute>
17880
+ </xsl:if>
17952
17881
  </xsl:template>
17953
17882
 
17954
17883
  <xsl:attribute-set name="p-zzSTDTitle1-style">
@@ -17957,6 +17886,146 @@
17957
17886
  <xsl:template name="refine_p-zzSTDTitle1-style">
17958
17887
  </xsl:template>
17959
17888
 
17889
+ <xsl:attribute-set name="p-style">
17890
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
17891
+ <xsl:attribute name="line-height">1.5</xsl:attribute>
17892
+ </xsl:attribute-set> <!-- p-style -->
17893
+
17894
+ <xsl:template name="refine_p-style">
17895
+ <xsl:param name="element-name"/>
17896
+ <xsl:param name="margin"/>
17897
+ <xsl:call-template name="setBlockAttributes">
17898
+ <xsl:with-param name="text_align_default">justify</xsl:with-param>
17899
+ </xsl:call-template>
17900
+
17901
+ <xsl:if test="not(parent::mn:note or parent::mn:li or ancestor::mn:table)">
17902
+ <xsl:attribute name="text-indent"><xsl:value-of select="$text_indent"/>mm</xsl:attribute>
17903
+ </xsl:if>
17904
+
17905
+ <xsl:copy-of select="@id"/>
17906
+
17907
+ <!-- bookmarks only in paragraph -->
17908
+
17909
+ <xsl:if test="count(mn:bookmark) != 0 and count(*) = count(mn:bookmark) and normalize-space() = ''">
17910
+ <xsl:attribute name="font-size">0</xsl:attribute>
17911
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
17912
+ <xsl:attribute name="line-height">0</xsl:attribute>
17913
+ </xsl:if>
17914
+
17915
+ <xsl:if test="ancestor::*[@key = 'true']">
17916
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
17917
+ </xsl:if>
17918
+
17919
+ <xsl:if test="parent::mn:fmt-definition">
17920
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
17921
+ </xsl:if>
17922
+
17923
+ <xsl:if test="parent::mn:li or following-sibling::*[1][self::mn:ol or self::mn:ul or self::mn:note or self::mn:example] or parent::mn:quote">
17924
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
17925
+ </xsl:if>
17926
+
17927
+ <xsl:if test="parent::mn:td or parent::mn:th or parent::mn:dd">
17928
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
17929
+ </xsl:if>
17930
+
17931
+ <xsl:if test="parent::mn:clause[@type = 'inner-cover-note'] or ancestor::mn:boilerplate">
17932
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
17933
+ </xsl:if>
17934
+ <!-- $namespace = 'jis' -->
17935
+
17936
+ </xsl:template> <!-- refine_p-style -->
17937
+
17938
+ <xsl:attribute-set name="title-style">
17939
+ <!-- Note: font-size for level 1 title -->
17940
+ <xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
17941
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
17942
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
17943
+ <xsl:attribute name="text-align">left</xsl:attribute>
17944
+ <xsl:attribute name="space-before">6.5mm</xsl:attribute>
17945
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
17946
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
17947
+ </xsl:attribute-set> <!-- title-style -->
17948
+
17949
+ <xsl:template name="refine_title-style">
17950
+ <xsl:param name="element-name"/>
17951
+ <xsl:variable name="level">
17952
+ <xsl:call-template name="getLevel"/>
17953
+ </xsl:variable>
17954
+
17955
+ <xsl:if test="@inline-header = 'true'">
17956
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
17957
+ </xsl:if>
17958
+
17959
+ <xsl:if test="@type = 'section-title'">
17960
+ <xsl:attribute name="margin-bottom">6mm</xsl:attribute>
17961
+ </xsl:if>
17962
+
17963
+ <xsl:if test="$level = 1">
17964
+ <xsl:if test="following-sibling::mn:clause">
17965
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
17966
+ </xsl:if>
17967
+ <xsl:if test="@ancestor = 'foreword'">
17968
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
17969
+ <xsl:attribute name="text-align">center</xsl:attribute>
17970
+ <xsl:attribute name="space-before">9mm</xsl:attribute>
17971
+ <xsl:attribute name="margin-bottom">9mm</xsl:attribute>
17972
+ </xsl:if>
17973
+ <xsl:if test="@ancestor = 'annex'"><!-- Annex title -->
17974
+ <xsl:variable name="annex_title_styles">
17975
+ <styles xsl:use-attribute-sets="annex-title-style"><xsl:call-template name="refine_annex-title-style"/></styles>
17976
+ </xsl:variable>
17977
+ <xsl:copy-of select="xalan:nodeset($annex_title_styles)/styles/@*"/>
17978
+ </xsl:if>
17979
+ <xsl:if test="@ancestor = 'bibliography'"><!-- Bibliography section title -->
17980
+ <xsl:variable name="bibliography_title_styles">
17981
+ <styles xsl:use-attribute-sets="bibliography-title-style"><xsl:call-template name="refine_bibliography-title-style"/></styles>
17982
+ </xsl:variable>
17983
+ <xsl:copy-of select="xalan:nodeset($bibliography_title_styles)/styles/@*"/>
17984
+ </xsl:if>
17985
+ </xsl:if>
17986
+
17987
+ <xsl:if test="$level = 2">
17988
+ <xsl:attribute name="space-before">2mm</xsl:attribute>
17989
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
17990
+ <xsl:if test="@ancestor = 'foreword'">
17991
+ <xsl:attribute name="space-before">0mm</xsl:attribute>
17992
+ </xsl:if>
17993
+ <xsl:if test="@ancestor = 'annex'">
17994
+ <xsl:attribute name="space-before">4.5mm</xsl:attribute>
17995
+ </xsl:if>
17996
+ <xsl:if test="@ancestor = 'bibliography'">
17997
+ <xsl:attribute name="space-before">0mm</xsl:attribute>
17998
+ </xsl:if>
17999
+ <xsl:if test="following-sibling::mn:clause">
18000
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
18001
+ </xsl:if>
18002
+ </xsl:if>
18003
+
18004
+ <xsl:if test="$level &gt;= 3">
18005
+ <xsl:attribute name="space-before">2mm</xsl:attribute>
18006
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
18007
+ </xsl:if>
18008
+
18009
+ <xsl:if test="@type = 'section-title'">
18010
+ <xsl:attribute name="font-size">18pt</xsl:attribute>
18011
+ </xsl:if>
18012
+
18013
+ <xsl:if test="@type = 'floating-title' or @type = 'section-title'">
18014
+ <xsl:copy-of select="@id"/>
18015
+ </xsl:if>
18016
+
18017
+ <xsl:if test="$vertical_layout = 'true'">
18018
+ <xsl:attribute name="font-family">Noto Sans JP</xsl:attribute>
18019
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
18020
+ <xsl:attribute name="font-weight">500</xsl:attribute>
18021
+ <xsl:if test="not($level = 1 and (@ancestor = 'foreword' or @ancestor = 'annex'))">
18022
+ <xsl:attribute name="margin-left">-6mm</xsl:attribute>
18023
+ </xsl:if>
18024
+ </xsl:if>
18025
+ <!-- $namespace = 'jis' -->
18026
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
18027
+ </xsl:template> <!-- refine_title-style -->
18028
+
17960
18029
  <xsl:template name="processPrefaceSectionsDefault">
17961
18030
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
17962
18031
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -18295,6 +18364,12 @@
18295
18364
  </xsl:choose>
18296
18365
  </xsl:template>
18297
18366
 
18367
+ <xsl:attribute-set name="reset-margins-style">
18368
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
18369
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
18370
+ <xsl:attribute name="role">SKIP</xsl:attribute>
18371
+ </xsl:attribute-set>
18372
+
18298
18373
  <xsl:attribute-set name="clause-style">
18299
18374
 
18300
18375
  </xsl:attribute-set>
@@ -19330,8 +19405,9 @@
19330
19405
 
19331
19406
  <xsl:template name="setTextAlignment">
19332
19407
  <xsl:param name="default">left</xsl:param>
19408
+ <xsl:param name="skip_default">false</xsl:param>
19333
19409
  <xsl:variable name="align" select="normalize-space(@align)"/>
19334
- <xsl:attribute name="text-align">
19410
+ <xsl:variable name="text_align">
19335
19411
  <xsl:choose>
19336
19412
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
19337
19413
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -19339,9 +19415,13 @@
19339
19415
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
19340
19416
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
19341
19417
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
19418
+ <xsl:when test="$skip_default = 'true'"/>
19342
19419
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
19343
19420
  </xsl:choose>
19344
- </xsl:attribute>
19421
+ </xsl:variable>
19422
+ <xsl:if test="normalize-space($text_align) != ''">
19423
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
19424
+ </xsl:if>
19345
19425
  <xsl:if test="$align = 'indent'">
19346
19426
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
19347
19427
  </xsl:if>
@@ -19349,8 +19429,10 @@
19349
19429
 
19350
19430
  <xsl:template name="setBlockAttributes">
19351
19431
  <xsl:param name="text_align_default">left</xsl:param>
19432
+ <xsl:param name="skip_text_align_default">false</xsl:param>
19352
19433
  <xsl:call-template name="setTextAlignment">
19353
19434
  <xsl:with-param name="default" select="$text_align_default"/>
19435
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
19354
19436
  </xsl:call-template>
19355
19437
  <xsl:call-template name="setKeepAttributes"/>
19356
19438
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -47,13 +47,17 @@ module IsoDoc
47
47
  node.children.to_xml.gsub(%r{</?p( [^>]*)?>}, "")
48
48
  end
49
49
 
50
+ def contains_para?(text)
51
+ /\([^()]+\)|([^()].+)/.match?(text)
52
+ end
53
+
50
54
  def source1_label(elem, sources, ancestor)
51
55
  elem.children = if ancestor == :table
52
- l10n("#{@i18n.source}: #{sources}")
53
- elsif /\(.+\)/.match?(sources)
54
- l10n("[#{@i18n.source}: #{sources}]")
56
+ l10n("#{@i18n.source}: #{esc sources}")
57
+ elsif contains_para?(sources)
58
+ l10n("[#{@i18n.source}: #{esc sources}]")
55
59
  else
56
- l10n("(#{@i18n.source}: #{sources})")
60
+ l10n("(#{@i18n.source}: #{esc sources})")
57
61
  end
58
62
  end
59
63
 
@@ -87,7 +91,7 @@ module IsoDoc
87
91
 
88
92
  def convert1(xml, filename, dir)
89
93
  j = xml.at(ns("//metanorma-extension/presentation-metadata/" \
90
- "autonumbering-style"))&.text
94
+ "autonumbering-style"))&.text
91
95
  j ||= "arabic"
92
96
  @autonumbering_style = j.to_sym
93
97
  @xrefs.autonumbering_style = j.to_sym
@@ -150,14 +154,10 @@ module IsoDoc
150
154
  end
151
155
 
152
156
  # if termsource xref has no SDO identifier, cite instead by full reference
153
- def citeas(xmldoc)
157
+ def anchor_linkend(node, linkend)
158
+ node.name == "fmt-origin" && fmt_origin_cite_full?(node) and
159
+ node["style"] ||= "short"
154
160
  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
161
  end
162
162
 
163
163
  def fmt_origin_cite_full?(elem)
@@ -177,8 +177,61 @@ module IsoDoc
177
177
  @lang == "ja" ? "、" : "; "
178
178
  end
179
179
 
180
+ def termsource_mod_text_delim(_elem)
181
+ @lang == "ja" ? "," : ", "
182
+ end
183
+
184
+ def termsource_modification(elem)
185
+ elem.xpath(".//text()[normalize-space() = '']").each(&:remove)
186
+ origin = elem.at(ns("./origin"))
187
+ mod = elem.at(ns("./modification"))
188
+ s = termsource_status(elem["status"])
189
+ mod && elem["status"] == "modified" and s = @i18n.modified_detail
190
+ s and origin.next = l10n(", #{s}", @lang, @script,
191
+ { prev: origin.text })
192
+ mod or return
193
+ termsource_add_modification_text(mod)
194
+ end
195
+
196
+ def termsource_label(elem, sources)
197
+ if contains_para?(sources)
198
+ elem.replace(l10n("[#{@i18n.source}: #{esc sources}]"))
199
+ else
200
+ elem.replace(l10n("(#{@i18n.source}: #{esc sources})"))
201
+ end
202
+ end
203
+
180
204
  def bracketed_refs_processing(docxml); end
181
205
 
206
+ def short_style_origin(docxml); end
207
+
208
+ def norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, bib)
209
+ delim = bib.at(ns("./language"))&.text == "ja" ? "&#x3000;" : "<esc>,</esc> "
210
+ ret = (idents[:ordinal] || idents[:metanorma] || idents[:sdo]).to_s
211
+ ret = esc(ret)
212
+ (idents[:ordinal] || idents[:metanorma]) && idents[:sdo] and
213
+ ret += "#{delim}<strong>#{esc idents[:sdo]}</strong>"
214
+ !idents[:ordinal] && !idents[:metanorma] && idents[:sdo] and
215
+ ret = "<strong>#{ret}</ret>"
216
+ ret += datefn
217
+ ret.empty? and return ret
218
+ idents[:sdo] and ret += delim
219
+ ret.sub(delim, "").strip.empty? and return ""
220
+ ret
221
+ end
222
+
223
+ def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, bib)
224
+ delim = bib.at(ns("./language"))&.text == "ja" ? "&#x3000;" : "<esc>,</esc> "
225
+ ret = esc(ids[:ordinal]) || esc(ids[:metanorma]) || "[#{esc ordinal.to_s}]"
226
+ if ids[:sdo] && !ids[:sdo].empty?
227
+ ret = prefix_bracketed_ref(ret)
228
+ ret += "#{esc ids[:sdo]}#{datefn}#{delim}"
229
+ else
230
+ ret = prefix_bracketed_ref("#{ret}#{datefn}")
231
+ end
232
+ ret
233
+ end
234
+
182
235
  include Init
183
236
  end
184
237
  end
@@ -690,7 +690,7 @@ Examples include GRID, LEI, CrossRef, and Ringgold</a:documentation>
690
690
  <define name="CitationType">
691
691
  <attribute name="bibitemid">
692
692
  <a:documentation>Bibliographic item that the citation applies to, referenced as the anchor of a bibliographic description</a:documentation>
693
- <data type="IDREF"/>
693
+ <ref name="IdRefType"/>
694
694
  </attribute>
695
695
  <choice>
696
696
  <zeroOrMore>
@@ -1296,17 +1296,17 @@ for which this claim of validity is made, if applicable</a:documentation>
1296
1296
  </define>
1297
1297
  <define name="validityBegins">
1298
1298
  <element name="validityBegins">
1299
- <ref name="ISO8601Date"/>
1299
+ <ref name="ISO8601DateTime"/>
1300
1300
  </element>
1301
1301
  </define>
1302
1302
  <define name="validityEnds">
1303
1303
  <element name="validityEnds">
1304
- <ref name="ISO8601Date"/>
1304
+ <ref name="ISO8601DateTime"/>
1305
1305
  </element>
1306
1306
  </define>
1307
1307
  <define name="validityRevision">
1308
1308
  <element name="revision">
1309
- <ref name="ISO8601Date"/>
1309
+ <ref name="ISO8601DateTime"/>
1310
1310
  </element>
1311
1311
  </define>
1312
1312
  <define name="TypedTitleString">
@@ -8,7 +8,6 @@ module Metanorma
8
8
  pref = if ref_empty?(ref) then @i18n.norm_empty_pref
9
9
  else @i18n.get[ref_dated(ref)]
10
10
  end
11
- #ref.at("./title").next = "<p>#{pref}</p>"
12
11
  ref.at("./title").next = boilerplate_snippet_convert(pref, isodoc)
13
12
  end
14
13
  end
@@ -91,3 +91,5 @@ module Metanorma
91
91
  end
92
92
  end
93
93
  end
94
+
95
+ require_relative "log"
@@ -100,13 +100,11 @@ module Metanorma
100
100
  def multiling_noko_value(value, tag, xml)
101
101
  if value.is_a?(Hash)
102
102
  value.each do |k, v|
103
- xml.send tag, language: k do |x|
104
- x << v
105
- end
103
+ add_noko_elem(xml, tag, v, language: k)
106
104
  end
107
105
  elsif value.is_a?(Array)
108
- value.each { |a| xml.send tag, a }
109
- else xml.send tag, value
106
+ value.each { |a| add_noko_elem(xml, tag, a) }
107
+ else add_noko_elem(xml, tag, value)
110
108
  end
111
109
  end
112
110
 
@@ -121,7 +119,7 @@ module Metanorma
121
119
  abbr = org[:abbr]
122
120
  abbr ||= org_abbrev[name_str]
123
121
  default_org && b = node&.attr("subdivision-abbr") and abbr = b
124
- abbr and xml.abbreviation abbr
122
+ add_noko_elem(xml, "abbreviation", abbr)
125
123
  end
126
124
 
127
125
  def copyright_parse(node)
@@ -145,8 +143,8 @@ module Metanorma
145
143
 
146
144
  def metadata_id(node, xml)
147
145
  if id = node.attr("docidentifier")
148
- xml.docidentifier id.sub(/^JIS /, ""),
149
- **attr_code(type: "JIS", primary: "true")
146
+ add_noko_elem(xml, "docidentifier", id.sub(/^JIS /, ""),
147
+ **attr_code(type: "JIS", primary: "true"))
150
148
  else iso_id(node, xml)
151
149
  end
152
150
  end
@@ -185,7 +183,8 @@ module Metanorma
185
183
 
186
184
  def iso_id_out(xml, params, _with_prf)
187
185
  id = iso_id_default(params).to_s(with_publisher: false)
188
- xml.docidentifier id.strip, type: "JIS", primary: "true"
186
+ add_noko_elem(xml, "docidentifier", id.strip, type: "JIS",
187
+ primary: "true")
189
188
  end
190
189
 
191
190
  def iso_id_default(params)
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.1.3 -->
3
+ <!-- VERSION v2.1.4 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -905,15 +905,32 @@ titlecase, or lowercase</a:documentation>
905
905
  </element>
906
906
  </define>
907
907
  <define name="image" combine="choice">
908
- <element name="svg">
909
- <a:documentation>Add svg mark up to image</a:documentation>
910
- <oneOrMore>
911
- <choice>
912
- <text/>
913
- <ref name="AnyElement"/>
914
- </choice>
915
- </oneOrMore>
916
- </element>
908
+ <choice>
909
+ <element name="image">
910
+ <ref name="RequiredId"/>
911
+ <ref name="ImageAttributes"/>
912
+ <optional>
913
+ <element name="svg">
914
+ <a:documentation>Allow svg in image/svg, for consistency</a:documentation>
915
+ <oneOrMore>
916
+ <choice>
917
+ <text/>
918
+ <ref name="AnyElement"/>
919
+ </choice>
920
+ </oneOrMore>
921
+ </element>
922
+ </optional>
923
+ </element>
924
+ <element name="svg">
925
+ <a:documentation>Add svg mark up to image</a:documentation>
926
+ <oneOrMore>
927
+ <choice>
928
+ <text/>
929
+ <ref name="AnyElement"/>
930
+ </choice>
931
+ </oneOrMore>
932
+ </element>
933
+ </choice>
917
934
  </define>
918
935
  <define name="ParagraphFnBody" combine="interleave">
919
936
  <ref name="BlockSource">
@@ -0,0 +1,20 @@
1
+ module Metanorma
2
+ module Jis
3
+ class Converter
4
+ JIS_LOG_MESSAGES = {
5
+ # rubocop:disable Naming/VariableNumber
6
+ "JIS_1": { category: "Document Attributes",
7
+ error: "%s is not a recognised document type",
8
+ severity: 2 },
9
+ "JIS_2": { category: "Document Attributes",
10
+ error: "%s is not a recognised script",
11
+ severity: 2 },
12
+ }.freeze
13
+ # rubocop:enable Naming/VariableNumber
14
+
15
+ def log_messages
16
+ super.merge(JIS_LOG_MESSAGES)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -4,15 +4,13 @@ module Metanorma
4
4
  def doctype_validate(_xmldoc)
5
5
  %w(japanese-industrial-standard technical-report
6
6
  technical-specification amendment).include? @doctype or
7
- @log.add("Document Attributes", nil,
8
- "#{@doctype} is not a recognised document type")
7
+ @log.add("JIS_1", nil, params: [@doctype])
9
8
  end
10
9
 
11
10
  def script_validate(xmldoc)
12
11
  script = xmldoc&.at("//bibdata/script")&.text
13
12
  %w(Jpan Latn).include?(script) or
14
- @log.add("Document Attributes", nil,
15
- "#{script} is not a recognised script")
13
+ @log.add("JIS_2", nil, params: [script])
16
14
  end
17
15
 
18
16
  def schema_file
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Jis
3
- VERSION = "0.6.7".freeze
3
+ VERSION = "1.0.1".freeze
4
4
  end
5
5
  end
6
6
 
@@ -16,28 +16,75 @@ nametemplate:
16
16
  # etal_count: 5
17
17
  seriestemplate: "{% if series_formatted %}{{ series_formatted }}{%else%}{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %} ({{series_run}}) {{series_num}}|({{series_partnumber}}){%endif%}"
18
18
  journaltemplate: "{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %} ({{series_run}}) {{ labels['volume'] }}_{{series_num}} {{ labels['part'] }}_{{series_partnumber}}"
19
+
20
+ citetemplate:
21
+ author_date: "{{ author }} {{ date}}"
22
+ author_date_br: "{{ author }} ({{ date}})"
23
+ author: "{{ author }}"
24
+ date: "{{ date }}"
25
+ reference_tag: "{{ biblio_tag }}"
26
+ title: "{{labels['punct']['open-title']}}|{{ title }}|{{labels['punct']['close-title']}}"
27
+ title_reference_tag: "{{labels['punct']['open-title']}}|{{ title }}|{{labels['punct']['close-title']}} {{ biblio_tag }}"
28
+ short:
29
+ standard: "{% if home_standard %}<span_class='stddocTitle'>{{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}}</span> ,_{{ extent }}{% else %}{{ creatornames }}$$$ <span_class='stddocTitle'>{{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}}</span> ,_{{ extent }} $$$ {{ version }}$$$ {{labels['updated'] | capitalize }}_{{date_updated}}$$$ {{status | capitalize}}$$$ {{ authorizer }}$$${% endif %}"
30
+ website: "{{ creatornames }} ({{ role }}) $$$ <span_class='stddocTitle'>{{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}}</span> [{{ labels['website'] }}]$$$ {{ version }}$$$ {{place}}: {{ publisher }}$$$ {{date}}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>"
31
+ book: "{{ creatornames }} ({{role}}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ edition | capitalize_first }}$$$ ({{ series }})$$$ {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}$$$ {{date}}$$$ {{size}}$$$ {{extent}}"
32
+ booklet: book
33
+ manual: book
34
+ techreport: book
35
+ proceedings: book
36
+ inbook: "{{ creatornames }} ({{role}}) $$$ {{labels['punct']['open-secondarytitle']}}{{ title }}{{labels['punct']['close-secondary-title']}} $$$ {{labels['punct']['open-title']}}{{host_title}}{{labels['punct']['close-title']}} ({{host_role}} {{ host_creatornames}})$$$ {{ edition | capitalize_first }}$$$ ({{ series }})$$$ {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}$$$ {{date}}$$$ {{size}}$$$ {{extent}}"
37
+ inproceedings: inbook
38
+ incollection: inbook
39
+ journal: "{{labels['punct']['open-title']}}{{ title}}{{labels['punct']['close-title']}} $$$ {{ edition | capitalize_first }}$$$ {{place}}: {{publisher}}$$$ {{date}}$$$ {{size}}$$$ {{extent}}"
40
+ article: "{{ creatornames }} ({{role}}) $$$ {{labels['punct']['open-secondary-title']}}{{ title }}{{labels['punct']['close-secondary-title']}}$$$ {{labels['punct']['open-title']}}{{ series }}{{labels['punct']['close-title']}} $$$ {{date}}, {{ extent }}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}"
41
+ software: "{{ creatornames }} ({{ role}}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ version }}$$$ {{medium | capitalize}}$$$ {{place}}: {{publisher}}$$$ {{date}}$$$ {{size}}$$$ {{extent}}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}"
42
+ electronic resource: software
43
+ dataset: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ version }}$$$ {{medium | capitalize }}$$$ {{ labels['in'] | capitalize }}:_{{series}}$$$ {{date}}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}$$$ {{ authoritative_identifier | join '$$$' }}$$$ {{ other_identifier | join '$$$' }}$$$ {{ size }}$$$ {{ extent}}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
44
+ webresource: website
45
+ unpublished: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ medium | capitalize }}$$$ {{ date }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}"
46
+ presentation: unpublished
47
+ thesis: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ medium | capitalize }}$$$ {{place}}: {{ publisher }}$$$ {{ date }}"
48
+ misc: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ date }}"
49
+ # following are # unsupported types:
50
+ map: misc
51
+ audiovisual: misc
52
+ film: misc
53
+ video: misc
54
+ broadcast: misc
55
+ graphic_work: misc
56
+ music: misc
57
+ performance: misc
58
+ patent: misc
59
+ archival: misc
60
+ social_media: misc
61
+ alert: misc
62
+ message: misc
63
+ conversation: misc
64
+ internal: misc
65
+
19
66
  template:
20
67
  # skip standardidentifier, it is inserted in front of formattedref within metanorma
21
- standard: "{% if home_standard %}<span_class='stddocTitle'>{{ title }}</span> ,_{{ extent }}{% else %}{{ creatornames }}. <span_class='stddocTitle'>{{ title }}</span> ,_{{ extent }} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{labels['updated'] | capitalize }}_{{date_updated}}. {{status | capitalize}}. {{ authorizer }}. {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>.{% endif %}"
22
- website: "{{ creatornames }} ({{ role }}) . <span_class='stddocTitle'>{{ title }}</span> [{{ labels['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
- book: "{{ creatornames }} ({{role}}) . {{ title }} . {{ 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}}]."
68
+ standard: "{% if home_standard %}<span_class='stddocTitle'>{{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}}</span> ,_{{ extent }}{% else %}{{ creatornames }}$$$ <span_class='stddocTitle'>{{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}}</span> ,_{{ extent }} $$$ {{ version }}$$$ {{labels['updated'] | capitalize }}_{{date_updated}}$$$ {{status | capitalize}}$$$ {{ authorizer }}$$$ {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>{% endif %}"
69
+ website: "{{ creatornames }} ({{ role }}) $$$ <span_class='stddocTitle'>{{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}}</span> [{{ labels['website'] }}]$$$ {{ version }}$$$ {{place}}: {{ publisher }}$$$ {{date}}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
70
+ book: "{{ creatornames }} ({{role}}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ 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
71
  booklet: book
25
72
  manual: book
26
73
  techreport: book
27
74
  proceedings: book
28
- inbook: "{{ creatornames }} ({{role}}) . {{ title }} . {{host_title}} ({{host_role}} {{ host_creatornames}}). {{ 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}}]."
75
+ inbook: "{{ creatornames }} ({{role}}) $$$ {{labels['punct']['open-secondary-title']}}{{ title }}{{labels['punct']['close-secondary-title']}} $$$ {{host_title}} ({{host_role}} {{ host_creatornames}})$$$ {{ 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}}]"
29
76
  inproceedings: inbook
30
77
  incollection: inbook
31
- journal: "{{ title}} . {{ edition | capitalize_first }}. {{place}}: {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
32
- article: "{{ creatornames }} ({{role}}) . {{ title }}. {{ series }} . {{date}}, {{ extent }}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
33
- software: "{{ creatornames }} ({{ role}}) . {{ title }} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{medium | capitalize}}. {{place}}: {{publisher}}. {{date}}. {{size}}. {{extent}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
78
+ journal: "{{labels['punct']['open-title']}}{{ title}}{{labels['punct']['close-title']}} $$$ {{ edition | capitalize_first }}$$$ {{place}}: {{publisher}}$$$ {{date}}$$$ {{size}}$$$ {{extent}}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
79
+ article: "{{ creatornames }} ({{role}}) $$$ {{labels['punct']['open-secondary-title']}}{{ title }}{{labels['punct']['close-secondary-title']}}$$$ {{labels['punct']['open-title']}}{{ series }}{{labels['punct']['close-title']}} $$$ {{date}}, {{ extent }}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
80
+ software: "{{ creatornames }} ({{ role}}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ version }}$$$ {{medium | capitalize}}$$$ {{place}}: {{publisher}}$$$ {{date}}$$$ {{size}}$$$ {{extent}}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ [{{ labels['viewed'] }}:_{{date_accessed}}] "
34
81
  electronic resource: software
35
- dataset: "{{ creatornames }} ({{ role }}) . {{ title }} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{medium | capitalize }}. {{ labels['in'] | capitalize }}:_{{series}}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join '. ' }}. {{ other_identifier | join '. ' }}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ size }}. {{ extent}}. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
82
+ dataset: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ version }}$$$ {{medium | capitalize }}$$$ {{ labels['in'] | capitalize }}:_{{series}}$$$ {{date}}$$$ {{ labels['updated'] | capitalize }}:_{{date_updated}}$$$ {{ authoritative_identifier | join '$$$' }}$$$ {{ other_identifier | join '$$$' }}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ {{ size }}$$$ {{ extent}}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
36
83
  webresource: website
37
- unpublished: "{{ creatornames }} ({{ role }}) . {{ title }} . {{ medium | capitalize }}. {{ date }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]."
84
+ unpublished: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ medium | capitalize }}$$$ {{ date }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
38
85
  presentation: unpublished
39
- thesis: "{{ creatornames }} ({{ role }}) . {{ title }} . {{ medium | capitalize }}. {{place}}: {{ publisher }}. {{ date }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]."
40
- misc: "{{ creatornames }} ({{ role }}) . {{ title }} . {{ date }}."
86
+ thesis: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ medium | capitalize }}$$$ {{place}}: {{ publisher }}$$$ {{ date }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ $$$_{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]"
87
+ misc: "{{ creatornames }} ({{ role }}) $$$ {{labels['punct']['open-title']}}{{ title }}{{labels['punct']['close-title']}} $$$ {{ date }}"
41
88
  # following are # unsupported types:
42
89
  map: misc
43
90
  audiovisual: misc
@@ -0,0 +1,19 @@
1
+ require "metanorma-iso"
2
+
3
+ module Relaton
4
+ module Render
5
+ module Jis
6
+ class Fields < ::Relaton::Render::Fields
7
+ def edition_fields_format(hash)
8
+ super
9
+ hash[:version] = versionformat(hash[:edition_raw], hash)
10
+ end
11
+
12
+ def versionformat(edn, context)
13
+ edn && !edn.empty? or return
14
+ @r.i18n.select(context).populate("version_cardinal", { "var1" => edn })
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,6 +2,7 @@ require "relaton-render"
2
2
  require "metanorma-iso"
3
3
  require "isodoc"
4
4
  require_relative "parse"
5
+ require_relative "fields"
5
6
 
6
7
  module Relaton
7
8
  module Render
@@ -14,13 +15,7 @@ module Relaton
14
15
  def klass_initialize(_options)
15
16
  super
16
17
  @parseklass = Relaton::Render::Jis::Parse
17
- end
18
-
19
- def render1(doc)
20
- r = doc.relation.select { |x| x.type == "hasRepresentation" }
21
- .map { |x| @i18n.also_pub_as + render_single_bibitem(x.bibitem) }
22
- out = [render_single_bibitem(doc)] + r
23
- @i18n.l10n(out.join(". ").gsub(/[.。]\. /, ". ").sub(/[.。]\s*$/, ""))
18
+ @fieldsklass = Relaton::Render::Jis::Fields
24
19
  end
25
20
 
26
21
  def render_all(bib, type: "author-date")
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
32
32
 
33
33
  spec.add_dependency "japanese_calendar", "~> 0"
34
- spec.add_dependency "metanorma-iso", "~> 3.1.0"
34
+ spec.add_dependency "metanorma-iso", "~> 3.2.0"
35
35
  spec.add_dependency "pubid"
36
36
 
37
37
  spec.add_development_dependency "debug"
@@ -39,6 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "guard", "~> 2.14"
40
40
  spec.add_development_dependency "guard-rspec", "~> 4.7"
41
41
  spec.add_development_dependency "iev", "~> 0.3.0"
42
+ spec.add_development_dependency "openssl"
42
43
  spec.add_development_dependency "rake", "~> 13.0"
43
44
  spec.add_development_dependency "rspec", "~> 3.6"
44
45
  spec.add_development_dependency "rubocop", "~> 1"
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.7
4
+ version: 1.0.1
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-10-13 00:00:00.000000000 Z
11
+ date: 2025-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: japanese_calendar
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.0
33
+ version: 3.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.0
40
+ version: 3.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pubid
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.3.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: openssl
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rake
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -311,12 +325,14 @@ files:
311
325
  - lib/metanorma/jis/isodoc.rng
312
326
  - lib/metanorma/jis/isostandard.rng
313
327
  - lib/metanorma/jis/jis.rng
328
+ - lib/metanorma/jis/log.rb
314
329
  - lib/metanorma/jis/processor.rb
315
330
  - lib/metanorma/jis/relaton-jis.rng
316
331
  - lib/metanorma/jis/reqt.rng
317
332
  - lib/metanorma/jis/validate.rb
318
333
  - lib/metanorma/jis/version.rb
319
334
  - lib/relaton/render-jis/config.yml
335
+ - lib/relaton/render-jis/fields.rb
320
336
  - lib/relaton/render-jis/general.rb
321
337
  - lib/relaton/render-jis/parse.rb
322
338
  - metanorma-jis.gemspec