metanorma-jis 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -2
- data/lib/isodoc/jis/jis.international-standard.xsl +11 -2
- data/lib/isodoc/jis/xref.rb +3 -2
- data/lib/metanorma/jis/basicdoc.rng +56 -37
- data/lib/metanorma/jis/biblio.rng +10 -1
- data/lib/metanorma/jis/converter.rb +6 -4
- data/lib/metanorma/jis/front.rb +150 -68
- data/lib/metanorma/jis/isodoc.rng +52 -1
- data/lib/metanorma/jis/isostandard.rng +3 -0
- data/lib/metanorma/jis/processor.rb +1 -0
- data/lib/metanorma/jis/version.rb +1 -1
- data/metanorma-jis.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bcd50e7099ae02c6427bbca496f824f9429ba102e0d3b8df1bdb2f2fd6cb9a2
|
4
|
+
data.tar.gz: 760abf62f4c69e4f73f8fa9e2bfc696e431b6fc4859b79f103e4595d6883bb3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1128ad3d108ac316a8d4c324c69b2fa5328838b84a1ff4b59f7b01ab79464c7946839c151c1a0749c52bc4da406c5ab820f7be2aefb43a06c36464757ebf020
|
7
|
+
data.tar.gz: c06c9323c1e2af9c1fe73c5b2e43c68dcb81efebb4004bc8c6f88959b2bfc43cc3989366c92242eab460873e137419e7efa83c6b5732f2a33ee71ea9f46f0168
|
data/Gemfile
CHANGED
@@ -2,11 +2,14 @@ Encoding.default_external = Encoding::UTF_8
|
|
2
2
|
Encoding.default_internal = Encoding::UTF_8
|
3
3
|
|
4
4
|
source "https://rubygems.org"
|
5
|
+
git_source(:github) { |repo| "https://github.com/#{repo}" }
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
group :development, :test do
|
8
|
+
gem "rspec"
|
9
|
+
end
|
8
10
|
|
9
11
|
if File.exist? "Gemfile.devel"
|
10
12
|
eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
|
11
13
|
end
|
12
14
|
|
15
|
+
gemspec
|
@@ -5835,8 +5835,17 @@
|
|
5835
5835
|
<xsl:variable name="styles_">
|
5836
5836
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
5837
5837
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
5838
|
-
<xsl:variable name="
|
5839
|
-
<xsl:
|
5838
|
+
<xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
5839
|
+
<xsl:variable name="value">
|
5840
|
+
<xsl:choose>
|
5841
|
+
<!-- if font-size is digits only -->
|
5842
|
+
<xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
|
5843
|
+
<xsl:otherwise>
|
5844
|
+
<xsl:value-of select="$value_"/>
|
5845
|
+
</xsl:otherwise>
|
5846
|
+
</xsl:choose>
|
5847
|
+
</xsl:variable>
|
5848
|
+
<xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
|
5840
5849
|
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
5841
5850
|
</xsl:if>
|
5842
5851
|
</xsl:for-each>
|
data/lib/isodoc/jis/xref.rb
CHANGED
@@ -78,8 +78,9 @@ module IsoDoc
|
|
78
78
|
|
79
79
|
def commentary_names1(clause, root, num, level)
|
80
80
|
commentary_name_anchors(clause, num, root, level)
|
81
|
-
clause.xpath(ns(SUBCLAUSES))
|
82
|
-
|
81
|
+
clause.xpath(ns(SUBCLAUSES))
|
82
|
+
.each_with_object(Counter.new(0, prefix: "#{num}.")) do |c, i|
|
83
|
+
commentary_names1(c, root, i.increment(c).print,
|
83
84
|
level + 1)
|
84
85
|
end
|
85
86
|
end
|
@@ -346,6 +346,8 @@
|
|
346
346
|
<ref name="keyword"/>
|
347
347
|
<ref name="xref"/>
|
348
348
|
<ref name="hyperlink"/>
|
349
|
+
<ref name="index"/>
|
350
|
+
<ref name="index-xref"/>
|
349
351
|
</choice>
|
350
352
|
</oneOrMore>
|
351
353
|
</element>
|
@@ -623,6 +625,8 @@
|
|
623
625
|
<ref name="eref"/>
|
624
626
|
<ref name="xref"/>
|
625
627
|
<ref name="hyperlink"/>
|
628
|
+
<ref name="index"/>
|
629
|
+
<ref name="index-xref"/>
|
626
630
|
</choice>
|
627
631
|
</zeroOrMore>
|
628
632
|
</element>
|
@@ -636,6 +640,8 @@
|
|
636
640
|
<ref name="eref"/>
|
637
641
|
<ref name="xref"/>
|
638
642
|
<ref name="hyperlink"/>
|
643
|
+
<ref name="index"/>
|
644
|
+
<ref name="index-xref"/>
|
639
645
|
</choice>
|
640
646
|
</zeroOrMore>
|
641
647
|
</element>
|
@@ -648,6 +654,8 @@
|
|
648
654
|
<ref name="eref"/>
|
649
655
|
<ref name="xref"/>
|
650
656
|
<ref name="hyperlink"/>
|
657
|
+
<ref name="index"/>
|
658
|
+
<ref name="index-xref"/>
|
651
659
|
</choice>
|
652
660
|
</zeroOrMore>
|
653
661
|
</element>
|
@@ -655,7 +663,11 @@
|
|
655
663
|
<define name="keyword">
|
656
664
|
<element name="keyword">
|
657
665
|
<zeroOrMore>
|
658
|
-
<
|
666
|
+
<choice>
|
667
|
+
<ref name="PureTextElement"/>
|
668
|
+
<ref name="index"/>
|
669
|
+
<ref name="index-xref"/>
|
670
|
+
</choice>
|
659
671
|
</zeroOrMore>
|
660
672
|
</element>
|
661
673
|
</define>
|
@@ -676,7 +688,11 @@
|
|
676
688
|
<define name="strike">
|
677
689
|
<element name="strike">
|
678
690
|
<zeroOrMore>
|
679
|
-
<
|
691
|
+
<choice>
|
692
|
+
<ref name="PureTextElement"/>
|
693
|
+
<ref name="index"/>
|
694
|
+
<ref name="index-xref"/>
|
695
|
+
</choice>
|
680
696
|
</zeroOrMore>
|
681
697
|
</element>
|
682
698
|
</define>
|
@@ -898,44 +914,47 @@
|
|
898
914
|
-->
|
899
915
|
<define name="image">
|
900
916
|
<element name="image">
|
901
|
-
<
|
902
|
-
|
917
|
+
<ref name="Image"/>
|
918
|
+
</element>
|
919
|
+
</define>
|
920
|
+
<define name="Image">
|
921
|
+
<attribute name="id">
|
922
|
+
<data type="ID"/>
|
923
|
+
</attribute>
|
924
|
+
<attribute name="src">
|
925
|
+
<data type="anyURI"/>
|
926
|
+
</attribute>
|
927
|
+
<attribute name="mimetype"/>
|
928
|
+
<optional>
|
929
|
+
<attribute name="filename"/>
|
930
|
+
</optional>
|
931
|
+
<optional>
|
932
|
+
<attribute name="width">
|
933
|
+
<choice>
|
934
|
+
<data type="int"/>
|
935
|
+
<value>auto</value>
|
936
|
+
</choice>
|
903
937
|
</attribute>
|
904
|
-
|
938
|
+
</optional>
|
939
|
+
<optional>
|
940
|
+
<attribute name="height">
|
941
|
+
<choice>
|
942
|
+
<data type="int"/>
|
943
|
+
<value>auto</value>
|
944
|
+
</choice>
|
945
|
+
</attribute>
|
946
|
+
</optional>
|
947
|
+
<optional>
|
948
|
+
<attribute name="alt"/>
|
949
|
+
</optional>
|
950
|
+
<optional>
|
951
|
+
<attribute name="title"/>
|
952
|
+
</optional>
|
953
|
+
<optional>
|
954
|
+
<attribute name="longdesc">
|
905
955
|
<data type="anyURI"/>
|
906
956
|
</attribute>
|
907
|
-
|
908
|
-
<optional>
|
909
|
-
<attribute name="filename"/>
|
910
|
-
</optional>
|
911
|
-
<optional>
|
912
|
-
<attribute name="width">
|
913
|
-
<choice>
|
914
|
-
<data type="int"/>
|
915
|
-
<value>auto</value>
|
916
|
-
</choice>
|
917
|
-
</attribute>
|
918
|
-
</optional>
|
919
|
-
<optional>
|
920
|
-
<attribute name="height">
|
921
|
-
<choice>
|
922
|
-
<data type="int"/>
|
923
|
-
<value>auto</value>
|
924
|
-
</choice>
|
925
|
-
</attribute>
|
926
|
-
</optional>
|
927
|
-
<optional>
|
928
|
-
<attribute name="alt"/>
|
929
|
-
</optional>
|
930
|
-
<optional>
|
931
|
-
<attribute name="title"/>
|
932
|
-
</optional>
|
933
|
-
<optional>
|
934
|
-
<attribute name="longdesc">
|
935
|
-
<data type="anyURI"/>
|
936
|
-
</attribute>
|
937
|
-
</optional>
|
938
|
-
</element>
|
957
|
+
</optional>
|
939
958
|
</define>
|
940
959
|
<define name="video">
|
941
960
|
<element name="video">
|
@@ -348,6 +348,9 @@
|
|
348
348
|
<zeroOrMore>
|
349
349
|
<ref name="contact"/>
|
350
350
|
</zeroOrMore>
|
351
|
+
<optional>
|
352
|
+
<ref name="logo"/>
|
353
|
+
</optional>
|
351
354
|
</element>
|
352
355
|
</define>
|
353
356
|
<define name="orgname">
|
@@ -366,6 +369,11 @@
|
|
366
369
|
</choice>
|
367
370
|
</element>
|
368
371
|
</define>
|
372
|
+
<define name="logo">
|
373
|
+
<element name="logo">
|
374
|
+
<ref name="image"/>
|
375
|
+
</element>
|
376
|
+
</define>
|
369
377
|
<define name="NameWithVariants">
|
370
378
|
<element name="primary">
|
371
379
|
<ref name="LocalizedString"/>
|
@@ -942,6 +950,7 @@
|
|
942
950
|
<value>obsoleted</value>
|
943
951
|
<value>confirmed</value>
|
944
952
|
<value>updated</value>
|
953
|
+
<value>corrected</value>
|
945
954
|
<value>issued</value>
|
946
955
|
<value>transmitted</value>
|
947
956
|
<value>copied</value>
|
@@ -1283,7 +1292,7 @@
|
|
1283
1292
|
<value>mergedInto</value>
|
1284
1293
|
<value>splits</value>
|
1285
1294
|
<value>splitInto</value>
|
1286
|
-
<value>
|
1295
|
+
<value>instanceOf</value>
|
1287
1296
|
<value>hasInstance</value>
|
1288
1297
|
<value>exemplarOf</value>
|
1289
1298
|
<value>hasExemplar</value>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require "asciidoctor"
|
2
2
|
require "metanorma-iso"
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
3
|
+
require_relative "front"
|
4
|
+
require_relative "validate"
|
5
|
+
require_relative "cleanup"
|
6
6
|
|
7
7
|
module Metanorma
|
8
8
|
module JIS
|
@@ -74,7 +74,9 @@ module Metanorma
|
|
74
74
|
if node.nil?
|
75
75
|
IsoDoc::JIS::PresentationXMLConvert.new({})
|
76
76
|
else
|
77
|
-
IsoDoc::JIS::PresentationXMLConvert
|
77
|
+
IsoDoc::JIS::PresentationXMLConvert
|
78
|
+
.new(doc_extract_attributes(node)
|
79
|
+
.merge(output_formats: ::Metanorma::JIS::Processor.new.output_formats))
|
78
80
|
end
|
79
81
|
end
|
80
82
|
end
|
data/lib/metanorma/jis/front.rb
CHANGED
@@ -7,29 +7,49 @@ module Metanorma
|
|
7
7
|
super.merge("Japanese Industrial Standards" => "JIS")
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
10
|
+
def default_publisher
|
11
11
|
"JIS"
|
12
12
|
end
|
13
13
|
|
14
|
-
# Like the ISO code, but multilingual
|
14
|
+
# # Like the ISO code, but multilingual
|
15
|
+
# def metadata_author(node, xml)
|
16
|
+
# metadata_contrib_sdo(node, xml, JIS_HASH,
|
17
|
+
# { role: "author", sourcerole: "publisher" })
|
18
|
+
# node.attr("doctype") == "expert-commentary" and
|
19
|
+
# personal_author(node, xml)
|
20
|
+
# end
|
21
|
+
|
15
22
|
def metadata_author(node, xml)
|
16
|
-
|
17
|
-
|
23
|
+
org_contributor(node, xml,
|
24
|
+
{ source: ["publisher", "pub"], role: "author",
|
25
|
+
default: JIS_HASH })
|
18
26
|
node.attr("doctype") == "expert-commentary" and
|
19
27
|
personal_author(node, xml)
|
20
28
|
end
|
21
29
|
|
30
|
+
# def metadata_publisher(node, xml)
|
31
|
+
# metadata_contrib_sdo(node, xml, JIS_HASH,
|
32
|
+
# { role: "publisher", sourcerole: "publisher" })
|
33
|
+
# metadata_contrib_sdo(node, xml, nil,
|
34
|
+
# { role: "authorizer",
|
35
|
+
# sourcerole: "investigative-organization",
|
36
|
+
# desc: "Investigative organization" })
|
37
|
+
# metadata_contrib_sdo(node, xml, nil,
|
38
|
+
# { role: "authorizer",
|
39
|
+
# sourcerole: "investigative-committee",
|
40
|
+
# desc: "Investigative committee" })
|
41
|
+
# end
|
42
|
+
|
22
43
|
def metadata_publisher(node, xml)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
desc: "Investigative committee" })
|
44
|
+
[{ source: ["publisher", "pub"], role: "publisher", default: JIS_HASH },
|
45
|
+
{ role: "authorizer",
|
46
|
+
source: ["investigative-organization"],
|
47
|
+
desc: "Investigative organization" },
|
48
|
+
{ role: "authorizer",
|
49
|
+
source: ["investigative-committee"],
|
50
|
+
desc: "Investigative committee" }].each do |o|
|
51
|
+
org_contributor(node, xml, o)
|
52
|
+
end
|
33
53
|
end
|
34
54
|
|
35
55
|
LANGS = %w(ja en).freeze
|
@@ -37,56 +57,111 @@ module Metanorma
|
|
37
57
|
JIS_HASH =
|
38
58
|
{ "ja" => "日本工業規格", "en" => "Japanese Industrial Standards" }.freeze
|
39
59
|
|
40
|
-
def metadata_contrib_sdo(node, xml, default_value, opt)
|
41
|
-
|
42
|
-
|
60
|
+
# def metadata_contrib_sdo(node, xml, default_value, opt)
|
61
|
+
# pub, default = metadata_contrib_extract(node, opt[:sourcerole], default_value)
|
62
|
+
# metadata_contrib_sdo_build(node, xml, pub, default, opt)
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# def metadata_contrib_sdo_build(node, xml, pub, default, opt)
|
66
|
+
# pub&.each do |p|
|
67
|
+
# xml.contributor do |c|
|
68
|
+
# c.role type: opt[:role] do |r|
|
69
|
+
# opt[:desc] and r.description opt[:desc]
|
70
|
+
# end
|
71
|
+
# c.organization do |a|
|
72
|
+
# organization(a, p, opt[:role] == "publisher", node, default)
|
73
|
+
# end
|
74
|
+
# end
|
75
|
+
# end
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# def metadata_contrib_extract(node, role, default_value)
|
79
|
+
# pub, default = multiling_docattr_csv(node, role, LANGS, default_value)
|
80
|
+
# a = node.attr("#{role}-abbr") and abbr = a # one abbrev for all languages
|
81
|
+
# [pub&.map { |p| { name: p, abbr: abbr } }, default]
|
82
|
+
# end
|
83
|
+
#
|
84
|
+
# def multiling_docattr(node, attr, langs)
|
85
|
+
# ret = node.attr(attr) and return ret
|
86
|
+
# ret = langs.each_with_object({}).each do |l, m|
|
87
|
+
# x = node.attr("#{attr}-#{l}") and m[l] = x
|
88
|
+
# end.compact
|
89
|
+
# ret.empty? and return nil
|
90
|
+
# ret
|
91
|
+
# end
|
92
|
+
#
|
93
|
+
# def multiling_docattr_csv(node, attr, langs, default)
|
94
|
+
# ret = multiling_docattr(node, attr, langs)
|
95
|
+
# not_found = ret.nil?
|
96
|
+
# ret ||= default
|
97
|
+
# ret &&= if ret.is_a?(Hash) then interleave_multiling_docattr(ret)
|
98
|
+
# else csv_split(ret)
|
99
|
+
# end
|
100
|
+
# [ret, not_found]
|
101
|
+
# end
|
102
|
+
#
|
103
|
+
# # TODO abort if CSV count different between different languages
|
104
|
+
# def interleave_multiling_docattr(ret)
|
105
|
+
# h = ret.transform_values { |v| csv_split(v) }
|
106
|
+
# h.each_with_object([]) do |(k, v), m|
|
107
|
+
# v.each_with_index do |v1, i|
|
108
|
+
# m[i] ||= {}
|
109
|
+
# m[i][k] = v1
|
110
|
+
# end
|
111
|
+
# end
|
112
|
+
# end
|
113
|
+
|
114
|
+
def org_organization(node, xml, org)
|
115
|
+
organization(xml, { name: org[:name], abbr: org[:abbr] }.compact,
|
116
|
+
node, !multiling_docattr(node, "publisher", "", LANGS))
|
117
|
+
org_address(org, xml)
|
118
|
+
org_logo(xml, org[:logo])
|
43
119
|
end
|
44
120
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
opt[:desc] and r.description opt[:desc]
|
50
|
-
end
|
51
|
-
c.organization do |a|
|
52
|
-
organization(a, p, opt[:role] == "publisher", node, default)
|
53
|
-
end
|
121
|
+
def org_attrs_parse(node, opts)
|
122
|
+
source = opts[:source]&.detect { |s| node.attr(s) }
|
123
|
+
source ||= opts[:source]&.detect do |s|
|
124
|
+
LANGS.detect { |l| node.attr("#{s}-#{l}") }
|
54
125
|
end
|
55
|
-
|
126
|
+
org_attrs_simple_parse(node, opts, source) ||
|
127
|
+
org_attrs_complex_parse(node, opts, source)
|
56
128
|
end
|
57
129
|
|
58
|
-
def
|
59
|
-
|
60
|
-
|
61
|
-
|
130
|
+
def org_attrs_complex_parse(node, opts, source)
|
131
|
+
i = 1
|
132
|
+
suffix = ""
|
133
|
+
ret = []
|
134
|
+
while multiling_docattr(node, source, suffix, LANGS)
|
135
|
+
ret << extract_org_attrs_complex(node, opts, source, suffix)
|
136
|
+
i += 1
|
137
|
+
suffix = "_#{i}"
|
138
|
+
end
|
139
|
+
ret
|
62
140
|
end
|
63
141
|
|
64
|
-
def multiling_docattr(node, attr, langs)
|
65
|
-
ret = node.attr(attr) and return ret
|
142
|
+
def multiling_docattr(node, attr, suffix, langs)
|
143
|
+
ret = node.attr(attr + suffix) and return ret
|
66
144
|
ret = langs.each_with_object({}).each do |l, m|
|
67
|
-
x = node.attr("#{attr}-#{l}") and m[l] = x
|
145
|
+
x = node.attr("#{attr}-#{l}#{suffix}") and m[l] = x
|
68
146
|
end.compact
|
69
147
|
ret.empty? and return nil
|
70
148
|
ret
|
71
149
|
end
|
72
150
|
|
73
|
-
def
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
[ret, not_found]
|
151
|
+
def extract_org_attrs_complex(node, opts, source, suffix)
|
152
|
+
{ name: multiling_docattr(node, source, suffix, LANGS),
|
153
|
+
role: opts[:role], desc: opts[:desc],
|
154
|
+
abbr: multiling_docattr(node, "#{source}-abbr", suffix, LANGS),
|
155
|
+
logo: multiling_docattr(node, "#{source}_logo", suffix, LANGS) }
|
156
|
+
.compact
|
157
|
+
.merge(extract_org_attrs_address(node, opts, suffix))
|
81
158
|
end
|
82
159
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
m[i] ||= {}
|
89
|
-
m[i][k] = v1
|
160
|
+
def extract_org_attrs_address(node, opts, suffix)
|
161
|
+
%w(address phone fax email uri).each_with_object({}) do |a, m|
|
162
|
+
opts[:source]&.each do |s|
|
163
|
+
p = multiling_docattr(node, "#{s}-#{a}", suffix, LANGS) and
|
164
|
+
m[a.to_sym] = p
|
90
165
|
end
|
91
166
|
end
|
92
167
|
end
|
@@ -104,37 +179,44 @@ module Metanorma
|
|
104
179
|
end
|
105
180
|
end
|
106
181
|
|
107
|
-
def organization(xml, org,
|
108
|
-
org.is_a?(Hash) or org = { name: org }
|
182
|
+
def organization(xml, org, node = nil, default_org = nil)
|
183
|
+
org.is_a?(Hash) && org[:name] or org = { name: org }
|
109
184
|
abbrevs = org_abbrev
|
110
185
|
name_str = org[:name].is_a?(Hash) ? org[:name]["en"] : org[:name]
|
111
186
|
n = abbrevs.invert[org[:name]] and org = { name: n, abbr: org[:name] }
|
112
187
|
multiling_noko_value(org[:name], "name", xml)
|
113
|
-
default_org && a = multiling_docattr(node, "subdivision", LANGS) and
|
188
|
+
default_org && a = multiling_docattr(node, "subdivision", "", LANGS) and
|
114
189
|
multiling_noko_value(a, "subdivision", xml)
|
115
190
|
abbr = org[:abbr]
|
116
191
|
abbr ||= org_abbrev[name_str]
|
117
192
|
default_org && b = node.attr("subdivision-abbr") and abbr = b
|
118
193
|
abbr and xml.abbreviation abbr
|
119
|
-
# is_pub && node and org_address(node, org) # should refactor into struct, like abbr
|
120
194
|
end
|
121
195
|
|
122
|
-
def metadata_copyright(node, xml)
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
196
|
+
# def metadata_copyright(node, xml)
|
197
|
+
# pub, default = metadata_contrib_extract(node, "copyright-holder", nil)
|
198
|
+
# if default
|
199
|
+
# pub, default = metadata_contrib_extract(node, "publisher", JIS_HASH)
|
200
|
+
# end
|
201
|
+
#
|
202
|
+
# pub&.each do |p|
|
203
|
+
# xml.copyright do |c|
|
204
|
+
# c.from (node.attr("copyright-year") || Date.today.year)
|
205
|
+
# c.owner do |owner|
|
206
|
+
# owner.organization do |o|
|
207
|
+
# organization(o, p, true, node, default)
|
208
|
+
# end
|
209
|
+
# end
|
210
|
+
# end
|
211
|
+
# end
|
212
|
+
# end
|
127
213
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
214
|
+
def copyright_parse(node)
|
215
|
+
opt = { source: ["copyright-holder", "publisher", "pub"],
|
216
|
+
role: "publisher", default: JIS_HASH }
|
217
|
+
ret = org_attrs_parse(node, opt)
|
218
|
+
ret.empty? and ret = [{ name: "-" }]
|
219
|
+
ret
|
138
220
|
end
|
139
221
|
|
140
222
|
def title(node, xml)
|
@@ -17,7 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.2.
|
20
|
+
<!-- VERSION v1.2.8 -->
|
21
21
|
<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">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
@@ -485,6 +485,8 @@
|
|
485
485
|
<choice>
|
486
486
|
<text/>
|
487
487
|
<ref name="callout"/>
|
488
|
+
<ref name="xref"/>
|
489
|
+
<ref name="eref"/>
|
488
490
|
</choice>
|
489
491
|
</oneOrMore>
|
490
492
|
<zeroOrMore>
|
@@ -865,6 +867,7 @@
|
|
865
867
|
<ref name="PureTextElement"/>
|
866
868
|
<ref name="stem"/>
|
867
869
|
<ref name="index"/>
|
870
|
+
<ref name="index-xref"/>
|
868
871
|
<ref name="eref"/>
|
869
872
|
<ref name="erefstack"/>
|
870
873
|
<ref name="xref"/>
|
@@ -880,6 +883,7 @@
|
|
880
883
|
<ref name="PureTextElement"/>
|
881
884
|
<ref name="stem"/>
|
882
885
|
<ref name="index"/>
|
886
|
+
<ref name="index-xref"/>
|
883
887
|
<ref name="eref"/>
|
884
888
|
<ref name="erefstack"/>
|
885
889
|
<ref name="xref"/>
|
@@ -894,6 +898,7 @@
|
|
894
898
|
<choice>
|
895
899
|
<ref name="PureTextElement"/>
|
896
900
|
<ref name="index"/>
|
901
|
+
<ref name="index-xref"/>
|
897
902
|
<ref name="eref"/>
|
898
903
|
<ref name="erefstack"/>
|
899
904
|
<ref name="xref"/>
|
@@ -908,6 +913,7 @@
|
|
908
913
|
<choice>
|
909
914
|
<ref name="PureTextElement"/>
|
910
915
|
<ref name="index"/>
|
916
|
+
<ref name="index-xref"/>
|
911
917
|
</choice>
|
912
918
|
</zeroOrMore>
|
913
919
|
</element>
|
@@ -918,6 +924,7 @@
|
|
918
924
|
<choice>
|
919
925
|
<ref name="PureTextElement"/>
|
920
926
|
<ref name="index"/>
|
927
|
+
<ref name="index-xref"/>
|
921
928
|
</choice>
|
922
929
|
</zeroOrMore>
|
923
930
|
</element>
|
@@ -928,6 +935,7 @@
|
|
928
935
|
<choice>
|
929
936
|
<ref name="PureTextElement"/>
|
930
937
|
<ref name="index"/>
|
938
|
+
<ref name="index-xref"/>
|
931
939
|
</choice>
|
932
940
|
</zeroOrMore>
|
933
941
|
</element>
|
@@ -938,6 +946,7 @@
|
|
938
946
|
<choice>
|
939
947
|
<ref name="PureTextElement"/>
|
940
948
|
<ref name="index"/>
|
949
|
+
<ref name="index-xref"/>
|
941
950
|
</choice>
|
942
951
|
</zeroOrMore>
|
943
952
|
</element>
|
@@ -1004,6 +1013,14 @@
|
|
1004
1013
|
</oneOrMore>
|
1005
1014
|
</element>
|
1006
1015
|
</define>
|
1016
|
+
<define name="BasicBlock" combine="choice">
|
1017
|
+
<ref name="columnbreak"/>
|
1018
|
+
</define>
|
1019
|
+
<define name="columnbreak">
|
1020
|
+
<element name="columnbreak">
|
1021
|
+
<empty/>
|
1022
|
+
</element>
|
1023
|
+
</define>
|
1007
1024
|
<define name="MultilingualRenderingType">
|
1008
1025
|
<choice>
|
1009
1026
|
<value>common</value>
|
@@ -1037,6 +1054,17 @@
|
|
1037
1054
|
<ref name="date_inline"/>
|
1038
1055
|
</choice>
|
1039
1056
|
</define>
|
1057
|
+
<define name="PureTextElement" combine="choice">
|
1058
|
+
<ref name="passthrough_inline"/>
|
1059
|
+
</define>
|
1060
|
+
<define name="passthrough_inline">
|
1061
|
+
<element name="passthrough">
|
1062
|
+
<optional>
|
1063
|
+
<attribute name="formats"/>
|
1064
|
+
</optional>
|
1065
|
+
<text/>
|
1066
|
+
</element>
|
1067
|
+
</define>
|
1040
1068
|
<define name="add">
|
1041
1069
|
<element name="add">
|
1042
1070
|
<choice>
|
@@ -1047,6 +1075,8 @@
|
|
1047
1075
|
<ref name="keyword"/>
|
1048
1076
|
<ref name="xref"/>
|
1049
1077
|
<ref name="hyperlink"/>
|
1078
|
+
<ref name="index"/>
|
1079
|
+
<ref name="index-xref"/>
|
1050
1080
|
</choice>
|
1051
1081
|
</element>
|
1052
1082
|
</define>
|
@@ -1060,6 +1090,8 @@
|
|
1060
1090
|
<ref name="keyword"/>
|
1061
1091
|
<ref name="xref"/>
|
1062
1092
|
<ref name="hyperlink"/>
|
1093
|
+
<ref name="index"/>
|
1094
|
+
<ref name="index-xref"/>
|
1063
1095
|
</choice>
|
1064
1096
|
</element>
|
1065
1097
|
</define>
|
@@ -1071,6 +1103,9 @@
|
|
1071
1103
|
<optional>
|
1072
1104
|
<attribute name="style"/>
|
1073
1105
|
</optional>
|
1106
|
+
<optional>
|
1107
|
+
<attribute name="custom-charset"/>
|
1108
|
+
</optional>
|
1074
1109
|
<oneOrMore>
|
1075
1110
|
<ref name="TextElement"/>
|
1076
1111
|
</oneOrMore>
|
@@ -1126,6 +1161,8 @@
|
|
1126
1161
|
<choice>
|
1127
1162
|
<ref name="PureTextElement"/>
|
1128
1163
|
<ref name="stem"/>
|
1164
|
+
<ref name="index"/>
|
1165
|
+
<ref name="index-xref"/>
|
1129
1166
|
</choice>
|
1130
1167
|
</zeroOrMore>
|
1131
1168
|
</element>
|
@@ -1136,6 +1173,8 @@
|
|
1136
1173
|
<choice>
|
1137
1174
|
<ref name="PureTextElement"/>
|
1138
1175
|
<ref name="stem"/>
|
1176
|
+
<ref name="index"/>
|
1177
|
+
<ref name="index-xref"/>
|
1139
1178
|
</choice>
|
1140
1179
|
</zeroOrMore>
|
1141
1180
|
</element>
|
@@ -1369,6 +1408,9 @@
|
|
1369
1408
|
<optional>
|
1370
1409
|
<attribute name="number"/>
|
1371
1410
|
</optional>
|
1411
|
+
<optional>
|
1412
|
+
<attribute name="branch-number"/>
|
1413
|
+
</optional>
|
1372
1414
|
<optional>
|
1373
1415
|
<attribute name="obligation">
|
1374
1416
|
<choice>
|
@@ -1592,6 +1634,9 @@
|
|
1592
1634
|
<optional>
|
1593
1635
|
<attribute name="number"/>
|
1594
1636
|
</optional>
|
1637
|
+
<optional>
|
1638
|
+
<attribute name="branch-number"/>
|
1639
|
+
</optional>
|
1595
1640
|
<optional>
|
1596
1641
|
<attribute name="type"/>
|
1597
1642
|
</optional>
|
@@ -1643,6 +1688,9 @@
|
|
1643
1688
|
<optional>
|
1644
1689
|
<attribute name="number"/>
|
1645
1690
|
</optional>
|
1691
|
+
<optional>
|
1692
|
+
<attribute name="branch-number"/>
|
1693
|
+
</optional>
|
1646
1694
|
<optional>
|
1647
1695
|
<ref name="section-title"/>
|
1648
1696
|
</optional>
|
@@ -1740,6 +1788,9 @@
|
|
1740
1788
|
<optional>
|
1741
1789
|
<attribute name="number"/>
|
1742
1790
|
</optional>
|
1791
|
+
<optional>
|
1792
|
+
<attribute name="branch-number"/>
|
1793
|
+
</optional>
|
1743
1794
|
<optional>
|
1744
1795
|
<attribute name="obligation">
|
1745
1796
|
<choice>
|
data/metanorma-jis.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
31
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
32
32
|
|
33
|
-
spec.add_dependency "metanorma-iso", "~> 2.
|
33
|
+
spec.add_dependency "metanorma-iso", "~> 2.6.0"
|
34
34
|
spec.add_dependency "pubid-jis"
|
35
35
|
|
36
36
|
spec.add_development_dependency "debug"
|
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pubid-jis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|