metanorma-ribose 1.6.16 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -13
- data/.hound.yml +3 -1
- data/.rubocop.yml +3 -7
- data/Gemfile +2 -2
- data/README.adoc +10 -18
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/lib/asciidoctor/ribose/biblio.rng +1 -0
- data/lib/asciidoctor/ribose/boilerplate.xml +6 -6
- data/lib/asciidoctor/ribose/converter.rb +18 -15
- data/lib/asciidoctor/ribose/isodoc.rng +321 -4
- data/lib/asciidoctor/ribose/rsd.rng +3 -0
- data/lib/isodoc/ribose/base_convert.rb +2 -1
- data/lib/isodoc/ribose/html/header.html +10 -10
- data/lib/isodoc/ribose/html/html_rsd_titlepage.html +6 -6
- data/lib/isodoc/ribose/html/htmlstyle.css +7 -0
- data/lib/isodoc/ribose/html/word_rsd_intro.html +1 -1
- data/lib/isodoc/ribose/html_convert.rb +13 -14
- data/lib/isodoc/ribose/i18n-en.yaml +1 -0
- data/lib/isodoc/ribose/init.rb +8 -2
- data/lib/isodoc/ribose/presentation_xml_convert.rb +3 -4
- data/lib/isodoc/ribose/ribose.standard.xsl +951 -339
- data/lib/isodoc/ribose/xref.rb +26 -7
- data/lib/metanorma/ribose.rb +0 -4
- data/lib/metanorma/ribose/processor.rb +10 -6
- data/lib/metanorma/ribose/version.rb +1 -1
- data/metanorma-ribose.gemspec +3 -3
- data/metanorma.yml +1 -0
- metadata +19 -18
data/lib/isodoc/ribose/xref.rb
CHANGED
@@ -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
|
-
|
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(
|
16
|
-
preface_names(
|
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
|
-
|
20
|
-
|
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 |
|
29
|
-
|
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
|
data/lib/metanorma/ribose.rb
CHANGED
@@ -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)
|
34
|
+
IsoDoc::Ribose::HtmlConvert.new(options)
|
35
|
+
.convert(inname, isodoc_node, nil, outname)
|
35
36
|
when :doc
|
36
|
-
IsoDoc::Ribose::WordConvert.new(options)
|
37
|
+
IsoDoc::Ribose::WordConvert.new(options)
|
38
|
+
.convert(inname, isodoc_node, nil, outname)
|
37
39
|
when :pdf
|
38
|
-
IsoDoc::Ribose::PdfConvert.new(options)
|
40
|
+
IsoDoc::Ribose::PdfConvert.new(options)
|
41
|
+
.convert(inname, isodoc_node, nil, outname)
|
39
42
|
when :presentation
|
40
|
-
IsoDoc::Ribose::PresentationXMLConvert.new(options)
|
43
|
+
IsoDoc::Ribose::PresentationXMLConvert.new(options)
|
44
|
+
.convert(inname, isodoc_node, nil, outname)
|
41
45
|
else
|
42
46
|
super
|
43
47
|
end
|
data/metanorma-ribose.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path("
|
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
|
|
@@ -28,16 +28,16 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
30
30
|
|
31
|
-
spec.add_dependency
|
31
|
+
spec.add_dependency "metanorma-generic", "~> 1.10.0"
|
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.
|
4
|
+
version: 1.7.4
|
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-
|
11
|
+
date: 2021-06-07 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.
|
19
|
+
version: 1.10.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: 1.
|
26
|
+
version: 1.10.0
|
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
|