metanorma-rsd 1.4.3 → 1.4.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/macos.yml +2 -3
- data/.github/workflows/ubuntu.yml +3 -4
- data/.github/workflows/windows.yml +3 -4
- data/README.adoc +5 -5
- data/lib/asciidoctor/rsd/biblio.rng +2 -12
- data/lib/asciidoctor/rsd/converter.rb +47 -2
- data/lib/asciidoctor/rsd/isodoc.rng +1 -3
- data/lib/isodoc/rsd/base_convert.rb +62 -0
- data/lib/isodoc/rsd/html/header.html +15 -15
- data/lib/isodoc/rsd/html/html_rsd_titlepage.html +1 -1
- data/lib/isodoc/rsd/html/htmlstyle.scss +6 -7
- data/lib/isodoc/rsd/html/logo.png +0 -0
- data/lib/isodoc/rsd/html/rsd.scss +57 -60
- data/lib/isodoc/rsd/html/word_rsd_intro.html +5 -5
- data/lib/isodoc/rsd/html/word_rsd_titlepage.html +69 -14
- data/lib/isodoc/rsd/html/wordstyle.scss +43 -30
- data/lib/isodoc/rsd/html_convert.rb +16 -8
- data/lib/isodoc/rsd/metadata.rb +17 -21
- data/lib/isodoc/rsd/pdf_convert.rb +16 -8
- data/lib/isodoc/rsd/word_convert.rb +15 -8
- data/lib/metanorma-rsd.rb +1 -0
- data/lib/metanorma/rsd.rb +2 -2
- data/lib/metanorma/rsd/version.rb +1 -1
- data/metanorma-rsd.gemspec +1 -1
- data/metanorma.yml +4 -1
- metadata +5 -3
data/lib/isodoc/rsd/metadata.rb
CHANGED
@@ -3,7 +3,7 @@ require "isodoc"
|
|
3
3
|
module IsoDoc
|
4
4
|
module Rsd
|
5
5
|
|
6
|
-
class Metadata < IsoDoc::
|
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(:
|
24
|
+
set(:revdate_MMMddyyyy, MMMddyyyy(revdate))
|
20
25
|
end
|
21
26
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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/
|
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::
|
9
|
+
class PdfConvert < IsoDoc::Generic::PdfConvert
|
10
10
|
def configuration
|
11
11
|
Metanorma::Rsd.configuration
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
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
|
-
|
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/
|
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::
|
9
|
+
class WordConvert < IsoDoc::Generic::WordConvert
|
10
10
|
def configuration
|
11
11
|
Metanorma::Rsd.configuration
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
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 << " " } # placeholder
|
24
|
+
end
|
25
|
+
section_break(body)
|
16
26
|
end
|
17
27
|
|
18
|
-
|
19
|
-
@meta.security isoxml, out
|
20
|
-
super
|
21
|
-
end
|
28
|
+
include BaseConvert
|
22
29
|
end
|
23
30
|
end
|
24
31
|
end
|
data/lib/metanorma-rsd.rb
CHANGED
@@ -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"
|
data/lib/metanorma/rsd.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require "metanorma"
|
2
|
-
require "metanorma-
|
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::
|
8
|
+
class Configuration < Metanorma::Generic::Configuration
|
9
9
|
def initialize(*args)
|
10
10
|
super
|
11
11
|
end
|
data/metanorma-rsd.gemspec
CHANGED
@@ -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-
|
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"
|
data/metanorma.yml
CHANGED
@@ -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.
|
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.
|
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
|
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-
|
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
|