metanorma-ribose 1.7.3 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,16 +8,21 @@ module IsoDoc
8
8
  class Xref < IsoDoc::Generic::Xref
9
9
  def annex_name_lbl(clause, num)
10
10
  obl = l10n("(#{@labels['inform_annex']})")
11
- obl = l10n("(#{@labels['norm_annex']})") if clause["obligation"] == "normative"
11
+ clause["obligation"] == "normative" and
12
+ obl = l10n("(#{@labels['norm_annex']})")
12
13
  l10n("#{@labels['annex']} #{num}<br/>#{obl}")
13
14
  end
14
15
 
15
- def initial_anchor_names(d)
16
- preface_names(d.at(ns("//executivesummary")))
16
+ def initial_anchor_names(doc)
17
+ preface_names(doc.at(ns("//executivesummary")))
17
18
  super
19
+ introduction_names(doc.at(ns("//introduction")))
18
20
  sequential_asset_names(
19
- d.xpath(ns("//preface/abstract | //foreword | //introduction | "\
20
- "//preface/clause | //acknowledgements | //executivesummary")))
21
+ doc.xpath(
22
+ ns("//preface/abstract | //foreword | //introduction | "\
23
+ "//preface/clause | //acknowledgements | //executivesummary"),
24
+ ),
25
+ )
21
26
  end
22
27
 
23
28
  def section_names1(clause, num, level)
@@ -25,12 +30,26 @@ module IsoDoc
25
30
  { label: num, level: level, xref: num }
26
31
  # subclauses are not prefixed with "Clause"
27
32
  i = Counter.new
28
- clause.xpath(ns("./clause | ./terms | ./term | ./definitions | ./references")).
29
- each do |c|
33
+ clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
34
+ "./references")).each do |c|
30
35
  i.increment(c)
31
36
  section_names1(c, "#{num}.#{i.print}", level + 1)
32
37
  end
33
38
  end
39
+
40
+ # we can reference 0-number clauses in introduction
41
+ def introduction_names(clause)
42
+ return if clause.nil?
43
+
44
+ clause.at(ns("./clause")) and
45
+ @anchors[clause["id"]] = { label: "0", level: 1, type: "clause",
46
+ xref: clause.at(ns("./title"))&.text }
47
+ i = Counter.new
48
+ clause.xpath(ns("./clause")).each do |c|
49
+ i.increment(c)
50
+ section_names1(c, "0.#{i.print}", 2)
51
+ end
52
+ end
34
53
  end
35
54
  end
36
55
  end
@@ -4,11 +4,7 @@ require "metanorma/ribose/processor"
4
4
 
5
5
  module Metanorma
6
6
  module Ribose
7
-
8
7
  class Configuration < Metanorma::Generic::Configuration
9
- def initialize(*args)
10
- super
11
- end
12
8
  end
13
9
 
14
10
  class << self
@@ -11,7 +11,7 @@ module Metanorma
11
11
  super.merge(
12
12
  html: "html",
13
13
  doc: "doc",
14
- pdf: "pdf"
14
+ pdf: "pdf",
15
15
  )
16
16
  end
17
17
 
@@ -28,16 +28,20 @@ module Metanorma
28
28
  "Metanorma::Ribose #{Metanorma::Ribose::VERSION}"
29
29
  end
30
30
 
31
- def output(isodoc_node, inname, outname, format, options={})
31
+ def output(isodoc_node, inname, outname, format, options = {})
32
32
  case format
33
33
  when :html
34
- IsoDoc::Ribose::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
34
+ IsoDoc::Ribose::HtmlConvert.new(options)
35
+ .convert(inname, isodoc_node, nil, outname)
35
36
  when :doc
36
- IsoDoc::Ribose::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
37
+ IsoDoc::Ribose::WordConvert.new(options)
38
+ .convert(inname, isodoc_node, nil, outname)
37
39
  when :pdf
38
- IsoDoc::Ribose::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
40
+ IsoDoc::Ribose::PdfConvert.new(options)
41
+ .convert(inname, isodoc_node, nil, outname)
39
42
  when :presentation
40
- IsoDoc::Ribose::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
43
+ IsoDoc::Ribose::PresentationXMLConvert.new(options)
44
+ .convert(inname, isodoc_node, nil, outname)
41
45
  else
42
46
  super
43
47
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "1.7.3".freeze
3
+ VERSION = "1.7.7".freeze
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require "metanorma/ribose/version"
4
4
 
@@ -26,18 +26,18 @@ Gem::Specification.new do |spec|
26
26
  spec.bindir = "exe"
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
29
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
30
 
31
- spec.add_dependency 'metanorma-generic', '~> 1.10.0'
31
+ spec.add_dependency "metanorma-generic", "~> 1.10.2"
32
32
 
33
33
  spec.add_development_dependency "byebug", "~> 9.1"
34
- spec.add_development_dependency "sassc", "2.4.0"
35
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
35
  spec.add_development_dependency "guard", "~> 2.14"
37
36
  spec.add_development_dependency "guard-rspec", "~> 4.7"
38
37
  spec.add_development_dependency "rake", "~> 13.0"
39
38
  spec.add_development_dependency "rspec", "~> 3.6"
40
39
  spec.add_development_dependency "rubocop", "~> 1.5.2"
40
+ spec.add_development_dependency "sassc", "2.4.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
43
  end
data/metanorma.yml CHANGED
@@ -5,6 +5,7 @@ document_namespace: https://www.metanorma.org/ns/rsd
5
5
  xml_root_tag: 'rsd-standard'
6
6
  logo_path: lib/isodoc/ribose/html/logo.png
7
7
  validate_rng_file: lib/asciidoctor/ribose/rsd.rng
8
+ i18nyaml: lib/isodoc/ribose/i18n-en.yaml
8
9
  htmlcoverpage: lib/isodoc/ribose/html/html_rsd_titlepage.html
9
10
  htmlintropage: lib/isodoc/ribose/html/html_rsd_intro.html
10
11
  htmlstylesheet: lib/isodoc/ribose/html/htmlstyle.scss
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 1.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.0
19
+ version: 1.10.2
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: 1.10.0
26
+ version: 1.10.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '9.1'
41
- - !ruby/object:Gem::Dependency
42
- name: sassc
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '='
46
- - !ruby/object:Gem::Version
47
- version: 2.4.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 2.4.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: equivalent-xml
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +122,20 @@ dependencies:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
124
  version: 1.5.2
125
+ - !ruby/object:Gem::Dependency
126
+ name: sassc
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '='
130
+ - !ruby/object:Gem::Version
131
+ version: 2.4.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '='
137
+ - !ruby/object:Gem::Version
138
+ version: 2.4.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -212,6 +212,7 @@ files:
212
212
  - lib/isodoc/ribose/html/wordstyle.css
213
213
  - lib/isodoc/ribose/html/wordstyle.scss
214
214
  - lib/isodoc/ribose/html_convert.rb
215
+ - lib/isodoc/ribose/i18n-en.yaml
215
216
  - lib/isodoc/ribose/init.rb
216
217
  - lib/isodoc/ribose/metadata.rb
217
218
  - lib/isodoc/ribose/pdf_convert.rb
@@ -237,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
237
238
  requirements:
238
239
  - - ">="
239
240
  - !ruby/object:Gem::Version
240
- version: 2.4.0
241
+ version: 2.5.0
241
242
  required_rubygems_version: !ruby/object:Gem::Requirement
242
243
  requirements:
243
244
  - - ">="