metanorma-rsd 1.3.11 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,52 +1,30 @@
1
- require_relative "base_convert"
2
1
  require "isodoc"
2
+ require "isodoc/generic/pdf_convert"
3
+ require "isodoc/rsd/metadata"
3
4
 
4
5
  module IsoDoc
5
6
  module Rsd
6
7
  # A {Converter} implementation that generates PDF HTML output, and a
7
8
  # document schema encapsulation of the document for validation
8
- class PdfConvert < IsoDoc::PdfConvert
9
- def initialize(options)
10
- @libdir = File.dirname(__FILE__)
11
- super
9
+ class PdfConvert < IsoDoc::Generic::PdfConvert
10
+ def configuration
11
+ Metanorma::Rsd.configuration
12
12
  end
13
13
 
14
- def default_fonts(options)
15
- {
16
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
17
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
18
- monospacefont: '"Space Mono",monospace'
19
- }
20
- end
21
-
22
- def default_file_locations(options)
23
- {
24
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
25
- htmlcoverpage: html_doc_path("html_rsd_titlepage.html"),
26
- htmlintropage: html_doc_path("html_rsd_intro.html"),
27
- scripts_pdf: html_doc_path("scripts.pdf.html"),
28
- }
29
- end
30
-
31
- def googlefonts()
32
- <<~HEAD.freeze
33
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
34
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
35
- HEAD
36
- end
37
-
38
- def make_body(xml, docxml)
39
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
40
- xml.body **body_attr do |body|
41
- make_body1(body, docxml)
42
- make_body2(body, docxml)
43
- make_body3(body, docxml)
44
- end
45
- end
46
-
47
- def html_toc(docxml)
48
- docxml
14
+ def make_body3(body, docxml)
15
+ body.div **{ class: "main-section" } do |div3|
16
+ boilerplate docxml, div3
17
+ abstract docxml, div3
18
+ foreword docxml, div3
19
+ executivesummary docxml, div3
20
+ introduction docxml, div3
21
+ preface docxml, div3
22
+ acknowledgements docxml, div3
23
+ middle docxml, div3
24
+ footnotes div3
25
+ comments div3
49
26
  end
27
+ end
50
28
 
51
29
  include BaseConvert
52
30
  end
@@ -1,45 +1,28 @@
1
- require_relative "base_convert"
2
1
  require "isodoc"
2
+ require "isodoc/generic/word_convert"
3
+ require "isodoc/rsd/metadata"
3
4
 
4
5
  module IsoDoc
5
6
  module Rsd
6
7
  # A {Converter} implementation that generates Word output, and a document
7
8
  # schema encapsulation of the document for validation
8
-
9
- class WordConvert < IsoDoc::WordConvert
10
- def initialize(options)
11
- @libdir = File.dirname(__FILE__)
12
- super
13
- end
14
-
15
- def default_fonts(options)
16
- {
17
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
18
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
19
- monospacefont: '"Courier New",monospace'
20
- }
9
+ class WordConvert < IsoDoc::Generic::WordConvert
10
+ def configuration
11
+ Metanorma::Rsd.configuration
21
12
  end
22
13
 
23
- def default_file_locations(options)
24
- {
25
- wordstylesheet: html_doc_path("wordstyle.scss"),
26
- standardstylesheet: html_doc_path("rsd.scss"),
27
- header: html_doc_path("header.html"),
28
- wordcoverpage: html_doc_path("word_rsd_titlepage.html"),
29
- wordintropage: html_doc_path("word_rsd_intro.html"),
30
- ulstyle: "l3",
31
- olstyle: "l2",
32
- }
33
- end
34
-
35
-
36
- def make_body(xml, docxml)
37
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72" }
38
- xml.body **body_attr do |body|
39
- make_body1(body, docxml)
40
- make_body2(body, docxml)
41
- make_body3(body, docxml)
14
+ def make_body2(body, docxml)
15
+ body.div **{ class: "WordSection2" } do |div2|
16
+ boilerplate docxml, div2
17
+ abstract docxml, div2
18
+ foreword docxml, div2
19
+ executivesummary docxml, div2
20
+ introduction docxml, div2
21
+ preface docxml, div2
22
+ acknowledgements docxml, div2
23
+ div2.p { |p| p << "&nbsp;" } # placeholder
42
24
  end
25
+ section_break(body)
43
26
  end
44
27
 
45
28
  include BaseConvert
@@ -1,5 +1,6 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/rsd/converter"
3
+ require_relative "isodoc/rsd/base_convert"
3
4
  require_relative "isodoc/rsd/html_convert"
4
5
  require_relative "isodoc/rsd/word_convert"
5
6
  require_relative "isodoc/rsd/pdf_convert"
@@ -1,7 +1,32 @@
1
- require_relative "./rsd/processor"
1
+ require "metanorma"
2
+ require "metanorma-generic"
3
+ require "metanorma/rsd/processor"
2
4
 
3
5
  module Metanorma
4
6
  module Rsd
5
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 {}
6
30
  end
7
31
  end
32
+ Metanorma::Registry.instance.register(Metanorma::Rsd::Processor)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Rsd
3
- VERSION = "1.3.11"
3
+ VERSION = "1.4.4"
4
4
  end
5
5
  end
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  #spec.add_dependency "nokogiri"
33
33
  spec.add_dependency "metanorma-standoc", "~> 1.3.0"
34
34
  spec.add_dependency "isodoc", "~> 1.0.0"
35
+ spec.add_dependency 'metanorma-generic', '~> 1.4.0'
35
36
 
36
37
  spec.add_development_dependency "byebug", "~> 9.1"
37
38
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -42,5 +43,4 @@ Gem::Specification.new do |spec|
42
43
  spec.add_development_dependency "rubocop", "= 0.54.0"
43
44
  spec.add_development_dependency "simplecov", "~> 0.15"
44
45
  spec.add_development_dependency "timecop", "~> 0.9"
45
- spec.add_development_dependency "metanorma", "~> 0.3.0"
46
46
  end
@@ -0,0 +1,26 @@
1
+ organization_name_short: Ribose
2
+ organization_name_long: Ribose
3
+ document_namespace: https://www.metanorma.org/ns/rsd
4
+ xml_root_tag: 'rsd-standard'
5
+ logo_path: lib/isodoc/rsd/html/logo.png
6
+ validate_rng_file: lib/asciidoctor/rsd/rsd.rng
7
+ htmlcoverpage: lib/isodoc/rsd/html/html_rsd_titlepage.html
8
+ htmlintropage: lib/isodoc/rsd/html/html_rsd_intro.html
9
+ htmlstylesheet: lib/isodoc/rsd/html/htmlstyle.scss
10
+ scripts: lib/isodoc/rsd/html/scripts.html
11
+ scripts_pdf: lib/isodoc/rsd/html/scripts.pdf.html
12
+ standardstylesheet: lib/isodoc/rsd/html/rsd.scss
13
+ header: lib/isodoc/rsd/html/header.html
14
+ wordcoverpage: lib/isodoc/rsd/html/word_rsd_titlepage.html
15
+ wordintropage: lib/isodoc/rsd/html/word_rsd_intro.html
16
+ wordstylesheet: lib/isodoc/rsd/html/wordstyle.scss
17
+ word_bodyfont: '"Source Sans Pro",sans-serif'
18
+ word_headerfont: '"Source Sans Pro",sans-serif'
19
+ word_monospacefont: '"Courier New",monospace'
20
+ docid_template: "{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}"
21
+ published_stages:
22
+ - published
23
+ stage_abbreviations:
24
+ working-draft: wd
25
+ committee-draft: cd
26
+ draft-standard: d
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-rsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.11
4
+ version: 1.4.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: 2020-01-30 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: metanorma-generic
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.4.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.4.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: byebug
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -178,20 +192,6 @@ dependencies:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
194
  version: '0.9'
181
- - !ruby/object:Gem::Dependency
182
- name: metanorma
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: 0.3.0
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: 0.3.0
195
195
  description: |
196
196
  metanorma-rsd lets you write RSD in AsciiDoc syntax.
197
197
 
@@ -232,6 +232,7 @@ files:
232
232
  - lib/isodoc/rsd/html/html_rsd_intro.html
233
233
  - lib/isodoc/rsd/html/html_rsd_titlepage.html
234
234
  - lib/isodoc/rsd/html/htmlstyle.scss
235
+ - lib/isodoc/rsd/html/logo.png
235
236
  - lib/isodoc/rsd/html/logo.svg
236
237
  - lib/isodoc/rsd/html/rsd.scss
237
238
  - lib/isodoc/rsd/html/scripts.html
@@ -248,6 +249,7 @@ files:
248
249
  - lib/metanorma/rsd/processor.rb
249
250
  - lib/metanorma/rsd/version.rb
250
251
  - metanorma-rsd.gemspec
252
+ - metanorma.yml
251
253
  homepage: https://github.com/metanorma/metanorma-rsd
252
254
  licenses:
253
255
  - BSD-2-Clause