metanorma-acme 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +16 -11
- data/appveyor.yml +7 -2
- data/lib/asciidoctor/acme/acme.rng +6 -83
- data/lib/asciidoctor/acme/biblio.rng +44 -15
- data/lib/asciidoctor/acme/converter.rb +2 -5
- data/lib/asciidoctor/acme/isodoc.rng +128 -71
- data/lib/asciidoctor/acme/isostandard.rng +29 -304
- data/lib/asciidoctor/acme/reqt.rng +5 -0
- data/lib/isodoc/acme/base_convert.rb +74 -0
- data/lib/isodoc/acme/html/html_acme_titlepage.html +3 -3
- data/lib/isodoc/acme/html/word_acme_titlepage.html +1 -1
- data/lib/isodoc/acme/html_convert.rb +2 -67
- data/lib/isodoc/acme/metadata.rb +3 -9
- data/lib/isodoc/acme/pdf_convert.rb +2 -66
- data/lib/isodoc/acme/word_convert.rb +2 -77
- data/lib/metanorma/acme/version.rb +1 -1
- data/metanorma-acme.gemspec +3 -3
- metadata +9 -22
@@ -1,5 +1,5 @@
|
|
1
|
-
<div class="document-stage-band" id='{{
|
2
|
-
<p class="document-stage">{{
|
1
|
+
<div class="document-stage-band" id='{{ stage | downcase | replace: " ", "-" }}-band'>
|
2
|
+
<p class="document-stage">{{ stage }}</p>
|
3
3
|
</div>
|
4
4
|
|
5
5
|
<div class="document-type-band" id='{{ doctype | downcase | replace: " ", "-" }}-band'>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</div>
|
47
47
|
|
48
48
|
<div class="coverpage-stage-block" >
|
49
|
-
<p><span class="coverpage-maturity" id="{{
|
49
|
+
<p><span class="coverpage-maturity" id="{{ stage | replace: ' ', '-' | downcase }}">{{ stage }}</span></p>
|
50
50
|
{% if security %}
|
51
51
|
<p><span class="coverpage-maturity">Classification: {{ security }}</span></p>
|
52
52
|
{% endif %}
|
@@ -18,7 +18,7 @@ margin-left:4.25pt;margin-right:4.25pt'>
|
|
18
18
|
|
19
19
|
<p class="MsoNormal" align="center" style='text-align:center;border:none;
|
20
20
|
mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span
|
21
|
-
lang="EN-GB" style='font-size:16.0pt'>{% if unpublished %}{{
|
21
|
+
lang="EN-GB" style='font-size:16.0pt'>{% if unpublished %}{{ stage }} {% endif %}{{ doctype }}</span></p>
|
22
22
|
|
23
23
|
{% if security %}
|
24
24
|
<p class="MsoNormal" align="center" style='text-align:center;border:none;
|
@@ -1,6 +1,5 @@
|
|
1
|
+
require_relative "base_convert"
|
1
2
|
require "isodoc"
|
2
|
-
require_relative "metadata"
|
3
|
-
require "fileutils"
|
4
3
|
|
5
4
|
module IsoDoc
|
6
5
|
module Acme
|
@@ -14,12 +13,6 @@ module IsoDoc
|
|
14
13
|
super
|
15
14
|
end
|
16
15
|
|
17
|
-
def convert1(docxml, filename, dir)
|
18
|
-
FileUtils.cp html_doc_path('logo.jpg'), "#{@localdir}/logo.jpg"
|
19
|
-
@files_to_delete << "#{@localdir}/logo.jpg"
|
20
|
-
super
|
21
|
-
end
|
22
|
-
|
23
16
|
def default_fonts(options)
|
24
17
|
{
|
25
18
|
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
|
@@ -37,10 +30,6 @@ module IsoDoc
|
|
37
30
|
}
|
38
31
|
end
|
39
32
|
|
40
|
-
def metadata_init(lang, script, labels)
|
41
|
-
@meta = Metadata.new(lang, script, labels)
|
42
|
-
end
|
43
|
-
|
44
33
|
def googlefonts
|
45
34
|
<<~HEAD.freeze
|
46
35
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
|
@@ -48,65 +37,11 @@ module IsoDoc
|
|
48
37
|
HEAD
|
49
38
|
end
|
50
39
|
|
51
|
-
def make_body(xml, docxml)
|
52
|
-
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
|
53
|
-
xml.body **body_attr do |body|
|
54
|
-
make_body1(body, docxml)
|
55
|
-
make_body2(body, docxml)
|
56
|
-
make_body3(body, docxml)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
40
|
def html_toc(docxml)
|
61
41
|
docxml
|
62
42
|
end
|
63
43
|
|
64
|
-
|
65
|
-
div.h1 **{ class: "Annex" } do |t|
|
66
|
-
t << "#{get_anchors[annex['id']][:label]}"
|
67
|
-
t.br
|
68
|
-
t.b do |b|
|
69
|
-
name&.children&.each { |c2| parse(c2, b) }
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def term_defs_boilerplate(div, source, term, preface)
|
75
|
-
if source.empty? && term.nil?
|
76
|
-
div << @no_terms_boilerplate
|
77
|
-
else
|
78
|
-
div << term_defs_boilerplate_cont(source, term)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def i18n_init(lang, script)
|
83
|
-
super
|
84
|
-
@annex_lbl = "Appendix"
|
85
|
-
end
|
86
|
-
|
87
|
-
def fileloc(loc)
|
88
|
-
File.join(File.dirname(__FILE__), loc)
|
89
|
-
end
|
90
|
-
|
91
|
-
def cleanup(docxml)
|
92
|
-
super
|
93
|
-
term_cleanup(docxml)
|
94
|
-
end
|
95
|
-
|
96
|
-
def term_cleanup(docxml)
|
97
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
98
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
99
|
-
h2.add_child(" ")
|
100
|
-
h2.add_child(d.remove)
|
101
|
-
end
|
102
|
-
docxml
|
103
|
-
end
|
104
|
-
|
105
|
-
def info(isoxml, out)
|
106
|
-
@meta.security isoxml, out
|
107
|
-
super
|
108
|
-
end
|
109
|
-
|
44
|
+
include BaseConvert
|
110
45
|
end
|
111
46
|
end
|
112
47
|
end
|
data/lib/isodoc/acme/metadata.rb
CHANGED
@@ -6,7 +6,6 @@ module IsoDoc
|
|
6
6
|
class Metadata < IsoDoc::Metadata
|
7
7
|
def initialize(lang, script, labels)
|
8
8
|
super
|
9
|
-
set(:status, "XXX")
|
10
9
|
end
|
11
10
|
|
12
11
|
def title(isoxml, _out)
|
@@ -19,26 +18,21 @@ module IsoDoc
|
|
19
18
|
end
|
20
19
|
|
21
20
|
def author(isoxml, _out)
|
22
|
-
tc = isoxml.at(ns("//bibdata/editorialgroup/committee"))
|
21
|
+
tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
|
23
22
|
set(:tc, tc.text) if tc
|
24
23
|
end
|
25
24
|
|
26
25
|
def docid(isoxml, _out)
|
27
26
|
docnumber = isoxml.at(ns("//bibdata/docidentifier"))
|
28
|
-
docstatus = isoxml.at(ns("//bibdata/status"))
|
27
|
+
docstatus = isoxml.at(ns("//bibdata/status/stage"))
|
29
28
|
dn = docnumber&.text
|
30
29
|
if docstatus
|
31
|
-
set(:status, status_print(docstatus.text))
|
32
30
|
abbr = status_abbr(docstatus.text)
|
33
31
|
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
34
32
|
end
|
35
33
|
set(:docnumber, dn)
|
36
34
|
end
|
37
35
|
|
38
|
-
def status_print(status)
|
39
|
-
status.split(/-/).map{ |w| w.capitalize }.join(" ")
|
40
|
-
end
|
41
|
-
|
42
36
|
def status_abbr(status)
|
43
37
|
case status
|
44
38
|
when "working-draft" then "wd"
|
@@ -81,7 +75,7 @@ module IsoDoc
|
|
81
75
|
end
|
82
76
|
|
83
77
|
def security(isoxml, _out)
|
84
|
-
security = isoxml.at(ns("//bibdata/security")) || return
|
78
|
+
security = isoxml.at(ns("//bibdata/ext/security")) || return
|
85
79
|
set(:security, security.text)
|
86
80
|
end
|
87
81
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
+
require_relative "base_convert"
|
1
2
|
require "isodoc"
|
2
|
-
require_relative "metadata"
|
3
|
-
require "fileutils"
|
4
3
|
|
5
4
|
module IsoDoc
|
6
5
|
module Acme
|
@@ -12,12 +11,6 @@ module IsoDoc
|
|
12
11
|
super
|
13
12
|
end
|
14
13
|
|
15
|
-
def convert1(docxml, filename, dir)
|
16
|
-
FileUtils.cp html_doc_path('logo.jpg'), File.join(@localdir, "logo.jpg")
|
17
|
-
@files_to_delete << File.join(@localdir, "logo.jpg")
|
18
|
-
super
|
19
|
-
end
|
20
|
-
|
21
14
|
def default_fonts(options)
|
22
15
|
{
|
23
16
|
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
|
@@ -35,10 +28,6 @@ module IsoDoc
|
|
35
28
|
}
|
36
29
|
end
|
37
30
|
|
38
|
-
def metadata_init(lang, script, labels)
|
39
|
-
@meta = Metadata.new(lang, script, labels)
|
40
|
-
end
|
41
|
-
|
42
31
|
def googlefonts
|
43
32
|
<<~HEAD.freeze
|
44
33
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
|
@@ -46,64 +35,11 @@ module IsoDoc
|
|
46
35
|
HEAD
|
47
36
|
end
|
48
37
|
|
49
|
-
def make_body(xml, docxml)
|
50
|
-
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
|
51
|
-
xml.body **body_attr do |body|
|
52
|
-
make_body1(body, docxml)
|
53
|
-
make_body2(body, docxml)
|
54
|
-
make_body3(body, docxml)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
38
|
def html_toc(docxml)
|
59
39
|
docxml
|
60
40
|
end
|
61
41
|
|
62
|
-
|
63
|
-
div.h1 **{ class: "Annex" } do |t|
|
64
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
65
|
-
t.br
|
66
|
-
t.b do |b|
|
67
|
-
name&.children&.each { |c2| parse(c2, b) }
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def term_defs_boilerplate(div, source, term, preface)
|
73
|
-
if source.empty? && term.nil?
|
74
|
-
div << @no_terms_boilerplate
|
75
|
-
else
|
76
|
-
div << term_defs_boilerplate_cont(source, term)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def i18n_init(lang, script)
|
81
|
-
super
|
82
|
-
@annex_lbl = "Appendix"
|
83
|
-
end
|
84
|
-
|
85
|
-
def fileloc(loc)
|
86
|
-
File.join(File.dirname(__FILE__), loc)
|
87
|
-
end
|
88
|
-
|
89
|
-
def cleanup(docxml)
|
90
|
-
super
|
91
|
-
term_cleanup(docxml)
|
92
|
-
end
|
93
|
-
|
94
|
-
def term_cleanup(docxml)
|
95
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
96
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
97
|
-
h2.add_child(" ")
|
98
|
-
h2.add_child(d.remove)
|
99
|
-
end
|
100
|
-
docxml
|
101
|
-
end
|
102
|
-
|
103
|
-
def info(isoxml, out)
|
104
|
-
@meta.security isoxml, out
|
105
|
-
super
|
106
|
-
end
|
42
|
+
include BaseConvert
|
107
43
|
end
|
108
44
|
end
|
109
45
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
+
require_relative "base_convert"
|
1
2
|
require "isodoc"
|
2
|
-
require_relative "metadata"
|
3
|
-
require "fileutils"
|
4
3
|
|
5
4
|
module IsoDoc
|
6
5
|
module Acme
|
@@ -13,11 +12,6 @@ module IsoDoc
|
|
13
12
|
super
|
14
13
|
end
|
15
14
|
|
16
|
-
def convert1(docxml, filename, dir)
|
17
|
-
FileUtils.cp html_doc_path('logo.jpg'), File.join(@localdir, "logo.jpg")
|
18
|
-
super
|
19
|
-
end
|
20
|
-
|
21
15
|
def default_fonts(options)
|
22
16
|
{
|
23
17
|
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
|
@@ -38,76 +32,7 @@ module IsoDoc
|
|
38
32
|
}
|
39
33
|
end
|
40
34
|
|
41
|
-
|
42
|
-
def metadata_init(lang, script, labels)
|
43
|
-
@meta = Metadata.new(lang, script, labels)
|
44
|
-
end
|
45
|
-
|
46
|
-
def make_body(xml, docxml)
|
47
|
-
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72" }
|
48
|
-
xml.body **body_attr do |body|
|
49
|
-
make_body1(body, docxml)
|
50
|
-
make_body2(body, docxml)
|
51
|
-
make_body3(body, docxml)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
=begin
|
56
|
-
def make_body2(body, docxml)
|
57
|
-
body.div **{ class: "WordSection2" } do |div2|
|
58
|
-
info docxml, div2
|
59
|
-
div2.p { |p| p << " " } # placeholder
|
60
|
-
end
|
61
|
-
section_break(body)
|
62
|
-
end
|
63
|
-
=end
|
64
|
-
|
65
|
-
def info(isoxml, out)
|
66
|
-
@meta.security isoxml, out
|
67
|
-
super
|
68
|
-
end
|
69
|
-
|
70
|
-
def annex_name(annex, name, div)
|
71
|
-
div.h1 **{ class: "Annex" } do |t|
|
72
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
73
|
-
t.br
|
74
|
-
t.b do |b|
|
75
|
-
name&.children&.each { |c2| parse(c2, b) }
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def term_defs_boilerplate(div, source, term, preface)
|
81
|
-
if source.empty? && term.nil?
|
82
|
-
div << @no_terms_boilerplate
|
83
|
-
else
|
84
|
-
div << term_defs_boilerplate_cont(source, term)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def i18n_init(lang, script)
|
89
|
-
super
|
90
|
-
@annex_lbl = "Appendix"
|
91
|
-
end
|
92
|
-
|
93
|
-
def fileloc(loc)
|
94
|
-
File.join(File.dirname(__FILE__), loc)
|
95
|
-
end
|
96
|
-
|
97
|
-
def cleanup(docxml)
|
98
|
-
super
|
99
|
-
term_cleanup(docxml)
|
100
|
-
end
|
101
|
-
|
102
|
-
def term_cleanup(docxml)
|
103
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
104
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
105
|
-
h2.add_child(" ")
|
106
|
-
h2.add_child(d.remove)
|
107
|
-
end
|
108
|
-
docxml
|
109
|
-
end
|
110
|
-
|
35
|
+
include BaseConvert
|
111
36
|
end
|
112
37
|
end
|
113
38
|
end
|
data/metanorma-acme.gemspec
CHANGED
@@ -24,12 +24,13 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.bindir = "exe"
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ["lib"]
|
27
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
27
28
|
|
28
29
|
spec.add_dependency "asciidoctor", "~> 1.5.7"
|
29
30
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
30
31
|
spec.add_dependency "ruby-jing"
|
31
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
32
|
-
spec.add_dependency "isodoc", "~> 0.
|
32
|
+
spec.add_dependency "metanorma-standoc", "~> 1.2.0"
|
33
|
+
spec.add_dependency "isodoc", "~> 0.10.0"
|
33
34
|
|
34
35
|
spec.add_development_dependency "bundler", "~> 2.0.1"
|
35
36
|
spec.add_development_dependency "byebug", "~> 9.1"
|
@@ -42,5 +43,4 @@ Gem::Specification.new do |spec|
|
|
42
43
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
43
44
|
spec.add_development_dependency "timecop", "~> 0.9"
|
44
45
|
spec.add_development_dependency "metanorma", "~> 0.3.0"
|
45
|
-
spec.add_development_dependency "metanorma-cli", "~> 1.1.2"
|
46
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-acme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.2.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.2.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: isodoc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.10.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.10.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,20 +234,6 @@ dependencies:
|
|
234
234
|
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: 0.3.0
|
237
|
-
- !ruby/object:Gem::Dependency
|
238
|
-
name: metanorma-cli
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
240
|
-
requirements:
|
241
|
-
- - "~>"
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: 1.1.2
|
244
|
-
type: :development
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - "~>"
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: 1.1.2
|
251
237
|
description: |
|
252
238
|
Metanorma for the (fictitious) Acme Corp.
|
253
239
|
|
@@ -281,6 +267,7 @@ files:
|
|
281
267
|
- lib/asciidoctor/acme/isostandard.rng
|
282
268
|
- lib/asciidoctor/acme/reqt.rng
|
283
269
|
- lib/isodoc/acme.rb
|
270
|
+
- lib/isodoc/acme/base_convert.rb
|
284
271
|
- lib/isodoc/acme/html/acme.scss
|
285
272
|
- lib/isodoc/acme/html/header.html
|
286
273
|
- lib/isodoc/acme/html/html_acme_intro.html
|
@@ -313,7 +300,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
313
300
|
requirements:
|
314
301
|
- - ">="
|
315
302
|
- !ruby/object:Gem::Version
|
316
|
-
version:
|
303
|
+
version: 2.4.0
|
317
304
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
318
305
|
requirements:
|
319
306
|
- - ">="
|
@@ -321,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
308
|
version: '0'
|
322
309
|
requirements: []
|
323
310
|
rubyforge_project:
|
324
|
-
rubygems_version: 2.7.
|
311
|
+
rubygems_version: 2.7.7
|
325
312
|
signing_key:
|
326
313
|
specification_version: 4
|
327
314
|
summary: Metanorma for the (fictitious) Acme Corp.
|