metanorma-jis 1.0.8 → 1.1.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: 7b408818c892ab433c66dbe129cea0ffdbd82283755ccffce0556d4b47b8d756
4
- data.tar.gz: 2dc6d2c7e7f67e2ca89c53088efd03ca598061a0cf55a543b7c55a54799985e7
3
+ metadata.gz: f4d4550d188829625c178c0e93665cbb42c02ea5cd4bfb1d639ee7403bc5c83d
4
+ data.tar.gz: 1c7e761e682a77bde33f6799f6e99b0dd222e5fb0324779e95e14a99971eec2a
5
5
  SHA512:
6
- metadata.gz: 0edff9c8c05ada995358ed6fdea0b6f840f554e4b052dc05e7473e6fb8e6008eccf73bcec9d619497230b5c139586fc121fbd7ac3917e7f203c083a1e5564e74
7
- data.tar.gz: efbf2c34d966ac98b7897e9eb8466902a0aaaf038535ccee4a847dd93a797bc0298fe1866dbb59aeeb5dae473d9a7b6000d1fede44bd165cfe18dc544e108e25
6
+ metadata.gz: 52dffbca1335aeabdc22b0f298a861380d2f8c48d09e3d7af78fb467599e2c77b513cbde98425a4a61d2f9bd8cc07236949dde79a533530be0d7af5ebd0e205b
7
+ data.tar.gz: 99b341de0659073ce8d63a2c661149f9c1c74b0f4623bd9f7f96daa57663ad8612d6a9743130f0b0ab2385fe2c3e1e1c21472ed563bf6222be55314eb051c6e2
data/.rubocop.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  # Auto-generated by Cimas: Do not edit it manually!
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
- - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
5
 
6
6
  # local repo-specific modifications
7
7
  # ...
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 3.4
@@ -16,7 +16,8 @@ module IsoDoc
16
16
  out.div **attr_code(annex_attrs(node)) do |s|
17
17
  node.elements.each do |c1|
18
18
  if c1.name == "fmt-title" then annex_name(node, c1, s)
19
- else parse(c1, s) end
19
+ else parse(c1, s)
20
+ end
20
21
  end
21
22
  end
22
23
  amd?(isoxml) and @suppressheadingnumbers = true
@@ -42,12 +43,17 @@ module IsoDoc
42
43
  end
43
44
 
44
45
  def table_parse_tail(node, out)
45
- node.xpath(ns("./p[@class = 'ListTitle' or @class = 'dl']"))
46
- .each { |p| parse(p, out) }
47
- node.xpath(ns("./fmt-source")).each { |n| parse(n, out) }
48
- node.xpath(ns("./note")).each { |n| parse(n, out) }
49
- node.xpath(ns("./fmt-footnote-container/fmt-fn-body"))
50
- .each { |n| parse(n, out) }
46
+ table_parse_tail?(node) or return
47
+ tfoot = table_get_or_make_tfoot(out.parent)
48
+ [["./key", "./fmt-source", "./note"],
49
+ ["./fmt-footnote-container/fmt-fn-body"]].each do |e|
50
+ e.any? { |x| node.at(ns(x)) } or next
51
+ ins = new_fullcolspan_row(out.parent, tfoot)
52
+ b = Nokogiri::XML::Builder.with(ins)
53
+ e.each do |k|
54
+ node.xpath(ns(k)).each { |n| parse(n, b) }
55
+ end
56
+ end
51
57
  end
52
58
 
53
59
  def table_thead_pt(node, name)
@@ -72,7 +78,7 @@ module IsoDoc
72
78
  name or return
73
79
  thead.add_first_child full_row(
74
80
  cols, "<fmt-name><p class='TableTitle' style='text-align:center;'> " \
75
- "#{name.remove.children.to_xml}</p></fmt-name>"
81
+ "#{name.remove.children.to_xml}</p></fmt-name>"
76
82
  )
77
83
  end
78
84
 
@@ -821,7 +821,9 @@ nav {
821
821
  background-color: black;
822
822
  color: white !important;
823
823
  cursor: pointer;
824
- z-index: 100;
824
+ left: 0;
825
+ top: 0;
826
+ z-index: 103;
825
827
  }
826
828
  #toggle span {
827
829
  text-align: center;
@@ -765,7 +765,9 @@ nav {
765
765
  background-color: #f7f7f7;
766
766
  color: black !important;
767
767
  cursor: pointer;
768
- z-index: 100;
768
+ left: 0;
769
+ top: 0;
770
+ z-index: 103;
769
771
  }
770
772
  #toggle span {
771
773
  text-align: center;
@@ -31,10 +31,19 @@ doctype_dict:
31
31
  stage_dict:
32
32
  international-standard: 日本産業規格
33
33
  punct:
34
- open-title:
35
- close-title:
34
+ open-title:
35
+ close-title:
36
36
  open-secondary-title:
37
37
  close-secondary-title:
38
38
  # We need the trailing half-width space, to allow it to be converted to cjk-latin-separator if Latn text follows
39
39
  biblio-field-delimiter: "。 "
40
40
  biblio-terminator: ""
41
+ date_format:
42
+ default:
43
+ year: "%EY[spellout]年"
44
+ year_month: "%EY[spellout]年%-m月"
45
+ full: "%EY[spellout]年%-m月%-d日"
46
+ japanese_numbering:
47
+ year: "%EY[spellout]年"
48
+ year_month: "%EY[spellout]年%Om[spellout]月"
49
+ full: "%EY[spellout]年%Om[spellout]月%Od[spellout]日"
@@ -18,26 +18,16 @@ module IsoDoc
18
18
  end
19
19
  end
20
20
 
21
- # use Japanese ordinals for era years
22
- def japanese_date(date)
23
- date.nil? and return date
24
- d = date.split("-").map(&:to_i)
25
- time = Date.new(*d)
26
- yr = japanese_year(time)
27
- case d.size
28
- when 1 then yr
29
- when 2 then yr + time.strftime("%-m月")
30
- when 3 then yr + time.strftime("%-m月%-d日")
31
- else date
32
- end
33
- end
34
-
35
- def japanese_year(time)
36
- era_yr = time.era_year.to_i.localize(:ja)
37
- .to_rbnf_s("SpelloutRules", "spellout-numbering-year")
38
- "#{time.strftime('%JN')}#{era_yr}年"
39
- rescue StandardError
40
- time.year.to_s
21
+ def japanese_date(date, japanese_numbering: false)
22
+ branch = japanese_numbering ? "japanese_numbering" : "default"
23
+ fmts = @labels.dig("date_format", branch) || {}
24
+ IsoDoc::ExtendedDateFormatter.format_iso_date(
25
+ date,
26
+ lang: "ja",
27
+ year: fmts["year"],
28
+ year_month: fmts["year_month"],
29
+ full: fmts["full"],
30
+ )
41
31
  end
42
32
  end
43
33
  end
@@ -24,8 +24,8 @@ module IsoDoc
24
24
  .merge(language: @lang, script: @script, i18nhash: @i18n.get))
25
25
  end
26
26
 
27
- def std_docid_semantic(text)
28
- text
27
+ def annotate_docid?(_id)
28
+ false
29
29
  end
30
30
 
31
31
  def convert_i18n_init1(docxml)
@@ -13,9 +13,11 @@ module IsoDoc
13
13
  tp[:intro] and set(:doctitleintro, tp[:intro].children.to_xml)
14
14
  set(:doctitlepartlabel, title_part_prefix(isoxml, "part", lang))
15
15
  tp[:part] and set(:doctitlepart, tp[:part].children.to_xml)
16
- tn[:amd] and set(:doctitleamdlabel, title_part_prefix(isoxml, "amendment", lang))
16
+ tn[:amd] and set(:doctitleamdlabel,
17
+ title_part_prefix(isoxml, "amendment", lang))
17
18
  tp[:amd] and set(:doctitleamd, tp[:amd].children.to_xml)
18
- tn[:corr] and set(:doctitlecorrlabel, title_part_prefix(isoxml, "corrigendum", lang))
19
+ tn[:corr] and set(:doctitlecorrlabel,
20
+ title_part_prefix(isoxml, "corrigendum", lang))
19
21
  main = compose_title(tp, tn, lang)
20
22
  set(:doctitle, main)
21
23
  end
@@ -28,9 +30,11 @@ module IsoDoc
28
30
  tp[:intro] and set(:docsubtitleintro, tp[:intro].children.to_xml)
29
31
  set(:docsubtitlepartlabel, title_part_prefix(isoxml, "part", lang))
30
32
  tp[:part] and set(:docsubtitlepart, tp[:part].children.to_xml)
31
- tn[:amd] and set(:docsubtitleamdlabel, title_part_prefix(isoxml, "amendment", lang))
33
+ tn[:amd] and set(:docsubtitleamdlabel,
34
+ title_part_prefix(isoxml, "amendment", lang))
32
35
  tp[:amd] and set(:docsubtitleamd, tp[:amd].children.to_xml)
33
- tn[:corr] and set(:docsubtitlecorrlabel, title_part_prefix(isoxml, "corrigendum", lang))
36
+ tn[:corr] and set(:docsubtitlecorrlabel,
37
+ title_part_prefix(isoxml, "corrigendum", lang))
34
38
  main = compose_title(tp, tn, lang)
35
39
  set(:docsubtitle, main)
36
40
  end
@@ -53,15 +57,18 @@ module IsoDoc
53
57
  val = Common::date_range(d)
54
58
  @lang == "ja" && /^\d+[0-9-]+$/.match?(val) and
55
59
  val = @i18n.japanese_date(val)
56
- set("#{d['type'].tr('-', '_')}date".to_sym, val)
60
+ set(:"#{d['type'].tr('-', '_')}date", val)
57
61
  end
58
62
  end
59
63
 
60
64
  def version(isoxml, out)
61
65
  super
62
66
  @lang == "ja" or return
63
- revdate = @i18n.japanese_date(isoxml
64
- .at(ns("//bibdata/version/revision-date"))&.text)
67
+ revdate = if revdate = isoxml.at(ns("//bibdata/date[@type = 'updated']/on"))
68
+ @i18n.japanese_date(revdate.text)
69
+ else
70
+ isoxml.at(ns("//bibdata/date[@type = 'updated']"))&.text
71
+ end
65
72
  set(:revdate, revdate)
66
73
  set(:draftinfo, draftinfo(get[:draft], revdate))
67
74
  end
@@ -74,12 +74,8 @@ module IsoDoc
74
74
  end
75
75
 
76
76
  def date_translate1(date)
77
- j = @i18n.japanese_date(date.strip)
78
- @autonumbering_style == :japanese and
79
- j.gsub!(/(\d+)/) do
80
- $1.to_i.localize(:ja).spellout
81
- end
82
- j
77
+ ja = @autonumbering_style == :japanese
78
+ @i18n.japanese_date(date.strip, japanese_numbering: ja)
83
79
  end
84
80
 
85
81
  def edition_integer?(bibdata)
@@ -187,6 +187,15 @@ Applicable to modify and delete</a:documentation>
187
187
  <a:documentation>Optional caption of this block</a:documentation>
188
188
  </attribute>
189
189
  </optional>
190
+ <optional>
191
+ <attribute name="position">
192
+ <a:documentation>For an "add" change, whether the change is added before or after the location</a:documentation>
193
+ <choice>
194
+ <value>before</value>
195
+ <value>after</value>
196
+ </choice>
197
+ </attribute>
198
+ </optional>
190
199
  <optional>
191
200
  <element name="location">
192
201
  <a:documentation>The location(s) in the original document which have undergone the change described in this block</a:documentation>
@@ -1142,11 +1142,11 @@ NOTE: This should preferably be encoded as a URI or short identifier, rather th
1142
1142
  <a:documentation>Information about how long the current description of the bibliographic item is valid for</a:documentation>
1143
1143
  </ref>
1144
1144
  </optional>
1145
- <optional>
1145
+ <zeroOrMore>
1146
1146
  <ref name="depiction">
1147
1147
  <a:documentation>Depiction of the bibliographic item, typically an image</a:documentation>
1148
1148
  </ref>
1149
- </optional>
1149
+ </zeroOrMore>
1150
1150
  </define>
1151
1151
  <define name="ReducedBibliographicItem">
1152
1152
  <a:documentation>Reduced description of a bibliographic resource, without mandatory title and docidentifier, used for document relations
@@ -2015,15 +2015,11 @@ provided that it is not the entire bibliographic item that is so related</a:docu
2015
2015
  <a:documentation>A version of the bibliographic item (within an edition). Can be used for drafts</a:documentation>
2016
2016
  <element name="version">
2017
2017
  <optional>
2018
- <ref name="revision-date">
2019
- <a:documentation>The date at which the current version of the bibliographic item was produced</a:documentation>
2020
- </ref>
2021
- </optional>
2022
- <optional>
2023
- <ref name="draft">
2024
- <a:documentation>The identifier for the current draft of the bibliographic item</a:documentation>
2025
- </ref>
2018
+ <attribute name="type">
2019
+ <a:documentation>Versioning scheme, in case of multiple versioning schemes</a:documentation>
2020
+ </attribute>
2026
2021
  </optional>
2022
+ <text/>
2027
2023
  </element>
2028
2024
  </define>
2029
2025
  <define name="vedition">
@@ -2063,13 +2059,13 @@ provided that it is not the entire bibliographic item that is so related</a:docu
2063
2059
  <ref name="LocalizedString"/>
2064
2060
  </element>
2065
2061
  </optional>
2066
- <oneOrMore>
2062
+ <zeroOrMore>
2067
2063
  <element name="taxon">
2068
2064
  <a:documentation>The keywords as a hierarchical taxonomy. For example, the sequence of `taxon` elements
2069
2065
  `pump`, `centrifugal pump`, `line shaft pump` represents a taxonomic classification</a:documentation>
2070
2066
  <ref name="LocalizedString"/>
2071
2067
  </element>
2072
- </oneOrMore>
2068
+ </zeroOrMore>
2073
2069
  <zeroOrMore>
2074
2070
  <ref name="vocabid">
2075
2071
  <a:documentation>Identifiers for the keyword as a controlled vocabulary</a:documentation>
@@ -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.5 -->
3
+ <!-- VERSION v2.1.6 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -164,6 +164,9 @@ Sources are currently only rendered in metanorma-plateau</a:documentation>
164
164
  </choice>
165
165
  </attribute>
166
166
  </optional>
167
+ <optional>
168
+ <ref name="DisplayDirective"/>
169
+ </optional>
167
170
  </define>
168
171
  <define name="DlAttributes">
169
172
  <ref name="BlockAttributes"/>
@@ -814,6 +817,9 @@ titlecase, or lowercase</a:documentation>
814
817
  </define>
815
818
  <define name="UlAttributes" combine="interleave">
816
819
  <ref name="BlockAttributes"/>
820
+ <optional>
821
+ <ref name="DisplayDirective"/>
822
+ </optional>
817
823
  </define>
818
824
  <define name="TableAttributes" combine="interleave">
819
825
  <optional>
@@ -1968,7 +1974,7 @@ used in document amendments</a:documentation>
1968
1974
  <a:documentation>Zero or more examples of how the term is to be used</a:documentation>
1969
1975
  </ref>
1970
1976
  </zeroOrMore>
1971
- <ref name="TermSource">
1977
+ <ref name="TermSources">
1972
1978
  <a:documentation>Bibliographic references for the managed term</a:documentation>
1973
1979
  </ref>
1974
1980
  </element>
@@ -2077,7 +2083,7 @@ used in document amendments</a:documentation>
2077
2083
  <a:documentation>Information about how the designation is to be used</a:documentation>
2078
2084
  </ref>
2079
2085
  </optional>
2080
- <ref name="TermSource">
2086
+ <ref name="TermSources">
2081
2087
  <a:documentation>Bibliographic references for this designation of the managed term</a:documentation>
2082
2088
  </ref>
2083
2089
  </define>
@@ -2348,7 +2354,7 @@ used in document amendments</a:documentation>
2348
2354
  <ref name="formula"/>
2349
2355
  </choice>
2350
2356
  </oneOrMore>
2351
- <ref name="TermSource">
2357
+ <ref name="TermSources">
2352
2358
  <a:documentation>Bibliographic references for this designation of the managed term</a:documentation>
2353
2359
  </ref>
2354
2360
  </element>
@@ -2365,7 +2371,7 @@ used in document amendments</a:documentation>
2365
2371
  <ref name="formula"/>
2366
2372
  </choice>
2367
2373
  </oneOrMore>
2368
- <ref name="TermSource">
2374
+ <ref name="TermSources">
2369
2375
  <a:documentation>Bibliographic references for this designation of the managed term</a:documentation>
2370
2376
  </ref>
2371
2377
  </element>
@@ -2788,6 +2794,26 @@ to span across both columns</a:documentation>
2788
2794
  </attribute>
2789
2795
  </optional>
2790
2796
  </define>
2797
+ <define name="DisplayDirective">
2798
+ <a:documentation>Directive on how to render a block in Presentation XML </a:documentation>
2799
+ <optional>
2800
+ <attribute name="display">
2801
+ <a:documentation>Display style for block.
2802
+ If the block is `ol` or `ul` and dispay is `table`,
2803
+ the list is to be rendered as a table, with a column for each nested level, and a row for each terminal sublist</a:documentation>
2804
+ </attribute>
2805
+ </optional>
2806
+ <optional>
2807
+ <attribute name="display-directives">
2808
+ <a:documentation>display-directives is a key-value set of attributes, guiding how the rendering of the block should happen.
2809
+ The key-value set is comma-delimited, and encoded as `key1='value1',key2='value'`,
2810
+ as with stem//mn/@data-metanorma-numberformat
2811
+ * If the block is `ol` or `ul` and dispay is `table`, display-directives can have the value `colgroup='col1,col2,...coln'`,
2812
+ where each col value is a percentage width of the column in the output table (with no % suffix).
2813
+ e.g. `colgroup='50,33.3,16.7'` </a:documentation>
2814
+ </attribute>
2815
+ </optional>
2816
+ </define>
2791
2817
  <define name="ReferencesAttributes">
2792
2818
  <optional>
2793
2819
  <attribute name="obligation">
@@ -2800,7 +2826,7 @@ Normative References contents contain normative references, but as a clause in t
2800
2826
  <data type="boolean"/>
2801
2827
  </attribute>
2802
2828
  </define>
2803
- <define name="TermSource">
2829
+ <define name="TermSources">
2804
2830
  <zeroOrMore>
2805
2831
  <ref name="termsource"/>
2806
2832
  </zeroOrMore>
@@ -47,7 +47,15 @@ the tag name of the top level containers</a:documentation>
47
47
  </optional>
48
48
  <optional>
49
49
  <attribute name="model">
50
- <a:documentation>Model of requirements realised by this requirement, e.g. "ogc" for Modspec</a:documentation>
50
+ <a:documentation>Model of requirements realised by this requirement, e.g. "ogc" for Modspec.
51
+ Current legal values: ogc, default</a:documentation>
52
+ </attribute>
53
+ </optional>
54
+ <optional>
55
+ <attribute name="render">
56
+ <a:documentation>Rendering of requirements realised by this requirement. Current legal values:
57
+ default:: default, inline
58
+ ogc:: default</a:documentation>
51
59
  </attribute>
52
60
  </optional>
53
61
  <optional>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Jis
3
- VERSION = "1.0.8".freeze
3
+ VERSION = "1.1.1".freeze
4
4
  end
5
5
  end
6
6
 
@@ -31,10 +31,10 @@ 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.4.0"
34
+ spec.add_dependency "metanorma-iso", "~> 3.4.2"
35
35
  spec.add_dependency "pubid"
36
36
 
37
- spec.add_development_dependency "canon", "= 0.2.3"
37
+ spec.add_development_dependency "canon"# , "= 0.2.3"
38
38
  spec.add_development_dependency "debug"
39
39
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
40
40
  spec.add_development_dependency "guard", "~> 2.14"
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: 1.0.8
4
+ version: 1.1.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: 2026-04-27 00:00:00.000000000 Z
11
+ date: 2026-05-25 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.4.0
33
+ version: 3.4.2
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.4.0
40
+ version: 3.4.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pubid
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: canon
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.2.3
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.2.3
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debug
71
71
  requirement: !ruby/object:Gem::Requirement