metanorma-rsd 1.4.3 → 1.4.4

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.
@@ -3,7 +3,7 @@ require "isodoc"
3
3
  module IsoDoc
4
4
  module Rsd
5
5
 
6
- class Metadata < IsoDoc::Acme::Metadata
6
+ class Metadata < IsoDoc::Generic::Metadata
7
7
  def configuration
8
8
  Metanorma::Rsd.configuration
9
9
  end
@@ -13,31 +13,27 @@ module IsoDoc
13
13
  set(:security, security.text)
14
14
  end
15
15
 
16
+ def recipient(isoxml, _out)
17
+ recipient = isoxml.at(ns("//bibdata/ext/recipient")) || return
18
+ set(:recipient, recipient.text)
19
+ end
20
+
16
21
  def version(isoxml, _out)
17
22
  super
18
23
  revdate = get[:revdate]
19
- set(:revdate_monthyear, monthyr(revdate))
24
+ set(:revdate_MMMddyyyy, MMMddyyyy(revdate))
20
25
  end
21
26
 
22
- MONTHS = {
23
- "01": "January",
24
- "02": "February",
25
- "03": "March",
26
- "04": "April",
27
- "05": "May",
28
- "06": "June",
29
- "07": "July",
30
- "08": "August",
31
- "09": "September",
32
- "10": "October",
33
- "11": "November",
34
- "12": "December",
35
- }.freeze
36
-
37
- def monthyr(isodate)
38
- m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)/.match isodate
39
- return isodate unless m && m[:yr] && m[:mo]
40
- return "#{MONTHS[m[:mo].to_sym]} #{m[:yr]}"
27
+ def MMMddyyyy(isodate)
28
+ return nil if isodate.nil?
29
+ arr = isodate.split("-")
30
+ date = if arr.size == 1 and (/^\d+$/.match isodate)
31
+ Date.new(*arr.map(&:to_i)).strftime("%Y")
32
+ elsif arr.size == 2
33
+ Date.new(*arr.map(&:to_i)).strftime("%B %Y")
34
+ else
35
+ Date.parse(isodate).strftime("%B %d, %Y")
36
+ end
41
37
  end
42
38
  end
43
39
  end
@@ -1,24 +1,32 @@
1
1
  require "isodoc"
2
- require "isodoc/acme/pdf_convert"
2
+ require "isodoc/generic/pdf_convert"
3
3
  require "isodoc/rsd/metadata"
4
4
 
5
5
  module IsoDoc
6
6
  module Rsd
7
7
  # A {Converter} implementation that generates PDF HTML output, and a
8
8
  # document schema encapsulation of the document for validation
9
- class PdfConvert < IsoDoc::Acme::PdfConvert
9
+ class PdfConvert < IsoDoc::Generic::PdfConvert
10
10
  def configuration
11
11
  Metanorma::Rsd.configuration
12
12
  end
13
13
 
14
- def metadata_init(lang, script, labels)
15
- @meta = Metadata.new(lang, script, labels)
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
16
26
  end
27
+ end
17
28
 
18
- def info(isoxml, out)
19
- @meta.security isoxml, out
20
- super
21
- end
29
+ include BaseConvert
22
30
  end
23
31
  end
24
32
  end
@@ -1,24 +1,31 @@
1
1
  require "isodoc"
2
- require "isodoc/acme/word_convert"
2
+ require "isodoc/generic/word_convert"
3
3
  require "isodoc/rsd/metadata"
4
4
 
5
5
  module IsoDoc
6
6
  module Rsd
7
7
  # A {Converter} implementation that generates Word output, and a document
8
8
  # schema encapsulation of the document for validation
9
- class WordConvert < IsoDoc::Acme::WordConvert
9
+ class WordConvert < IsoDoc::Generic::WordConvert
10
10
  def configuration
11
11
  Metanorma::Rsd.configuration
12
12
  end
13
13
 
14
- def metadata_init(lang, script, labels)
15
- @meta = Metadata.new(lang, script, labels)
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
24
+ end
25
+ section_break(body)
16
26
  end
17
27
 
18
- def info(isoxml, out)
19
- @meta.security isoxml, out
20
- super
21
- end
28
+ include BaseConvert
22
29
  end
23
30
  end
24
31
  end
@@ -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,11 +1,11 @@
1
1
  require "metanorma"
2
- require "metanorma-acme"
2
+ require "metanorma-generic"
3
3
  require "metanorma/rsd/processor"
4
4
 
5
5
  module Metanorma
6
6
  module Rsd
7
7
 
8
- class Configuration < Metanorma::Acme::Configuration
8
+ class Configuration < Metanorma::Generic::Configuration
9
9
  def initialize(*args)
10
10
  super
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Rsd
3
- VERSION = "1.4.3"
3
+ VERSION = "1.4.4"
4
4
  end
5
5
  end
@@ -32,7 +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-acme', '~> 1.4.0'
35
+ spec.add_dependency 'metanorma-generic', '~> 1.4.0'
36
36
 
37
37
  spec.add_development_dependency "byebug", "~> 9.1"
38
38
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -2,7 +2,7 @@ organization_name_short: Ribose
2
2
  organization_name_long: Ribose
3
3
  document_namespace: https://www.metanorma.org/ns/rsd
4
4
  xml_root_tag: 'rsd-standard'
5
- logo_path: lib/isodoc/rsd/html/logo.svg
5
+ logo_path: lib/isodoc/rsd/html/logo.png
6
6
  validate_rng_file: lib/asciidoctor/rsd/rsd.rng
7
7
  htmlcoverpage: lib/isodoc/rsd/html/html_rsd_titlepage.html
8
8
  htmlintropage: lib/isodoc/rsd/html/html_rsd_intro.html
@@ -14,6 +14,9 @@ header: lib/isodoc/rsd/html/header.html
14
14
  wordcoverpage: lib/isodoc/rsd/html/word_rsd_titlepage.html
15
15
  wordintropage: lib/isodoc/rsd/html/word_rsd_intro.html
16
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'
17
20
  docid_template: "{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}"
18
21
  published_stages:
19
22
  - published
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.4.3
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-03-20 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
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.0.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: metanorma-acme
56
+ name: metanorma-generic
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
@@ -227,10 +227,12 @@ files:
227
227
  - lib/asciidoctor/rsd/reqt.rng
228
228
  - lib/asciidoctor/rsd/rsd.rng
229
229
  - lib/asciidoctor/rsd/validate.rb
230
+ - lib/isodoc/rsd/base_convert.rb
230
231
  - lib/isodoc/rsd/html/header.html
231
232
  - lib/isodoc/rsd/html/html_rsd_intro.html
232
233
  - lib/isodoc/rsd/html/html_rsd_titlepage.html
233
234
  - lib/isodoc/rsd/html/htmlstyle.scss
235
+ - lib/isodoc/rsd/html/logo.png
234
236
  - lib/isodoc/rsd/html/logo.svg
235
237
  - lib/isodoc/rsd/html/rsd.scss
236
238
  - lib/isodoc/rsd/html/scripts.html