metanorma-jis 0.6.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/jis/i18n-en.yaml +9 -0
- data/lib/isodoc/jis/i18n-ja.yaml +10 -0
- data/lib/isodoc/jis/jis.international-standard.xsl +201 -131
- data/lib/isodoc/jis/presentation_xml_convert.rb +63 -12
- data/lib/metanorma/jis/cleanup.rb +0 -1
- data/lib/metanorma/jis/converter.rb +2 -0
- data/lib/metanorma/jis/log.rb +20 -0
- data/lib/metanorma/jis/validate.rb +2 -4
- data/lib/metanorma/jis/version.rb +1 -1
- data/lib/relaton/render-jis/config.yml +58 -11
- data/lib/relaton/render-jis/fields.rb +19 -0
- data/lib/relaton/render-jis/general.rb +2 -7
- data/metanorma-jis.gemspec +2 -1
- metadata +20 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e2dd4ab84c0a6ed18a6fd314efc02f0fd4d21541ecefe84ca12ccfb7aafbad8
|
|
4
|
+
data.tar.gz: 376add510f1d13bbc145750ecf15eb3ac37e82ce3dfeac8cdd5c7f3a6de2fc28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d998d2221b79cf39d75fa49ad989ab48cf13a851d8cdca786ce1e72a7ac93a96d164599412c0fa726a72ac1bd13840c37c3092bf29a0a2bfb8d48ad35af1fe0
|
|
7
|
+
data.tar.gz: ba1d3e6a819c3fc7b4dd834c9168b83becffd936595d3b2ccf68b89d2f2c072f1ba0a03ff9b16d358fcaf5ab0c4c899a26878ef6be03ef59a8e8ff24af51bdcd
|
data/lib/isodoc/jis/i18n-en.yaml
CHANGED
|
@@ -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:
|
data/lib/isodoc/jis/i18n-ja.yaml
CHANGED
|
@@ -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 >= 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 >= 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:
|
|
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:
|
|
2169
|
-
<xsl:
|
|
2170
|
-
<xsl:with-param name="
|
|
2171
|
-
</
|
|
2172
|
-
|
|
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
|
-
|
|
2206
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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'">
|
|
@@ -15856,7 +15777,6 @@
|
|
|
15856
15777
|
</xsl:attribute-set>
|
|
15857
15778
|
|
|
15858
15779
|
<xsl:template name="refine_references-non-normative-title-style">
|
|
15859
|
-
|
|
15860
15780
|
</xsl:template>
|
|
15861
15781
|
|
|
15862
15782
|
<!-- bibitem in Normative References (references/@normative="true") -->
|
|
@@ -17946,7 +17866,7 @@
|
|
|
17946
17866
|
<!-- ===================================== -->
|
|
17947
17867
|
|
|
17948
17868
|
<xsl:attribute-set name="annex-title-style">
|
|
17949
|
-
</xsl:attribute-set>
|
|
17869
|
+
</xsl:attribute-set> <!-- annex-title-style -->
|
|
17950
17870
|
|
|
17951
17871
|
<xsl:template name="refine_annex-title-style">
|
|
17952
17872
|
</xsl:template>
|
|
@@ -17957,6 +17877,143 @@
|
|
|
17957
17877
|
<xsl:template name="refine_p-zzSTDTitle1-style">
|
|
17958
17878
|
</xsl:template>
|
|
17959
17879
|
|
|
17880
|
+
<xsl:attribute-set name="p-style">
|
|
17881
|
+
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
|
|
17882
|
+
<xsl:attribute name="line-height">1.5</xsl:attribute>
|
|
17883
|
+
</xsl:attribute-set> <!-- p-style -->
|
|
17884
|
+
|
|
17885
|
+
<xsl:template name="refine_p-style">
|
|
17886
|
+
<xsl:param name="element-name"/>
|
|
17887
|
+
<xsl:param name="margin"/>
|
|
17888
|
+
<xsl:call-template name="setBlockAttributes">
|
|
17889
|
+
<xsl:with-param name="text_align_default">justify</xsl:with-param>
|
|
17890
|
+
</xsl:call-template>
|
|
17891
|
+
|
|
17892
|
+
<xsl:if test="not(parent::mn:note or parent::mn:li or ancestor::mn:table)">
|
|
17893
|
+
<xsl:attribute name="text-indent"><xsl:value-of select="$text_indent"/>mm</xsl:attribute>
|
|
17894
|
+
</xsl:if>
|
|
17895
|
+
|
|
17896
|
+
<xsl:copy-of select="@id"/>
|
|
17897
|
+
|
|
17898
|
+
<!-- bookmarks only in paragraph -->
|
|
17899
|
+
|
|
17900
|
+
<xsl:if test="count(mn:bookmark) != 0 and count(*) = count(mn:bookmark) and normalize-space() = ''">
|
|
17901
|
+
<xsl:attribute name="font-size">0</xsl:attribute>
|
|
17902
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
17903
|
+
<xsl:attribute name="line-height">0</xsl:attribute>
|
|
17904
|
+
</xsl:if>
|
|
17905
|
+
|
|
17906
|
+
<xsl:if test="ancestor::*[@key = 'true']">
|
|
17907
|
+
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
|
17908
|
+
</xsl:if>
|
|
17909
|
+
|
|
17910
|
+
<xsl:if test="parent::mn:fmt-definition">
|
|
17911
|
+
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
|
17912
|
+
</xsl:if>
|
|
17913
|
+
|
|
17914
|
+
<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">
|
|
17915
|
+
<xsl:attribute name="margin-bottom">4pt</xsl:attribute>
|
|
17916
|
+
</xsl:if>
|
|
17917
|
+
|
|
17918
|
+
<xsl:if test="parent::mn:td or parent::mn:th or parent::mn:dd">
|
|
17919
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
17920
|
+
</xsl:if>
|
|
17921
|
+
|
|
17922
|
+
<xsl:if test="parent::mn:clause[@type = 'inner-cover-note'] or ancestor::mn:boilerplate">
|
|
17923
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
17924
|
+
</xsl:if>
|
|
17925
|
+
<!-- $namespace = 'jis' -->
|
|
17926
|
+
|
|
17927
|
+
</xsl:template> <!-- refine_p-style -->
|
|
17928
|
+
|
|
17929
|
+
<xsl:attribute-set name="title-style">
|
|
17930
|
+
<!-- Note: font-size for level 1 title -->
|
|
17931
|
+
<xsl:attribute name="font-family">IPAexGothic</xsl:attribute>
|
|
17932
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
|
17933
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
|
17934
|
+
<xsl:attribute name="text-align">left</xsl:attribute>
|
|
17935
|
+
<xsl:attribute name="space-before">6.5mm</xsl:attribute>
|
|
17936
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
17937
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
17938
|
+
</xsl:attribute-set> <!-- title-style -->
|
|
17939
|
+
|
|
17940
|
+
<xsl:template name="refine_title-style">
|
|
17941
|
+
<xsl:param name="element-name"/>
|
|
17942
|
+
<xsl:variable name="level">
|
|
17943
|
+
<xsl:call-template name="getLevel"/>
|
|
17944
|
+
</xsl:variable>
|
|
17945
|
+
|
|
17946
|
+
<xsl:if test="@inline-header = 'true'">
|
|
17947
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
17948
|
+
</xsl:if>
|
|
17949
|
+
|
|
17950
|
+
<xsl:if test="@type = 'section-title'">
|
|
17951
|
+
<xsl:attribute name="margin-bottom">6mm</xsl:attribute>
|
|
17952
|
+
</xsl:if>
|
|
17953
|
+
|
|
17954
|
+
<xsl:if test="$level = 1">
|
|
17955
|
+
<xsl:if test="following-sibling::mn:clause">
|
|
17956
|
+
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
|
17957
|
+
</xsl:if>
|
|
17958
|
+
<xsl:if test="@ancestor = 'foreword'">
|
|
17959
|
+
<xsl:attribute name="font-size">14pt</xsl:attribute>
|
|
17960
|
+
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
17961
|
+
<xsl:attribute name="space-before">9mm</xsl:attribute>
|
|
17962
|
+
<xsl:attribute name="margin-bottom">9mm</xsl:attribute>
|
|
17963
|
+
</xsl:if>
|
|
17964
|
+
<xsl:if test="@ancestor = 'annex'">
|
|
17965
|
+
<xsl:attribute name="font-size">14pt</xsl:attribute>
|
|
17966
|
+
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
17967
|
+
<xsl:if test="preceding-sibling::mn:annex[1][@commentary = 'true']">
|
|
17968
|
+
<xsl:attribute name="font-size">16pt</xsl:attribute>
|
|
17969
|
+
<xsl:attribute name="space-before">1mm</xsl:attribute>
|
|
17970
|
+
<xsl:attribute name="margin-bottom">7mm</xsl:attribute>
|
|
17971
|
+
</xsl:if>
|
|
17972
|
+
</xsl:if>
|
|
17973
|
+
</xsl:if>
|
|
17974
|
+
|
|
17975
|
+
<xsl:if test="$level = 2">
|
|
17976
|
+
<xsl:attribute name="space-before">2mm</xsl:attribute>
|
|
17977
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
17978
|
+
<xsl:if test="@ancestor = 'foreword'">
|
|
17979
|
+
<xsl:attribute name="space-before">0mm</xsl:attribute>
|
|
17980
|
+
</xsl:if>
|
|
17981
|
+
<xsl:if test="@ancestor = 'annex'">
|
|
17982
|
+
<xsl:attribute name="space-before">4.5mm</xsl:attribute>
|
|
17983
|
+
</xsl:if>
|
|
17984
|
+
<xsl:if test="@ancestor = 'bibliography'">
|
|
17985
|
+
<xsl:attribute name="space-before">0mm</xsl:attribute>
|
|
17986
|
+
</xsl:if>
|
|
17987
|
+
<xsl:if test="following-sibling::mn:clause">
|
|
17988
|
+
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
|
17989
|
+
</xsl:if>
|
|
17990
|
+
</xsl:if>
|
|
17991
|
+
|
|
17992
|
+
<xsl:if test="$level >= 3">
|
|
17993
|
+
<xsl:attribute name="space-before">2mm</xsl:attribute>
|
|
17994
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
17995
|
+
</xsl:if>
|
|
17996
|
+
|
|
17997
|
+
<xsl:if test="@type = 'section-title'">
|
|
17998
|
+
<xsl:attribute name="font-size">18pt</xsl:attribute>
|
|
17999
|
+
</xsl:if>
|
|
18000
|
+
|
|
18001
|
+
<xsl:if test="@type = 'floating-title' or @type = 'section-title'">
|
|
18002
|
+
<xsl:copy-of select="@id"/>
|
|
18003
|
+
</xsl:if>
|
|
18004
|
+
|
|
18005
|
+
<xsl:if test="$vertical_layout = 'true'">
|
|
18006
|
+
<xsl:attribute name="font-family">Noto Sans JP</xsl:attribute>
|
|
18007
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
|
18008
|
+
<xsl:attribute name="font-weight">500</xsl:attribute>
|
|
18009
|
+
<xsl:if test="not($level = 1 and (@ancestor = 'foreword' or @ancestor = 'annex'))">
|
|
18010
|
+
<xsl:attribute name="margin-left">-6mm</xsl:attribute>
|
|
18011
|
+
</xsl:if>
|
|
18012
|
+
</xsl:if>
|
|
18013
|
+
<!-- $namespace = 'jis' -->
|
|
18014
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
18015
|
+
</xsl:template> <!-- refine_title-style -->
|
|
18016
|
+
|
|
17960
18017
|
<xsl:template name="processPrefaceSectionsDefault">
|
|
17961
18018
|
<xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
|
|
17962
18019
|
<xsl:sort select="@displayorder" data-type="number"/>
|
|
@@ -18295,6 +18352,12 @@
|
|
|
18295
18352
|
</xsl:choose>
|
|
18296
18353
|
</xsl:template>
|
|
18297
18354
|
|
|
18355
|
+
<xsl:attribute-set name="reset-margins-style">
|
|
18356
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
|
18357
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
|
18358
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
18359
|
+
</xsl:attribute-set>
|
|
18360
|
+
|
|
18298
18361
|
<xsl:attribute-set name="clause-style">
|
|
18299
18362
|
|
|
18300
18363
|
</xsl:attribute-set>
|
|
@@ -19330,8 +19393,9 @@
|
|
|
19330
19393
|
|
|
19331
19394
|
<xsl:template name="setTextAlignment">
|
|
19332
19395
|
<xsl:param name="default">left</xsl:param>
|
|
19396
|
+
<xsl:param name="skip_default">false</xsl:param>
|
|
19333
19397
|
<xsl:variable name="align" select="normalize-space(@align)"/>
|
|
19334
|
-
<xsl:
|
|
19398
|
+
<xsl:variable name="text_align">
|
|
19335
19399
|
<xsl:choose>
|
|
19336
19400
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
|
19337
19401
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
|
@@ -19339,9 +19403,13 @@
|
|
|
19339
19403
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
|
19340
19404
|
<xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
|
|
19341
19405
|
<xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
|
|
19406
|
+
<xsl:when test="$skip_default = 'true'"/>
|
|
19342
19407
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
|
19343
19408
|
</xsl:choose>
|
|
19344
|
-
</xsl:
|
|
19409
|
+
</xsl:variable>
|
|
19410
|
+
<xsl:if test="normalize-space($text_align) != ''">
|
|
19411
|
+
<xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
|
|
19412
|
+
</xsl:if>
|
|
19345
19413
|
<xsl:if test="$align = 'indent'">
|
|
19346
19414
|
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
|
19347
19415
|
</xsl:if>
|
|
@@ -19349,8 +19417,10 @@
|
|
|
19349
19417
|
|
|
19350
19418
|
<xsl:template name="setBlockAttributes">
|
|
19351
19419
|
<xsl:param name="text_align_default">left</xsl:param>
|
|
19420
|
+
<xsl:param name="skip_text_align_default">false</xsl:param>
|
|
19352
19421
|
<xsl:call-template name="setTextAlignment">
|
|
19353
19422
|
<xsl:with-param name="default" select="$text_align_default"/>
|
|
19423
|
+
<xsl:with-param name="skip_default" select="$skip_text_align_default"/>
|
|
19354
19424
|
</xsl:call-template>
|
|
19355
19425
|
<xsl:call-template name="setKeepAttributes"/>
|
|
19356
19426
|
<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
|
|
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
|
-
|
|
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
|
|
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,59 @@ 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 norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, bib)
|
|
207
|
+
delim = bib.at(ns("./language"))&.text == "ja" ? " " : "<esc>,</esc> "
|
|
208
|
+
ret = (idents[:ordinal] || idents[:metanorma] || idents[:sdo]).to_s
|
|
209
|
+
ret = esc(ret)
|
|
210
|
+
(idents[:ordinal] || idents[:metanorma]) && idents[:sdo] and
|
|
211
|
+
ret += "#{delim}<strong>#{esc idents[:sdo]}</strong>"
|
|
212
|
+
!idents[:ordinal] && !idents[:metanorma] && idents[:sdo] and
|
|
213
|
+
ret = "<strong>#{ret}</ret>"
|
|
214
|
+
ret += datefn
|
|
215
|
+
ret.empty? and return ret
|
|
216
|
+
idents[:sdo] and ret += delim
|
|
217
|
+
ret.sub(delim, "").strip.empty? and return ""
|
|
218
|
+
ret
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, bib)
|
|
222
|
+
delim = bib.at(ns("./language"))&.text == "ja" ? " " : "<esc>,</esc> "
|
|
223
|
+
ret = esc(ids[:ordinal]) || esc(ids[:metanorma]) || "[#{esc ordinal.to_s}]"
|
|
224
|
+
if ids[:sdo] && !ids[:sdo].empty?
|
|
225
|
+
ret = prefix_bracketed_ref(ret)
|
|
226
|
+
ret += "#{esc ids[:sdo]}#{datefn}#{delim}"
|
|
227
|
+
else
|
|
228
|
+
ret = prefix_bracketed_ref("#{ret}#{datefn}")
|
|
229
|
+
end
|
|
230
|
+
ret
|
|
231
|
+
end
|
|
232
|
+
|
|
182
233
|
include Init
|
|
183
234
|
end
|
|
184
235
|
end
|
|
@@ -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("
|
|
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("
|
|
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
|
|
@@ -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 }}
|
|
22
|
-
website: "{{ creatornames }} ({{ role }})
|
|
23
|
-
book: "{{ creatornames }} ({{role}})
|
|
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}})
|
|
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}}
|
|
32
|
-
article: "{{ creatornames }} ({{role}})
|
|
33
|
-
software: "{{ creatornames }} ({{ role}})
|
|
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 }})
|
|
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 }})
|
|
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 }})
|
|
40
|
-
misc: "{{ creatornames }} ({{ role }})
|
|
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
|
-
|
|
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")
|
data/metanorma-jis.gemspec
CHANGED
|
@@ -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.
|
|
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.
|
|
4
|
+
version: 1.0.0
|
|
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-
|
|
11
|
+
date: 2025-11-03 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.
|
|
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.
|
|
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
|