metanorma-ribose 1.6.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.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/macos.yml +41 -0
  3. data/.github/workflows/ubuntu.yml +45 -0
  4. data/.github/workflows/windows.yml +43 -0
  5. data/.gitignore +1 -0
  6. data/.hound.yml +3 -0
  7. data/.rubocop.yml +10 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +11 -0
  10. data/LICENSE +25 -0
  11. data/README.adoc +70 -0
  12. data/Rakefile +8 -0
  13. data/bin/console +14 -0
  14. data/bin/rspec +18 -0
  15. data/bin/setup +8 -0
  16. data/lib/asciidoctor/ribose.rb +4 -0
  17. data/lib/asciidoctor/ribose/basicdoc.rng +1059 -0
  18. data/lib/asciidoctor/ribose/biblio.rng +1237 -0
  19. data/lib/asciidoctor/ribose/boilerplate.xml +47 -0
  20. data/lib/asciidoctor/ribose/converter.rb +75 -0
  21. data/lib/asciidoctor/ribose/isodoc.rng +1510 -0
  22. data/lib/asciidoctor/ribose/reqt.rng +194 -0
  23. data/lib/asciidoctor/ribose/rsd.rng +79 -0
  24. data/lib/isodoc/ribose/base_convert.rb +21 -0
  25. data/lib/isodoc/ribose/html/header.html +242 -0
  26. data/lib/isodoc/ribose/html/html_rsd_intro.html +8 -0
  27. data/lib/isodoc/ribose/html/html_rsd_titlepage.html +90 -0
  28. data/lib/isodoc/ribose/html/htmlstyle.css +1004 -0
  29. data/lib/isodoc/ribose/html/htmlstyle.scss +751 -0
  30. data/lib/isodoc/ribose/html/logo.png +0 -0
  31. data/lib/isodoc/ribose/html/logo.svg +1 -0
  32. data/lib/isodoc/ribose/html/rsd.css +798 -0
  33. data/lib/isodoc/ribose/html/rsd.scss +759 -0
  34. data/lib/isodoc/ribose/html/scripts.html +71 -0
  35. data/lib/isodoc/ribose/html/word_rsd_intro.html +8 -0
  36. data/lib/isodoc/ribose/html/word_rsd_titlepage.html +119 -0
  37. data/lib/isodoc/ribose/html/wordstyle.css +1266 -0
  38. data/lib/isodoc/ribose/html/wordstyle.scss +1169 -0
  39. data/lib/isodoc/ribose/html_convert.rb +36 -0
  40. data/lib/isodoc/ribose/init.rb +19 -0
  41. data/lib/isodoc/ribose/metadata.rb +17 -0
  42. data/lib/isodoc/ribose/pdf_convert.rb +19 -0
  43. data/lib/isodoc/ribose/presentation_xml_convert.rb +17 -0
  44. data/lib/isodoc/ribose/rsd.standard.xsl +3458 -0
  45. data/lib/isodoc/ribose/word_convert.rb +33 -0
  46. data/lib/isodoc/ribose/xref.rb +31 -0
  47. data/lib/metanorma-ribose.rb +14 -0
  48. data/lib/metanorma/ribose.rb +32 -0
  49. data/lib/metanorma/ribose/processor.rb +38 -0
  50. data/lib/metanorma/ribose/version.rb +5 -0
  51. data/metanorma-ribose.gemspec +44 -0
  52. data/metanorma.yml +36 -0
  53. metadata +267 -0
@@ -0,0 +1,33 @@
1
+ require "isodoc"
2
+ require "isodoc/generic/word_convert"
3
+ require "isodoc/ribose/metadata"
4
+ require_relative "init"
5
+
6
+ module IsoDoc
7
+ module Ribose
8
+ # A {Converter} implementation that generates Word output, and a document
9
+ # schema encapsulation of the document for validation
10
+ class WordConvert < IsoDoc::Generic::WordConvert
11
+ def configuration
12
+ Metanorma::Ribose.configuration
13
+ end
14
+
15
+ def make_body2(body, docxml)
16
+ body.div **{ class: "WordSection2" } do |div2|
17
+ boilerplate docxml, div2
18
+ abstract docxml, div2
19
+ foreword docxml, div2
20
+ executivesummary docxml, div2
21
+ introduction docxml, div2
22
+ preface docxml, div2
23
+ acknowledgements docxml, div2
24
+ div2.p { |p| p << "&nbsp;" } # placeholder
25
+ end
26
+ section_break(body)
27
+ end
28
+
29
+ include BaseConvert
30
+ include Init
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,31 @@
1
+ require "metanorma-generic"
2
+
3
+ module IsoDoc
4
+ module Ribose
5
+ class Xref < IsoDoc::Generic::Xref
6
+ def annex_name_lbl(clause, num)
7
+ obl = l10n("(#{@labels['inform_annex']})")
8
+ obl = l10n("(#{@labels['norm_annex']})") if clause["obligation"] == "normative"
9
+ l10n("#{@labels['annex']} #{num}<br/>#{obl}")
10
+ end
11
+
12
+ def initial_anchor_names(d)
13
+ preface_names(d.at(ns("//executivesummary")))
14
+ super
15
+ sequential_asset_names(
16
+ d.xpath(ns("//preface/abstract | //foreword | //introduction | "\
17
+ "//preface/clause | //acknowledgements | //executivesummary")))
18
+ end
19
+
20
+ def section_names1(clause, num, level)
21
+ @anchors[clause["id"]] =
22
+ { label: num, level: level, xref: num }
23
+ # subclauses are not prefixed with "Clause"
24
+ clause.xpath(ns("./clause | ./terms | ./term | ./definitions | ./references")).
25
+ each_with_index do |c, i|
26
+ section_names1(c, "#{num}.#{i + 1}", level + 1)
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,14 @@
1
+ require "asciidoctor" unless defined? Asciidoctor::Converter
2
+ require_relative "asciidoctor/ribose/converter"
3
+ require_relative "isodoc/ribose/base_convert"
4
+ require_relative "isodoc/ribose/html_convert"
5
+ require_relative "isodoc/ribose/word_convert"
6
+ require_relative "isodoc/ribose/pdf_convert"
7
+ require_relative "isodoc/ribose/presentation_xml_convert"
8
+ require_relative "isodoc/ribose/xref"
9
+ require_relative "metanorma/ribose/version"
10
+
11
+ if defined? Metanorma
12
+ require_relative "metanorma/ribose"
13
+ Metanorma::Registry.instance.register(Metanorma::Ribose::Processor)
14
+ end
@@ -0,0 +1,32 @@
1
+ require "metanorma"
2
+ require "metanorma-generic"
3
+ require "metanorma/ribose/processor"
4
+
5
+ module Metanorma
6
+ module Ribose
7
+
8
+ class Configuration < Metanorma::Generic::Configuration
9
+ def initialize(*args)
10
+ super
11
+ end
12
+ end
13
+
14
+ class << self
15
+ extend Forwardable
16
+
17
+ attr_accessor :configuration
18
+
19
+ Configuration::CONFIG_ATTRS.each do |attr_name|
20
+ def_delegator :@configuration, attr_name
21
+ end
22
+
23
+ def configure
24
+ self.configuration ||= Configuration.new
25
+ yield(configuration)
26
+ end
27
+ end
28
+
29
+ configure {}
30
+ end
31
+ end
32
+ Metanorma::Registry.instance.register(Metanorma::Ribose::Processor)
@@ -0,0 +1,38 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module Ribose
5
+ class Processor < Metanorma::Generic::Processor
6
+ def configuration
7
+ Metanorma::Ribose.configuration
8
+ end
9
+
10
+ def output_formats
11
+ super.merge(
12
+ html: "html",
13
+ doc: "doc",
14
+ pdf: "pdf"
15
+ )
16
+ end
17
+
18
+ def version
19
+ "Metanorma::Ribose #{Metanorma::Ribose::VERSION}"
20
+ end
21
+
22
+ def output(isodoc_node, inname, outname, format, options={})
23
+ case format
24
+ when :html
25
+ IsoDoc::Ribose::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
26
+ when :doc
27
+ IsoDoc::Ribose::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
28
+ when :pdf
29
+ IsoDoc::Ribose::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
30
+ when :presentation
31
+ IsoDoc::Ribose::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
32
+ else
33
+ super
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ module Metanorma
2
+ module Ribose
3
+ VERSION = "1.6.0"
4
+ end
5
+ end
@@ -0,0 +1,44 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "metanorma/ribose/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "metanorma-ribose"
7
+ spec.version = Metanorma::Ribose::VERSION
8
+ spec.authors = ["Ribose Inc."]
9
+ spec.email = ["open.source@ribose.com"]
10
+
11
+ spec.summary = "metanorma-ribose lets you write Ribose standards in AsciiDoc."
12
+ spec.description = <<~DESCRIPTION
13
+ metanorma-ribose lets you write Ribose standards in AsciiDoc syntax.
14
+
15
+ This gem is in active development.
16
+
17
+ Formerly known as asciidoctor-rsd, metanorma-rsd.
18
+ DESCRIPTION
19
+
20
+ spec.homepage = "https://github.com/metanorma/metanorma-ribose"
21
+ spec.license = "BSD-2-Clause"
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
+ f.match(%r{^(test|spec|features)/})
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
+
31
+ spec.add_dependency "isodoc", "~> 1.2.0"
32
+ spec.add_dependency 'metanorma-generic', '~> 1.6.0'
33
+
34
+ spec.add_development_dependency "byebug", "~> 9.1"
35
+ spec.add_development_dependency "sassc", "2.4.0"
36
+ spec.add_development_dependency "equivalent-xml", "~> 0.6"
37
+ spec.add_development_dependency "guard", "~> 2.14"
38
+ spec.add_development_dependency "guard-rspec", "~> 4.7"
39
+ spec.add_development_dependency "rake", "~> 12.0"
40
+ spec.add_development_dependency "rspec", "~> 3.6"
41
+ spec.add_development_dependency "rubocop", "= 0.54.0"
42
+ spec.add_development_dependency "simplecov", "~> 0.15"
43
+ spec.add_development_dependency "timecop", "~> 0.9"
44
+ end
@@ -0,0 +1,36 @@
1
+ metanorma_name: ribose
2
+ organization_name_short: Ribose
3
+ organization_name_long: Ribose
4
+ document_namespace: https://www.metanorma.org/ns/rsd
5
+ xml_root_tag: 'rsd-standard'
6
+ logo_path: lib/isodoc/ribose/html/logo.png
7
+ validate_rng_file: lib/asciidoctor/ribose/rsd.rng
8
+ htmlcoverpage: lib/isodoc/ribose/html/html_rsd_titlepage.html
9
+ htmlintropage: lib/isodoc/ribose/html/html_rsd_intro.html
10
+ htmlstylesheet: lib/isodoc/ribose/html/htmlstyle.scss
11
+ html_bodyfont: '"Source Sans Pro",sans-serif'
12
+ html_headerfont: '"Source Sans Pro",sans-serif'
13
+ html_monospacefont: '"Source Code Pro",monospace'
14
+ scripts: lib/isodoc/ribose/html/scripts.html
15
+ scripts_pdf: lib/isodoc/ribose/html/scripts.pdf.html
16
+ standardstylesheet: lib/isodoc/ribose/html/rsd.scss
17
+ header: lib/isodoc/ribose/html/header.html
18
+ wordcoverpage: lib/isodoc/ribose/html/word_rsd_titlepage.html
19
+ wordintropage: lib/isodoc/ribose/html/word_rsd_intro.html
20
+ wordstylesheet: lib/isodoc/ribose/html/wordstyle.scss
21
+ word_bodyfont: '"Source Sans Pro","Arial",sans-serif'
22
+ word_headerfont: '"Source Sans Pro","Arial",sans-serif'
23
+ word_monospacefont: '"Source Code Pro",monospace'
24
+ docid_template: "{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}"
25
+ published_stages:
26
+ - published
27
+ stage_abbreviations:
28
+ working-draft: wd
29
+ committee-draft: cd
30
+ draft-standard: d
31
+ metadata_extensions:
32
+ - security
33
+ - recipient
34
+ webfont:
35
+ - "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,600,600i&display=swap"
36
+ - "https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,300;0,600;1,300;1,600&display=swap"
metadata ADDED
@@ -0,0 +1,267 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: metanorma-ribose
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.0
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-07-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: isodoc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: metanorma-generic
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.6.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.6.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '9.1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '9.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sassc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.4.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.4.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: equivalent-xml
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.14'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.14'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '4.7'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '4.7'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '12.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '12.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.6'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.6'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 0.54.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 0.54.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: simplecov
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.15'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '0.15'
167
+ - !ruby/object:Gem::Dependency
168
+ name: timecop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.9'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.9'
181
+ description: |
182
+ metanorma-ribose lets you write Ribose standards in AsciiDoc syntax.
183
+
184
+ This gem is in active development.
185
+
186
+ Formerly known as asciidoctor-rsd, metanorma-rsd.
187
+ email:
188
+ - open.source@ribose.com
189
+ executables: []
190
+ extensions: []
191
+ extra_rdoc_files: []
192
+ files:
193
+ - ".github/workflows/macos.yml"
194
+ - ".github/workflows/ubuntu.yml"
195
+ - ".github/workflows/windows.yml"
196
+ - ".gitignore"
197
+ - ".hound.yml"
198
+ - ".rubocop.yml"
199
+ - CODE_OF_CONDUCT.md
200
+ - Gemfile
201
+ - LICENSE
202
+ - README.adoc
203
+ - Rakefile
204
+ - bin/console
205
+ - bin/rspec
206
+ - bin/setup
207
+ - lib/asciidoctor/ribose.rb
208
+ - lib/asciidoctor/ribose/basicdoc.rng
209
+ - lib/asciidoctor/ribose/biblio.rng
210
+ - lib/asciidoctor/ribose/boilerplate.xml
211
+ - lib/asciidoctor/ribose/converter.rb
212
+ - lib/asciidoctor/ribose/isodoc.rng
213
+ - lib/asciidoctor/ribose/reqt.rng
214
+ - lib/asciidoctor/ribose/rsd.rng
215
+ - lib/isodoc/ribose/base_convert.rb
216
+ - lib/isodoc/ribose/html/header.html
217
+ - lib/isodoc/ribose/html/html_rsd_intro.html
218
+ - lib/isodoc/ribose/html/html_rsd_titlepage.html
219
+ - lib/isodoc/ribose/html/htmlstyle.css
220
+ - lib/isodoc/ribose/html/htmlstyle.scss
221
+ - lib/isodoc/ribose/html/logo.png
222
+ - lib/isodoc/ribose/html/logo.svg
223
+ - lib/isodoc/ribose/html/rsd.css
224
+ - lib/isodoc/ribose/html/rsd.scss
225
+ - lib/isodoc/ribose/html/scripts.html
226
+ - lib/isodoc/ribose/html/word_rsd_intro.html
227
+ - lib/isodoc/ribose/html/word_rsd_titlepage.html
228
+ - lib/isodoc/ribose/html/wordstyle.css
229
+ - lib/isodoc/ribose/html/wordstyle.scss
230
+ - lib/isodoc/ribose/html_convert.rb
231
+ - lib/isodoc/ribose/init.rb
232
+ - lib/isodoc/ribose/metadata.rb
233
+ - lib/isodoc/ribose/pdf_convert.rb
234
+ - lib/isodoc/ribose/presentation_xml_convert.rb
235
+ - lib/isodoc/ribose/rsd.standard.xsl
236
+ - lib/isodoc/ribose/word_convert.rb
237
+ - lib/isodoc/ribose/xref.rb
238
+ - lib/metanorma-ribose.rb
239
+ - lib/metanorma/ribose.rb
240
+ - lib/metanorma/ribose/processor.rb
241
+ - lib/metanorma/ribose/version.rb
242
+ - metanorma-ribose.gemspec
243
+ - metanorma.yml
244
+ homepage: https://github.com/metanorma/metanorma-ribose
245
+ licenses:
246
+ - BSD-2-Clause
247
+ metadata: {}
248
+ post_install_message:
249
+ rdoc_options: []
250
+ require_paths:
251
+ - lib
252
+ required_ruby_version: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ">="
255
+ - !ruby/object:Gem::Version
256
+ version: 2.4.0
257
+ required_rubygems_version: !ruby/object:Gem::Requirement
258
+ requirements:
259
+ - - ">="
260
+ - !ruby/object:Gem::Version
261
+ version: '0'
262
+ requirements: []
263
+ rubygems_version: 3.0.3
264
+ signing_key:
265
+ specification_version: 4
266
+ summary: metanorma-ribose lets you write Ribose standards in AsciiDoc.
267
+ test_files: []