metanorma-vsd 0.5.10 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af94050aafe113e35205fa1adc233ed7a02379a5952ff3dbd57629a437cf7876
4
- data.tar.gz: 27569f99b350c6905f34027973c320d1f3a3b4455657e56e9a55d3bab1a7786a
3
+ metadata.gz: ff6c6756f9aca08b9dfa46cc7c44e2492c2b3eff1dd4830d2209d23207460fe4
4
+ data.tar.gz: 3838c29c90be6dcabc1f2cb84217bc80886c15fb9f6e4df60daf6f45c5f7f030
5
5
  SHA512:
6
- metadata.gz: b9b18cebe10ef47d80521d10ecb23b622414ac8bdcd17a73258157abf25a258c0084c4c701f5006cc08f1a41227fdfdf1af0d8d4cbb2c200f0ed0274438cfb81
7
- data.tar.gz: 722f46f88568e11db065d9204d4b7dc4298b4e1e199b384a7f763c74600634701620c321b2627e930d7518db89195c6cfec71a7ddfdfcf9457454f6fe0796e4b
6
+ metadata.gz: 0b1be161f2530b38d139652fabff99b9bdb481e4d39b2ea3b9ecc741128049df12baa7b6b459e0aca036276d3ca9ed07c8f1d6b47bf599fd417249439825a7c0
7
+ data.tar.gz: 07ef77b762841313896837956a3f65f9ff4fda73b80e243d31bf955b1b2cc6cbb787f9a693d7a3eba20c885b31a39eac03e807efa826239ddd790e4344392f73
@@ -1,98 +1,29 @@
1
1
  require "asciidoctor/standoc/converter"
2
- require "isodoc/vsd"
2
+ require 'asciidoctor/acme/converter'
3
3
 
4
4
  module Asciidoctor
5
5
  module Vsd
6
-
7
6
  # A {Converter} implementation that generates RSD output, and a document
8
7
  # schema encapsulation of the document for validation
9
8
  #
10
- class Converter < Standoc::Converter
11
-
9
+ class Converter < Asciidoctor::Acme::Converter
12
10
  register_for "vsd"
13
11
 
14
- def metadata_author(node, xml)
15
- xml.contributor do |c|
16
- c.role **{ type: "author" }
17
- c.organization do |a|
18
- a.name Metanorma::Vsd::ORGANIZATION_NAME
19
- end
20
- end
21
- end
22
-
23
- def metadata_publisher(node, xml)
24
- xml.contributor do |c|
25
- c.role **{ type: "publisher" }
26
- c.organization do |a|
27
- a.name Metanorma::Vsd::ORGANIZATION_NAME
28
- end
29
- end
12
+ def configuration
13
+ Metanorma::Vsd.configuration
30
14
  end
31
15
 
32
- def metadata_copyright(node, xml)
33
- from = node.attr("copyright-year") || Date.today.year
34
- xml.copyright do |c|
35
- c.from from
36
- c.owner do |owner|
37
- owner.organization do |o|
38
- o.name Metanorma::Vsd::ORGANIZATION_NAME
39
- end
40
- end
41
- end
42
- end
43
-
44
- def makexml(node)
45
- result = ["<?xml version='1.0' encoding='UTF-8'?>\n<vsd-standard>"]
46
- @draft = node.attributes.has_key?("draft")
47
- result << noko { |ixml| front node, ixml }
48
- result << noko { |ixml| middle node, ixml }
49
- result << "</vsd-standard>"
50
- result = textcleanup(result)
51
- ret1 = cleanup(Nokogiri::XML(result))
52
- validate(ret1)
53
- ret1.root.add_namespace(nil, IsoDoc::Vsd::DOCUMENT_NAMESPACE)
54
- ret1
55
- end
56
-
57
- def doctype(node)
58
- d = node.attr("doctype")
59
- unless %w{policy-and-procedures best-practices supporting-document report legal directives proposal standard}.include? d
60
- warn "#{d} is not a legal document type: reverting to 'standard'"
61
- d = "standard"
62
- end
63
- d
64
- end
65
-
66
- def validate(doc)
67
- content_validate(doc)
68
- schema_validate(formattedstr_strip(doc.dup),
69
- File.join(File.dirname(__FILE__), "vsd.rng"))
16
+ def html_converter(node)
17
+ IsoDoc::Vsd::HtmlConvert.new(html_extract_attributes(node))
70
18
  end
71
19
 
72
- def html_converter(node)
73
- IsoDoc::Vsd::HtmlConvert.new(
74
- script: node.attr("script"),
75
- bodyfont: node.attr("body-font"),
76
- headerfont: node.attr("header-font"),
77
- monospacefont: node.attr("monospace-font"),
78
- titlefont: node.attr("title-font"),
79
- i18nyaml: node.attr("i18nyaml"),
80
- scope: node.attr("scope"),
81
- )
20
+ def pdf_converter(node)
21
+ IsoDoc::Vsd::PdfConvert.new(html_extract_attributes(node))
82
22
  end
83
23
 
84
24
  def word_converter(node)
85
- IsoDoc::Vsd::WordConvert.new(
86
- script: node.attr("script"),
87
- bodyfont: node.attr("body-font"),
88
- headerfont: node.attr("header-font"),
89
- monospacefont: node.attr("monospace-font"),
90
- titlefont: node.attr("title-font"),
91
- i18nyaml: node.attr("i18nyaml"),
92
- scope: node.attr("scope"),
93
- )
25
+ IsoDoc::Vsd::WordConvert.new(doc_extract_attributes(node))
94
26
  end
95
-
96
27
  end
97
28
  end
98
29
  end
@@ -1,9 +1,9 @@
1
- require_relative "vsd/html_convert"
2
- require_relative "vsd/word_convert"
3
- require_relative "vsd/pdf_convert"
1
+ require "isodoc/vsd/metadata"
2
+ require "isodoc/vsd/html_convert"
3
+ require "isodoc/vsd/word_convert"
4
+ require "isodoc/vsd/pdf_convert"
4
5
 
5
6
  module IsoDoc
6
7
  module Vsd
7
- DOCUMENT_NAMESPACE = "https://open.ribose.com/standards/vsd"
8
8
  end
9
9
  end
@@ -98,21 +98,26 @@ Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:
98
98
  </div>
99
99
 
100
100
  <div style='mso-element:header' id=eh2>
101
-
102
101
  <p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
103
102
  mso-line-height-rule:exactly'><span lang=EN-GB>Vita Green International Inc.&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
103
+ </div>
104
104
 
105
+ <div style='mso-element:header' id=eh2l>
106
+ <p class=MsoHeaderLandscape align=left style='text-align:left;line-height:12.0pt;
107
+ mso-line-height-rule:exactly'><span lang=EN-GB>Vita Green International Inc.&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
105
108
  </div>
106
109
 
107
110
  <div style='mso-element:header' id=h2>
108
-
109
111
  <p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
110
112
  mso-line-height-rule:exactly'><span lang=EN-GB>Vita Green International Inc.&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
113
+ </div>
111
114
 
115
+ <div style='mso-element:header' id=h2l>
116
+ <p class=MsoHeaderLandscape align=right style='text-align:right;line-height:12.0pt;
117
+ mso-line-height-rule:exactly'><span lang=EN-GB>Vita Green International Inc.&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
112
118
  </div>
113
119
 
114
120
  <div style='mso-element:footer' id=ef2>
115
-
116
121
  <p class=MsoFooter style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span
117
122
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
118
123
  style='mso-element:field-begin'></span><span
@@ -125,11 +130,24 @@ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
125
130
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
126
131
  1'>                                                                                                                                                                           </span>©
127
132
  Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
133
+ </div>
128
134
 
135
+ <div style='mso-element:footer' id=ef2l>
136
+ <p class=MsoFooterLandscape style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span
137
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
138
+ style='mso-element:field-begin'></span><span
139
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
140
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
141
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
142
+ style='mso-no-proof:yes'>ii</span></span><!--[if supportFields]><span
143
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
144
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
145
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
146
+ 1'>                                                                                                                                                                           </span>©
147
+ Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
129
148
  </div>
130
149
 
131
150
  <div style='mso-element:footer' id=f2>
132
-
133
151
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
134
152
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All
135
153
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
@@ -141,11 +159,23 @@ style='mso-no-proof:yes'>iii</span></span><!--[if supportFields]><span
141
159
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
142
160
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
143
161
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
162
+ </div>
144
163
 
164
+ <div style='mso-element:footer' id=f2l>
165
+ <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
166
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All
167
+ rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
168
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
169
+ style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
170
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
171
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
172
+ style='mso-no-proof:yes'>iii</span></span><!--[if supportFields]><span
173
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
174
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
175
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
145
176
  </div>
146
177
 
147
178
  <div style='mso-element:footer' id=ef3>
148
-
149
179
  <p class=MsoFooter style='margin-top:12.0pt;line-height:12.0pt;mso-line-height-rule:
150
180
  exactly'><!--[if supportFields]><b style='mso-bidi-font-weight:normal'><span
151
181
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
@@ -159,11 +189,25 @@ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b
159
189
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
160
190
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
161
191
  Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
192
+ </div>
162
193
 
194
+ <div style='mso-element:footer' id=ef3l>
195
+ <p class=MsoFooterLandscape style='margin-top:12.0pt;line-height:12.0pt;mso-line-height-rule:
196
+ exactly'><!--[if supportFields]><b style='mso-bidi-font-weight:normal'><span
197
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
198
+ style='mso-element:field-begin'></span><span
199
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
200
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span></b><![endif]--><b
201
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
202
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!--[if supportFields]><b
203
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
204
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
205
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
206
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>©
207
+ Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
163
208
  </div>
164
209
 
165
210
  <div style='mso-element:footer' id=f3>
166
-
167
211
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
168
212
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All
169
213
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
@@ -176,7 +220,21 @@ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>3</span></span></b><!-
176
220
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
177
221
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
178
222
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
223
+ </div>
179
224
 
225
+ <div style='mso-element:footer' id=f3l>
226
+ <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
227
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Vita Green International Inc.&nbsp;{{ docyear }}&nbsp;– All
228
+ rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
229
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
230
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
231
+ PAGE<span style='mso-spacerun:yes'>   </span>\* MERGEFORMAT <span
232
+ style='mso-element:field-separator'></span></span></b><![endif]--><b
233
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
234
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>3</span></span></b><!--[if supportFields]><b
235
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
236
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
237
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
180
238
  </div>
181
239
 
182
240
  </body>
@@ -250,13 +250,36 @@ p.IntroTitle, li.IntroTitle, div.IntroTitle
250
250
  tab-stops:20.15pt;
251
251
  font-size:14.0pt;
252
252
  mso-bidi-font-size:11.0pt;
253
- page-break-before:always;
254
253
  font-family:$headerfont;
255
254
  mso-fareast-font-family:$headerfont;
256
255
  mso-bidi-font-family:$headerfont;
257
256
  mso-ansi-language:EN-GB;
258
257
  font-weight:bold;
258
+ page-break-before:always;
259
259
  mso-bidi-font-weight:normal;}
260
+ p.TitlePageSubhead, li.TitlePageSubhead, div.TitlePageSubhead {
261
+ mso-style-noshow:yes;
262
+ mso-style-unhide:no;
263
+ mso-style-parent:"Foreword Title";
264
+ margin-top:0cm;
265
+ margin-right:0cm;
266
+ margin-bottom:15.5pt;
267
+ margin-left:0cm;
268
+ text-align:center;
269
+ line-height:15.5pt;
270
+ mso-pagination:widow-orphan;
271
+ page-break-after:avoid;
272
+ mso-hyphenate:none;
273
+ tab-stops:20.15pt;
274
+ font-size:14.0pt;
275
+ mso-bidi-font-size:11.0pt;
276
+ font-family:$headerfont;
277
+ mso-fareast-font-family:$headerfont;
278
+ mso-bidi-font-family:$headerfont;
279
+ mso-ansi-language:EN-GB;
280
+ font-weight:bold;
281
+ mso-bidi-font-weight:normal;
282
+ }
260
283
  p.zzContents, li.zzContents, div.zzContents
261
284
  {mso-style-name:zzContents;
262
285
  mso-style-noshow:yes;
@@ -482,6 +505,26 @@ div.WordSection1
482
505
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
483
506
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
484
507
  mso-paper-source:0;}
508
+ @page WordSection2L
509
+ {size:841.9pt 595.3pt;
510
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
511
+ mso-header-margin:35.45pt;
512
+ mso-footer-margin:14.2pt;
513
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
514
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
515
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2l;
516
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2l;
517
+ mso-paper-source:0;}
518
+ @page WordSection2P
519
+ {size:595.3pt 841.9pt;
520
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
521
+ mso-header-margin:35.45pt;
522
+ mso-footer-margin:14.2pt;
523
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
524
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
525
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
526
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
527
+ mso-paper-source:0;}
485
528
  div.WordSection2
486
529
  {page:WordSection2;}
487
530
  @page WordSection3
@@ -495,6 +538,26 @@ div.WordSection2
495
538
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
496
539
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
497
540
  mso-paper-source:0;}
541
+ @page WordSection3L
542
+ {size:841.9pt 595.3pt;
543
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
544
+ mso-header-margin:35.45pt;
545
+ mso-footer-margin:14.2pt;
546
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
547
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
548
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3l;
549
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3l;
550
+ mso-paper-source:0;}
551
+ @page WordSection3P
552
+ {size:595.3pt 841.9pt;
553
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
554
+ mso-header-margin:35.45pt;
555
+ mso-footer-margin:14.2pt;
556
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
557
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
558
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
559
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
560
+ mso-paper-source:0;}
498
561
  div.WordSection3
499
562
  {page:WordSection3;}
500
563
  table.MsoISOTable
@@ -1,72 +1,3 @@
1
- <div style='mso-element:para-border-div;border:solid windowtext 1.0pt;
2
- border-bottom:none;mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:
3
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:1.0pt 4.0pt 0cm 4.0pt;
4
- margin-left:5.1pt;margin-right:5.1pt'>
5
-
6
- <p class="zzCopyright" align="left" style='margin-top:2.0pt;margin-right:0cm;
7
- margin-bottom:12.0pt;margin-left:0cm;text-align:left;page-break-before:always;
8
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-top-alt:
9
- solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;mso-border-right-alt:
10
- solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 0cm 4.0pt'><span
11
- lang="EN-GB" style='color:windowtext'>© {{ agency }} {{ docyear }}, Published in Switzerland.<o:p></o:p></span></p>
12
-
13
- <p class="zzCopyright" style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;
14
- margin-left:0cm;mso-layout-grid-align:none;text-autospace:none;border:none;
15
- mso-border-left-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;
16
- padding:0cm;mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB"
17
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt;color:windowtext'>All rights
18
- reserved. Unless otherwise specified, no part of this publication may be
19
- reproduced or utilized otherwise in any form or by any means, electronic or
20
- mechanical, including photocopying, or posting on the internet or an intranet,
21
- without prior written permission. Permission can be requested from either ISO
22
- at the address below or ISO’s member body in the country of the requester.<o:p></o:p></span></p>
23
-
24
- <p class="zzCopyright" style='margin:0cm;margin-bottom:.0001pt;text-indent:20.15pt;
25
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-left-alt:
26
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
27
- mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
28
- mso-bidi-font-size:11.0pt;color:windowtext'>ISO copyright office<o:p></o:p></span></p>
29
-
30
- <p class="zzCopyright" style='margin:0cm;margin-bottom:.0001pt;text-indent:20.15pt;
31
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-left-alt:
32
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
33
- mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
34
- mso-bidi-font-size:11.0pt;color:windowtext'>Ch. de Blandonnet 8 &#x2022; CP 401<o:p></o:p></span></p>
35
-
36
- <p class="zzCopyright" style='margin:0cm;margin-bottom:.0001pt;text-indent:20.15pt;
37
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-left-alt:
38
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
39
- mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
40
- mso-bidi-font-size:11.0pt;color:windowtext'>CH-1214 Vernier, Geneva,
41
- Switzerland<o:p></o:p></span></p>
42
-
43
- <p class="zzCopyright" style='margin:0cm;margin-bottom:.0001pt;text-indent:20.15pt;
44
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-left-alt:
45
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
46
- mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
47
- mso-bidi-font-size:11.0pt;color:windowtext'>Tel.&nbsp;&nbsp;+ 41 22 749 01 11<o:p></o:p></span></p>
48
-
49
- <p class="zzCopyright" style='margin:0cm;margin-bottom:.0001pt;text-indent:20.15pt;
50
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-left-alt:
51
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
52
- mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
53
- mso-bidi-font-size:11.0pt;color:windowtext'>Fax&nbsp;&nbsp;+ 41 22 749 09 47<o:p></o:p></span></p>
54
-
55
- <p class="zzCopyright" style='margin:0cm;margin-bottom:.0001pt;text-indent:20.15pt;
56
- mso-layout-grid-align:none;text-autospace:none;border:none;mso-border-left-alt:
57
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
58
- mso-padding-alt:0cm 4.0pt 0cm 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
59
- mso-bidi-font-size:11.0pt;color:windowtext'>copyright@iso.org<o:p></o:p></span></p>
60
-
61
- <p class="zzCopyright" style='margin-top:0cm;margin-right:0cm;margin-bottom:12.0pt;
62
- margin-left:0cm;text-indent:20.15pt;mso-layout-grid-align:none;text-autospace:
63
- none;border:none;mso-border-left-alt:solid windowtext .5pt;mso-border-bottom-alt:
64
- solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding:0cm;
65
- mso-padding-alt:0cm 4.0pt 1.0pt 4.0pt'><span lang="EN-GB" style='font-size:10.0pt;
66
- mso-bidi-font-size:11.0pt;color:windowtext'>www.iso.org<o:p></o:p></span></p>
67
-
68
- </div>
69
-
70
1
  <p class="zzContents" style='margin-top:0cm'><span lang="EN-GB">Contents</span></p>
71
2
 
72
3
  WORDTOC
@@ -98,6 +98,17 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
98
98
  mso-fareast-font-family:"Times New Roman";
99
99
  mso-ansi-language:EN-US;
100
100
  mso-fareast-language:EN-US;}
101
+ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
102
+ {mso-style-unhide:no;
103
+ margin:0cm;
104
+ margin-bottom:.0001pt;
105
+ mso-pagination:widow-orphan;
106
+ tab-stops:center 367.0pt right 734.0pt;
107
+ font-size:10.5pt;
108
+ font-family:$bodyfont;
109
+ mso-fareast-font-family:"Times New Roman";
110
+ mso-ansi-language:EN-US;
111
+ mso-fareast-language:EN-US;}
101
112
  p.MsoFooter, li.MsoFooter, div.MsoFooter
102
113
  {mso-style-unhide:no;
103
114
  margin:0cm;
@@ -109,6 +120,17 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
109
120
  mso-fareast-font-family:"Times New Roman";
110
121
  mso-ansi-language:EN-US;
111
122
  mso-fareast-language:EN-US;}
123
+ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
124
+ {mso-style-unhide:no;
125
+ margin:0cm;
126
+ margin-bottom:.0001pt;
127
+ mso-pagination:widow-orphan;
128
+ tab-stops:right 734.0pt;
129
+ font-size:10.5pt;
130
+ font-family:$bodyfont;
131
+ mso-fareast-font-family:"Times New Roman";
132
+ mso-ansi-language:EN-US;
133
+ mso-fareast-language:EN-US;}
112
134
  span.MsoCommentReference
113
135
  {mso-style-noshow:yes;
114
136
  mso-style-unhide:no;
@@ -1,60 +1,20 @@
1
- require "isodoc/html_convert"
2
- require_relative "metadata"
1
+ require "isodoc"
2
+ require "isodoc/acme/html_convert"
3
+ require "isodoc/vsd/metadata"
3
4
 
4
5
  module IsoDoc
5
6
  module Vsd
6
-
7
7
  # A {Converter} implementation that generates HTML output, and a document
8
8
  # schema encapsulation of the document for validation
9
9
  #
10
- class HtmlConvert < IsoDoc::HtmlConvert
11
- def initialize(options)
12
- @libdir ||= File.dirname(__FILE__)
13
- super
14
- end
15
-
16
- #def convert1(docxml, filename, dir)
17
- # FileUtils.cp html_doc_path('logo.png'), File.join(@localdir, "logo.png")
18
- # @files_to_delete << File.join(@localdir, "logo.png")
19
- # super
20
- #end
21
-
22
- def default_fonts(options)
23
- {
24
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
25
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
26
- monospacefont: '"Space Mono",monospace'
27
- }
28
- end
29
-
30
- def default_file_locations(_options)
31
- {
32
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
33
- htmlcoverpage: html_doc_path("html_vsd_titlepage.html"),
34
- htmlintropage: html_doc_path("html_vsd_intro.html"),
35
- scripts: html_doc_path("scripts.html"),
36
- }
10
+ class HtmlConvert < IsoDoc::Acme::HtmlConvert
11
+ def configuration
12
+ Metanorma::Vsd.configuration
37
13
  end
38
14
 
39
15
  def metadata_init(lang, script, labels)
40
16
  @meta = Metadata.new(lang, script, labels)
41
17
  end
42
-
43
- def googlefonts
44
- <<~HEAD.freeze
45
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
46
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
47
- HEAD
48
- end
49
-
50
- def make_body(xml, docxml)
51
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
52
- xml.body **body_attr do |body|
53
- make_body1(body, docxml)
54
- make_body2(body, docxml)
55
- make_body3(body, docxml)
56
- end
57
- end
58
18
  end
59
19
  end
60
20
  end
@@ -2,22 +2,10 @@ require "isodoc"
2
2
 
3
3
  module IsoDoc
4
4
  module Vsd
5
- class Metadata < IsoDoc::Metadata
6
- def initialize(lang, script, labels)
7
- super
8
- here = File.dirname(__FILE__)
9
- set(:logo,
10
- File.expand_path(File.join(here, "html", "logo.png")))
5
+ class Metadata < IsoDoc::Acme::Metadata
6
+ def configuration
7
+ Metanorma::Vsd.configuration
11
8
  end
12
-
13
- def security(isoxml, _out)
14
- keywords = []
15
- isoxml.xpath(ns("//bibdata/keyword")).each do |kw|
16
- keywords << kw.text
17
- end
18
- set(:keywords, keywords)
19
- end
20
-
21
9
  end
22
10
  end
23
11
  end
@@ -1,53 +1,18 @@
1
- require "isodoc/pdf_convert"
2
- require_relative "metadata"
1
+ require "isodoc"
2
+ require "isodoc/vsd/metadata"
3
3
 
4
4
  module IsoDoc
5
5
  module Vsd
6
6
  # A {Converter} implementation that generates PDF HTML output, and a
7
7
  # document schema encapsulation of the document for validation
8
- class PdfConvert < IsoDoc::PdfConvert
9
- def initialize(options)
10
- @libdir ||= File.dirname(__FILE__)
11
- super
12
- end
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_vsd_titlepage.html"),
26
- htmlintropage: html_doc_path("html_vsd_intro.html"),
27
- scripts: html_doc_path("scripts.html"),
28
- }
8
+ class PdfConvert < IsoDoc::Acme::PdfConvert
9
+ def configuration
10
+ Metanorma::Vsd.configuration
29
11
  end
30
12
 
31
13
  def metadata_init(lang, script, labels)
32
14
  @meta = Metadata.new(lang, script, labels)
33
15
  end
34
-
35
- def googlefonts
36
- <<~HEAD.freeze
37
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
38
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
39
- HEAD
40
- end
41
-
42
- def make_body(xml, docxml)
43
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
44
- xml.body **body_attr do |body|
45
- make_body1(body, docxml)
46
- make_body2(body, docxml)
47
- make_body3(body, docxml)
48
- end
49
- end
50
-
51
16
  end
52
17
  end
53
18
  end
@@ -1,60 +1,19 @@
1
- require "isodoc/word_convert"
2
- require_relative "metadata"
1
+ require "isodoc"
2
+ require "isodoc/acme/word_convert"
3
+ require "isodoc/vsd/metadata"
3
4
 
4
5
  module IsoDoc
5
6
  module Vsd
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
- }
21
- end
22
-
23
- def default_file_locations(options)
24
- {
25
- wordstylesheet: html_doc_path("wordstyle.scss"),
26
- standardstylesheet: html_doc_path("vsd.scss"),
27
- header: html_doc_path("header.html"),
28
- wordcoverpage: html_doc_path("word_vsd_titlepage.html"),
29
- wordintropage: html_doc_path("word_vsd_intro.html"),
30
- ulstyle: "l3",
31
- olstyle: "l2",
32
- }
9
+ class WordConvert < IsoDoc::Acme::WordConvert
10
+ def configuration
11
+ Metanorma::Vsd.configuration
33
12
  end
34
13
 
35
14
  def metadata_init(lang, script, labels)
36
15
  @meta = Metadata.new(lang, script, labels)
37
16
  end
38
-
39
- def make_body(xml, docxml)
40
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72" }
41
- xml.body **body_attr do |body|
42
- make_body1(body, docxml)
43
- make_body2(body, docxml)
44
- make_body3(body, docxml)
45
- end
46
- end
47
-
48
- #def generate_header(filename, dir)
49
- #return unless @header
50
- #template = Liquid::Template.parse(File.read(@header, encoding: "UTF-8"))
51
- #meta = @meta.get
52
- #meta[:filename] = filename
53
- #params = meta.map { |k, v| [k.to_s, v] }.to_h
54
- #File.open("header.html", "w") { |f| f.write(template.render(params)) }
55
- #@files_to_delete << "header.html"
56
- #"header.html"
57
- #end
58
17
  end
59
18
  end
60
19
  end
@@ -1,6 +1,6 @@
1
- require "metanorma"
2
- require "metanorma/vsd"
3
-
4
- require "asciidoctor" unless defined? Asciidoctor::Converter
5
- require "asciidoctor/vsd"
1
+ require 'metanorma'
2
+ require 'metanorma/vsd'
6
3
  require "isodoc/vsd"
4
+
5
+ require 'asciidoctor' unless defined? Asciidoctor::Converter
6
+ require 'asciidoctor/vsd'
@@ -1,10 +1,60 @@
1
1
  require "metanorma"
2
+ require "metanorma-acme"
2
3
  require "metanorma/vsd/processor"
3
4
 
4
5
  module Metanorma
5
6
  module Vsd
6
- ORGANIZATION_NAME = "Vita Green"
7
+ ORGANIZATION_NAME_SHORT = 'Vita Green'.freeze
8
+ ORGANIZATION_NAME_LONG = 'Vita Green'.freeze
9
+ DOCUMENT_NAMESPACE = 'https://open.ribose.com/standards/vsd'.freeze
10
+
11
+ class Configuration < Metanorma::Acme::Configuration
12
+ def initialize(*args)
13
+ self.organization_name_short ||= ORGANIZATION_NAME_SHORT
14
+ self.organization_name_long ||= ORGANIZATION_NAME_LONG
15
+ self.document_namespace ||= DOCUMENT_NAMESPACE
16
+ html_configs ||= File.join(File.expand_path('config', __dir__), 'vsd_html.yml')
17
+ isodoc_vsd_html_folder ||= File.join(File.expand_path('../isodoc', __dir__),
18
+ 'vsd',
19
+ 'html')
20
+ self.wordstylesheet ||= File.join(isodoc_vsd_html_folder, 'wordstyle.scss')
21
+ self.standardstylesheet ||= File.join(isodoc_vsd_html_folder, 'vsd.scss')
22
+ self.header ||= File.join(isodoc_vsd_html_folder, 'header.html')
23
+ self.wordcoverpage ||= File.join(isodoc_vsd_html_folder,
24
+ 'word_vsd_titlepage.html')
25
+ self.wordintropage ||= File.join(isodoc_vsd_html_folder,
26
+ 'word_vsd_intro.html')
27
+ self.htmlstylesheet ||= File.join(isodoc_vsd_html_folder,
28
+ 'htmlstyle.scss')
29
+ self.htmlcoverpage ||= File.join(isodoc_vsd_html_folder,
30
+ 'html_vsd_titlepage.html')
31
+ self.htmlintropage ||= File.join(isodoc_vsd_html_folder,
32
+ 'html_vsd_intro.html')
33
+ self.scripts ||= File.join(isodoc_vsd_html_folder, 'scripts.html')
34
+ self.logo_path ||= File.join(isodoc_vsd_html_folder, 'logo.png')
35
+ self.xml_root_tag ||= 'vsd-standard'
36
+ vsd_rng_folder ||= File.join(File.expand_path('asciidoctor', __dir__), 'vsd')
37
+ self.validate_rng_file ||= File.join(vsd_rng_folder, 'vsd.rng')
38
+ super
39
+ end
40
+ end
41
+
42
+ class << self
43
+ extend Forwardable
44
+
45
+ attr_accessor :configuration
46
+
47
+ Configuration::CONFIG_ATTRS.each do |attr_name|
48
+ def_delegator :@configuration, attr_name
49
+ end
50
+
51
+ def configure
52
+ self.configuration ||= Configuration.new
53
+ yield(configuration)
54
+ end
55
+ end
56
+
57
+ configure {}
7
58
  end
8
59
  end
9
-
10
60
  Metanorma::Registry.instance.register(Metanorma::Vsd::Processor)
@@ -3,7 +3,6 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module Vsd
5
5
  class Processor < Metanorma::Processor
6
-
7
6
  def initialize
8
7
  @short = :vsd
9
8
  @input_format = :asciidoc
@@ -33,15 +32,7 @@ module Metanorma
33
32
  when :doc
34
33
  IsoDoc::Vsd::WordConvert.new(options).convert(outname, isodoc_node)
35
34
  when :pdf
36
- IsoDoc::Vsd::PdfConvert.new(options).convert(outname, isodoc_node)
37
- =begin
38
- require 'tempfile'
39
- outname_html = outname + ".html"
40
- IsoDoc::Vsd::HtmlConvert.new(options).convert(outname_html, isodoc_node)
41
- puts outname_html
42
- system "cat #{outname_html}"
43
- Metanorma::Output::Pdf.new.convert(outname_html, outname)
44
- =end
35
+ IsoDoc::Acme::PdfConvert.new(options).convert(outname, isodoc_node)
45
36
  else
46
37
  super
47
38
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Vsd
3
- VERSION = "0.5.10"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
30
  #spec.add_dependency "nokogiri"
31
31
  spec.add_dependency "metanorma-iso", "~> 1.3.0"
32
- #spec.add_dependency "metanorma"
32
+ spec.add_dependency "metanorma-acme", "~> 1.4.0"
33
33
  spec.add_dependency "isodoc", "~> 1.0.0"
34
34
 
35
35
  spec.add_development_dependency "byebug", "~> 9.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-vsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 1.0.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: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.3.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: metanorma-acme
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.4.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.4.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: isodoc
43
57
  requirement: !ruby/object:Gem::Requirement