metanorma-vg 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/macos.yml +39 -0
  3. data/.github/workflows/ubuntu.yml +53 -0
  4. data/.github/workflows/windows.yml +41 -0
  5. data/.gitignore +1 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Gemfile +11 -0
  8. data/LICENSE +25 -0
  9. data/README.adoc +105 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +14 -0
  12. data/bin/rspec +18 -0
  13. data/bin/setup +8 -0
  14. data/lib/asciidoctor/vg.rb +8 -0
  15. data/lib/asciidoctor/vg/basicdoc.rng +1059 -0
  16. data/lib/asciidoctor/vg/biblio.rng +1237 -0
  17. data/lib/asciidoctor/vg/converter.rb +29 -0
  18. data/lib/asciidoctor/vg/isodoc.rng +1504 -0
  19. data/lib/asciidoctor/vg/reqt.rng +194 -0
  20. data/lib/asciidoctor/vg/vsd.rng +79 -0
  21. data/lib/isodoc/vg.rb +9 -0
  22. data/lib/isodoc/vg/html/header.html +242 -0
  23. data/lib/isodoc/vg/html/html_vsd_intro.html +8 -0
  24. data/lib/isodoc/vg/html/html_vsd_titlepage.html +106 -0
  25. data/lib/isodoc/vg/html/htmlstyle.scss +717 -0
  26. data/lib/isodoc/vg/html/logo.png +0 -0
  27. data/lib/isodoc/vg/html/scripts.html +71 -0
  28. data/lib/isodoc/vg/html/vsd.scss +687 -0
  29. data/lib/isodoc/vg/html/word_vsd_intro.html +3 -0
  30. data/lib/isodoc/vg/html/word_vsd_titlepage.html +71 -0
  31. data/lib/isodoc/vg/html/wordstyle.scss +1152 -0
  32. data/lib/isodoc/vg/html_convert.rb +21 -0
  33. data/lib/isodoc/vg/metadata.rb +11 -0
  34. data/lib/isodoc/vg/presentation_xml_convert.rb +10 -0
  35. data/lib/isodoc/vg/word_convert.rb +19 -0
  36. data/lib/metanorma-vg.rb +11 -0
  37. data/lib/metanorma/vg.rb +32 -0
  38. data/lib/metanorma/vg/processor.rb +37 -0
  39. data/lib/metanorma/vg/version.rb +5 -0
  40. data/metanorma-vsd.gemspec +45 -0
  41. data/metanorma.yml +20 -0
  42. metadata +256 -0
@@ -0,0 +1,21 @@
1
+ require "isodoc"
2
+ require "isodoc/generic/html_convert"
3
+ require "isodoc/vg/metadata"
4
+
5
+ module IsoDoc
6
+ module VG
7
+ # A {Converter} implementation that generates HTML output, and a document
8
+ # schema encapsulation of the document for validation
9
+ #
10
+ class HtmlConvert < IsoDoc::Generic::HtmlConvert
11
+ def configuration
12
+ Metanorma::VG.configuration
13
+ end
14
+
15
+ def metadata_init(lang, script, labels)
16
+ @meta = Metadata.new(lang, script, labels)
17
+ end
18
+ end
19
+ end
20
+ end
21
+
@@ -0,0 +1,11 @@
1
+ require "isodoc"
2
+
3
+ module IsoDoc
4
+ module VG
5
+ class Metadata < IsoDoc::Generic::Metadata
6
+ def configuration
7
+ Metanorma::VG.configuration
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ require "isodoc"
2
+ require "metanorma-generic"
3
+
4
+ module IsoDoc
5
+ module VG
6
+ class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,19 @@
1
+ require "isodoc"
2
+ require "isodoc/generic/word_convert"
3
+ require "isodoc/vg/metadata"
4
+
5
+ module IsoDoc
6
+ module VG
7
+ # A {Converter} implementation that generates Word output, and a document
8
+ # schema encapsulation of the document for validation
9
+ class WordConvert < IsoDoc::Generic::WordConvert
10
+ def configuration
11
+ Metanorma::VG.configuration
12
+ end
13
+
14
+ def metadata_init(lang, script, labels)
15
+ @meta = Metadata.new(lang, script, labels)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,11 @@
1
+ require 'metanorma'
2
+ require 'metanorma/vg'
3
+ require "isodoc/vg"
4
+
5
+ require 'asciidoctor' unless defined? Asciidoctor::Converter
6
+ require 'asciidoctor/vg'
7
+
8
+ if defined? Metanorma
9
+ require_relative "metanorma/vg"
10
+ Metanorma::Registry.instance.register(Metanorma::VG::Processor)
11
+ end
@@ -0,0 +1,32 @@
1
+ require "metanorma"
2
+ require "metanorma-generic"
3
+ require "metanorma/vg/processor"
4
+
5
+ module Metanorma
6
+ module VG
7
+ class Configuration < Metanorma::Generic::Configuration
8
+ def initialize(*args)
9
+ super
10
+ html_configs ||= File.join(File.expand_path('config', __dir__), 'vsd_html.yml')
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::VG::Processor)
@@ -0,0 +1,37 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module VG
5
+ class Processor < Metanorma::Generic::Processor
6
+ def configuration
7
+ Metanorma::VG.configuration
8
+ end
9
+
10
+ def output_formats
11
+ super.merge(
12
+ html: "html",
13
+ doc: "doc"
14
+ ).tap { |hs| hs.delete(:pdf) }
15
+ end
16
+
17
+ def version
18
+ "Metanorma::VG #{Metanorma::VG::VERSION}"
19
+ end
20
+
21
+ def input_to_isodoc(file, filename)
22
+ Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
23
+ end
24
+
25
+ def output(isodoc_node, outname, format, options={})
26
+ case format
27
+ when :html
28
+ IsoDoc::VG::HtmlConvert.new(options).convert(outname, isodoc_node)
29
+ when :doc
30
+ IsoDoc::VG::WordConvert.new(options).convert(outname, isodoc_node)
31
+ else
32
+ super
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,5 @@
1
+ module Metanorma
2
+ module VG
3
+ VERSION = "1.1.0"
4
+ end
5
+ end
@@ -0,0 +1,45 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "metanorma/vg/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "metanorma-vg"
7
+ spec.version = Metanorma::VG::VERSION
8
+ spec.authors = ["Ribose Inc."]
9
+ spec.email = ["open.source@ribose.com"]
10
+
11
+ spec.summary = "metanorma-vg lets you write Vita Green standards in Metanorma."
12
+ spec.description = <<~DESCRIPTION
13
+ metanorma-vg lets you write Vita Green standards in Metanorma syntax.
14
+
15
+ This gem is in active development.
16
+
17
+ Formerly known as metanorma-vsd.
18
+ DESCRIPTION
19
+
20
+ spec.homepage = "https://github.com/metanorma/metanorma-vg"
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 "htmlentities", "~> 4.3.4"
32
+ #spec.add_dependency "nokogiri"
33
+ spec.add_dependency "metanorma-generic", "~> 1.5.0"
34
+ spec.add_dependency "isodoc", "~> 1.1.0"
35
+
36
+ spec.add_development_dependency "byebug", "~> 9.1"
37
+ spec.add_development_dependency "equivalent-xml", "~> 0.6"
38
+ spec.add_development_dependency "guard", "~> 2.14"
39
+ spec.add_development_dependency "guard-rspec", "~> 4.7"
40
+ spec.add_development_dependency "rake", "~> 12.0"
41
+ spec.add_development_dependency "rspec", "~> 3.6"
42
+ spec.add_development_dependency "rubocop", "~> 0.50"
43
+ spec.add_development_dependency "simplecov", "~> 0.15"
44
+ spec.add_development_dependency "timecop", "~> 0.9"
45
+ end
@@ -0,0 +1,20 @@
1
+ metanorma_name: vg
2
+ organization_name_short: Vita Green
3
+ organization_name_long: Vita Green
4
+ document_namespace: https://www.metanorma.org/ns/vsd
5
+ xml_root_tag: 'vsd-standard'
6
+ logo_path: lib/isodoc/vg/html/logo.png
7
+ validate_rng_file: lib/asciidoctor/vg/vsd.rng
8
+ htmlcoverpage: lib/isodoc/vg/html/html_vsd_titlepage.html
9
+ htmlintropage: lib/isodoc/vg/html/html_vsd_intro.html
10
+ htmlstylesheet: lib/isodoc/vg/html/htmlstyle.scss
11
+ scripts: lib/isodoc/vg/html/scripts.html
12
+ scripts_pdf: lib/isodoc/vg/html/scripts.pdf.html
13
+ standardstylesheet: lib/isodoc/vg/html/vsd.scss
14
+ header: lib/isodoc/vg/html/header.html
15
+ wordcoverpage: lib/isodoc/vg/html/word_vsd_titlepage.html
16
+ wordintropage: lib/isodoc/vg/html/word_vsd_intro.html
17
+ wordstylesheet: lib/isodoc/vg/html/wordstyle.scss
18
+ published_stages:
19
+ - published
20
+
metadata ADDED
@@ -0,0 +1,256 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: metanorma-vg
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: htmlentities
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 4.3.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.3.4
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.5.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.5.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: isodoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.1.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '9.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '9.1'
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.50'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.50'
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-vg lets you write Vita Green standards in Metanorma syntax.
183
+
184
+ This gem is in active development.
185
+
186
+ Formerly known as metanorma-vsd.
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
+ - CODE_OF_CONDUCT.md
198
+ - Gemfile
199
+ - LICENSE
200
+ - README.adoc
201
+ - Rakefile
202
+ - bin/console
203
+ - bin/rspec
204
+ - bin/setup
205
+ - lib/asciidoctor/vg.rb
206
+ - lib/asciidoctor/vg/basicdoc.rng
207
+ - lib/asciidoctor/vg/biblio.rng
208
+ - lib/asciidoctor/vg/converter.rb
209
+ - lib/asciidoctor/vg/isodoc.rng
210
+ - lib/asciidoctor/vg/reqt.rng
211
+ - lib/asciidoctor/vg/vsd.rng
212
+ - lib/isodoc/vg.rb
213
+ - lib/isodoc/vg/html/header.html
214
+ - lib/isodoc/vg/html/html_vsd_intro.html
215
+ - lib/isodoc/vg/html/html_vsd_titlepage.html
216
+ - lib/isodoc/vg/html/htmlstyle.scss
217
+ - lib/isodoc/vg/html/logo.png
218
+ - lib/isodoc/vg/html/scripts.html
219
+ - lib/isodoc/vg/html/vsd.scss
220
+ - lib/isodoc/vg/html/word_vsd_intro.html
221
+ - lib/isodoc/vg/html/word_vsd_titlepage.html
222
+ - lib/isodoc/vg/html/wordstyle.scss
223
+ - lib/isodoc/vg/html_convert.rb
224
+ - lib/isodoc/vg/metadata.rb
225
+ - lib/isodoc/vg/presentation_xml_convert.rb
226
+ - lib/isodoc/vg/word_convert.rb
227
+ - lib/metanorma-vg.rb
228
+ - lib/metanorma/vg.rb
229
+ - lib/metanorma/vg/processor.rb
230
+ - lib/metanorma/vg/version.rb
231
+ - metanorma-vsd.gemspec
232
+ - metanorma.yml
233
+ homepage: https://github.com/metanorma/metanorma-vg
234
+ licenses:
235
+ - BSD-2-Clause
236
+ metadata: {}
237
+ post_install_message:
238
+ rdoc_options: []
239
+ require_paths:
240
+ - lib
241
+ required_ruby_version: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ version: 2.4.0
246
+ required_rubygems_version: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ requirements: []
252
+ rubygems_version: 3.0.3
253
+ signing_key:
254
+ specification_version: 4
255
+ summary: metanorma-vg lets you write Vita Green standards in Metanorma.
256
+ test_files: []