metanorma-csd 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 +15 -10
- data/appveyor.yml +7 -2
- data/lib/asciidoctor/csd/biblio.rng +44 -15
- data/lib/asciidoctor/csd/converter.rb +1 -0
- data/lib/asciidoctor/csd/csd.rng +6 -195
- data/lib/asciidoctor/csd/front.rb +2 -1
- data/lib/asciidoctor/csd/isodoc.rng +128 -71
- data/lib/asciidoctor/csd/isostandard.rng +29 -304
- data/lib/asciidoctor/csd/reqt.rng +5 -0
- data/lib/asciidoctor/csd/validate.rb +29 -0
- data/lib/asciidoctor/csd/validate_section.rb +1 -1
- data/lib/isodoc/csd/base_convert.rb +49 -0
- data/lib/isodoc/csd/html/html_csd_titlepage.html +3 -3
- data/lib/isodoc/csd/html/word_csd_titlepage.html +1 -1
- data/lib/isodoc/csd/html_convert.rb +2 -41
- data/lib/isodoc/csd/metadata.rb +1 -6
- data/lib/isodoc/csd/pdf_convert.rb +2 -41
- data/lib/isodoc/csd/word_convert.rb +2 -41
- data/lib/metanorma/csd/version.rb +1 -1
- data/metanorma-csd.gemspec +3 -2
- metadata +10 -9
- data/lib/asciidoctor/csd/pdf.js +0 -31
@@ -1,5 +1,5 @@
|
|
1
|
-
<div class="document-stage-band" id="{{
|
2
|
-
<p class="document-stage">{{
|
1
|
+
<div class="document-stage-band" id="{{ stage | replace: ' ', '-' | downcase }}-band">
|
2
|
+
<p class="document-stage">{{ stage }}</p>
|
3
3
|
</div>
|
4
4
|
|
5
5
|
<div class="document-type-band" id="{{ doctype | replace: ' ', '-' | downcase }}-band">
|
@@ -64,7 +64,7 @@
|
|
64
64
|
</div>
|
65
65
|
|
66
66
|
<div class="coverpage-stage-block" >
|
67
|
-
<span class="coverpage-maturity" id="{{
|
67
|
+
<span class="coverpage-maturity" id="{{ stage | replace: ' ', '-' | downcase }}">{% if unpublished %}{{ stage }}{% endif %}</span>
|
68
68
|
</div>
|
69
69
|
|
70
70
|
{% if unpublished %}
|
@@ -34,7 +34,7 @@ margin-left:4.25pt;margin-right:4.25pt'>
|
|
34
34
|
|
35
35
|
<p class="MsoNormal" align="center" style='text-align:center;border:none;
|
36
36
|
mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span
|
37
|
-
lang="EN-GB" style='font-size:16.0pt'>{% if unpublished %}{{
|
37
|
+
lang="EN-GB" style='font-size:16.0pt'>{% if unpublished %}{{ stage }} {% endif %}{{ doctype }}</span></p>
|
38
38
|
|
39
39
|
{% if doctype == "Policy And Procedures" or doctype == "Proposal" %}
|
40
40
|
<p class="MsoNormal" align="center" style='text-align:center;border:none;
|
@@ -1,5 +1,5 @@
|
|
1
|
+
require_relative "base_convert"
|
1
2
|
require "isodoc"
|
2
|
-
require_relative "metadata"
|
3
3
|
|
4
4
|
module IsoDoc
|
5
5
|
module Csd
|
@@ -28,33 +28,6 @@ module IsoDoc
|
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
|
-
def metadata_init(lang, script, labels)
|
32
|
-
@meta = Metadata.new(lang, script, labels)
|
33
|
-
end
|
34
|
-
|
35
|
-
def annex_name(annex, name, div)
|
36
|
-
div.h1 **{ class: "Annex" } do |t|
|
37
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
38
|
-
t.br
|
39
|
-
t.b do |b|
|
40
|
-
name&.children&.each { |c2| parse(c2, b) }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def term_defs_boilerplate(div, source, term, preface)
|
46
|
-
if source.empty? && term.nil?
|
47
|
-
div << @no_terms_boilerplate
|
48
|
-
else
|
49
|
-
div << term_defs_boilerplate_cont(source, term)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def i18n_init(lang, script)
|
54
|
-
super
|
55
|
-
@annex_lbl = "Appendix"
|
56
|
-
end
|
57
|
-
|
58
31
|
def googlefonts()
|
59
32
|
<<~HEAD.freeze
|
60
33
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
|
@@ -75,19 +48,7 @@ module IsoDoc
|
|
75
48
|
docxml
|
76
49
|
end
|
77
50
|
|
78
|
-
|
79
|
-
super
|
80
|
-
term_cleanup(docxml)
|
81
|
-
end
|
82
|
-
|
83
|
-
def term_cleanup(docxml)
|
84
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
85
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
86
|
-
h2.add_child(" ")
|
87
|
-
h2.add_child(d.remove)
|
88
|
-
end
|
89
|
-
docxml
|
90
|
-
end
|
51
|
+
include BaseConvert
|
91
52
|
end
|
92
53
|
end
|
93
54
|
end
|
data/lib/isodoc/csd/metadata.rb
CHANGED
@@ -9,7 +9,6 @@ module IsoDoc
|
|
9
9
|
|
10
10
|
def initialize(lang, script, labels)
|
11
11
|
super
|
12
|
-
set(:status, "XXX")
|
13
12
|
set(:tc, "XXXX")
|
14
13
|
end
|
15
14
|
|
@@ -23,7 +22,7 @@ module IsoDoc
|
|
23
22
|
end
|
24
23
|
|
25
24
|
def author(isoxml, _out)
|
26
|
-
tc = isoxml.at(ns("//bibdata/editorialgroup/technical-committee"))
|
25
|
+
tc = isoxml.at(ns("//bibdata/ext/editorialgroup/technical-committee"))
|
27
26
|
set(:tc, tc.text) if tc
|
28
27
|
personal_authors(isoxml)
|
29
28
|
end
|
@@ -51,10 +50,6 @@ module IsoDoc
|
|
51
50
|
end
|
52
51
|
end
|
53
52
|
|
54
|
-
def status_print(status)
|
55
|
-
status.split(/-/).map{ |w| w.capitalize }.join(" ")
|
56
|
-
end
|
57
|
-
|
58
53
|
def status_abbr(status)
|
59
54
|
::Metanorma::Csd::DOCSTATUS[status] || ""
|
60
55
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
+
require_relative "base_convert"
|
1
2
|
require "isodoc"
|
2
|
-
require_relative "metadata"
|
3
3
|
|
4
4
|
module IsoDoc
|
5
5
|
module Csd
|
@@ -28,33 +28,6 @@ module IsoDoc
|
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
|
-
def metadata_init(lang, script, labels)
|
32
|
-
@meta = Metadata.new(lang, script, labels)
|
33
|
-
end
|
34
|
-
|
35
|
-
def annex_name(annex, name, div)
|
36
|
-
div.h1 **{ class: "Annex" } do |t|
|
37
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
38
|
-
t.br
|
39
|
-
t.b do |b|
|
40
|
-
name&.children&.each { |c2| parse(c2, b) }
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def term_defs_boilerplate(div, source, term, preface)
|
46
|
-
if source.empty? && term.nil?
|
47
|
-
div << @no_terms_boilerplate
|
48
|
-
else
|
49
|
-
div << term_defs_boilerplate_cont(source, term)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def i18n_init(lang, script)
|
54
|
-
super
|
55
|
-
@annex_lbl = "Appendix"
|
56
|
-
end
|
57
|
-
|
58
31
|
def googlefonts()
|
59
32
|
<<~HEAD.freeze
|
60
33
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
|
@@ -75,19 +48,7 @@ module IsoDoc
|
|
75
48
|
docxml
|
76
49
|
end
|
77
50
|
|
78
|
-
|
79
|
-
super
|
80
|
-
term_cleanup(docxml)
|
81
|
-
end
|
82
|
-
|
83
|
-
def term_cleanup(docxml)
|
84
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
85
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
86
|
-
h2.add_child(" ")
|
87
|
-
h2.add_child(d.remove)
|
88
|
-
end
|
89
|
-
docxml
|
90
|
-
end
|
51
|
+
include BaseConvert
|
91
52
|
end
|
92
53
|
end
|
93
54
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
+
require_relative "base_convert"
|
1
2
|
require "isodoc"
|
2
|
-
require_relative "metadata"
|
3
3
|
|
4
4
|
module IsoDoc
|
5
5
|
module Csd
|
@@ -31,46 +31,7 @@ module IsoDoc
|
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
@meta = Metadata.new(lang, script, labels)
|
36
|
-
end
|
37
|
-
|
38
|
-
def annex_name(annex, name, div)
|
39
|
-
div.h1 **{ class: "Annex" } do |t|
|
40
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
41
|
-
t.br
|
42
|
-
t.b do |b|
|
43
|
-
name&.children&.each { |c2| parse(c2, b) }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def term_defs_boilerplate(div, source, term, preface)
|
49
|
-
if source.empty? && term.nil?
|
50
|
-
div << @no_terms_boilerplate
|
51
|
-
else
|
52
|
-
div << term_defs_boilerplate_cont(source, term)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def i18n_init(lang, script)
|
57
|
-
super
|
58
|
-
@annex_lbl = "Appendix"
|
59
|
-
end
|
60
|
-
|
61
|
-
def cleanup(docxml)
|
62
|
-
super
|
63
|
-
term_cleanup(docxml)
|
64
|
-
end
|
65
|
-
|
66
|
-
def term_cleanup(docxml)
|
67
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
68
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
69
|
-
h2.add_child(" ")
|
70
|
-
h2.add_child(d.remove)
|
71
|
-
end
|
72
|
-
docxml
|
73
|
-
end
|
34
|
+
include BaseConvert
|
74
35
|
end
|
75
36
|
end
|
76
37
|
end
|
data/metanorma-csd.gemspec
CHANGED
@@ -26,9 +26,10 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.bindir = "exe"
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
29
30
|
|
30
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
31
|
-
spec.add_dependency "isodoc", "~> 0.
|
31
|
+
spec.add_dependency "metanorma-standoc", "~> 1.2.0"
|
32
|
+
spec.add_dependency "isodoc", "~> 0.10.0"
|
32
33
|
|
33
34
|
spec.add_development_dependency "bundler", "~> 2.0.1"
|
34
35
|
spec.add_development_dependency "byebug", "~> 9.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csd
|
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: metanorma-standoc
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: isodoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.10.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.10.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,9 +226,10 @@ files:
|
|
226
226
|
- lib/asciidoctor/csd/front.rb
|
227
227
|
- lib/asciidoctor/csd/isodoc.rng
|
228
228
|
- lib/asciidoctor/csd/isostandard.rng
|
229
|
-
- lib/asciidoctor/csd/pdf.js
|
230
229
|
- lib/asciidoctor/csd/reqt.rng
|
230
|
+
- lib/asciidoctor/csd/validate.rb
|
231
231
|
- lib/asciidoctor/csd/validate_section.rb
|
232
|
+
- lib/isodoc/csd/base_convert.rb
|
232
233
|
- lib/isodoc/csd/html/csd.scss
|
233
234
|
- lib/isodoc/csd/html/dots-w@2x.png
|
234
235
|
- lib/isodoc/csd/html/dots@2x.png
|
@@ -262,7 +263,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
263
|
requirements:
|
263
264
|
- - ">="
|
264
265
|
- !ruby/object:Gem::Version
|
265
|
-
version:
|
266
|
+
version: 2.4.0
|
266
267
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
268
|
requirements:
|
268
269
|
- - ">="
|
@@ -270,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
271
|
version: '0'
|
271
272
|
requirements: []
|
272
273
|
rubyforge_project:
|
273
|
-
rubygems_version: 2.7.
|
274
|
+
rubygems_version: 2.7.7
|
274
275
|
signing_key:
|
275
276
|
specification_version: 4
|
276
277
|
summary: metanorma-csd lets you write CSD in AsciiDoc.
|
data/lib/asciidoctor/csd/pdf.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
try {
|
4
|
-
require.resolve("puppeteer");
|
5
|
-
} catch(e) {
|
6
|
-
console.error("puppeteer Node library is not installed; will not generate PDF");
|
7
|
-
process.exit(e.code);
|
8
|
-
}
|
9
|
-
|
10
|
-
const puppeteer = require('puppeteer');
|
11
|
-
|
12
|
-
const createPdf = async() => {
|
13
|
-
let browser;
|
14
|
-
try {
|
15
|
-
browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
|
16
|
-
const page = await browser.newPage();
|
17
|
-
await page.goto(process.argv[2], {waitUntil: 'networkidle2'});
|
18
|
-
await page.pdf({
|
19
|
-
path: process.argv[3],
|
20
|
-
format: 'A4'
|
21
|
-
});
|
22
|
-
} catch (err) {
|
23
|
-
console.log(err.message);
|
24
|
-
} finally {
|
25
|
-
if (browser) {
|
26
|
-
browser.close();
|
27
|
-
}
|
28
|
-
process.exit();
|
29
|
-
}
|
30
|
-
};
|
31
|
-
createPdf();
|