metanorma-acme 1.3.10 → 1.4.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: 23fb03b9cda2ad3f07801534e5f010375a32060ef75435b3a8f9718e46f571b9
4
- data.tar.gz: b819bcf8b2396e9cfc316b670eef2019ebfe83901a6dfcaffba6ef14243432f6
3
+ metadata.gz: 471e22b64bfe89b616795392ad00f622e74ebe49f853855424fb53aaa57164f6
4
+ data.tar.gz: 164a35112070dc99ac9e8cfe5559bd93c104ee0648057fb506a997c15a433dd4
5
5
  SHA512:
6
- metadata.gz: 9c0fb81cab87dd4f50d354d6675865cf878daaf11f311a45baf4f6b95c2526f99468581f2db185962215fa2af3e0dc62cbf2d6117f08209ab2118d8572a87dd1
7
- data.tar.gz: 2ed15a9a07bcad1cdbc3eb23fa1af5786691d53dfc427a081d5cb3064db4c8113ba78ccb04725c65e5d63c160e770c1a13cf9bd6a3ec73b30d73eec2cb4d5aef
6
+ metadata.gz: ee7769d61b4c768ea8c78a2be98142b5aef55be19e9db23a9399a6684ec070805a8e6ecb11ec2c238a3f43fec35d5b743a9e1701023a0db02a7027533b5b73eb
7
+ data.tar.gz: 93670ae87f6e3730406f2b1185eb93a82bb8490c3d5e15154e45c878466f36d41719ed5f554a851e9ab69868a968d688c936fbf30a779ec125ecba794394b7b9
@@ -28,13 +28,41 @@ which is syntactically stricter than the common MathJax processor;
28
28
  if you do not get expected results, try bracketing terms your in AsciiMathML
29
29
  expressions.
30
30
 
31
+ == Configuration
32
+
33
+ Gem can be configured in 2 ways:
34
+ 1. By creating yaml config file with name `metanorma.yml`, see `metanorma.yml.example` for example.
35
+ 2. By using `Metanorma::Acme.configuration` method directly:
36
+
37
+ [source,ruby]
38
+ ---
39
+ Metanorma::Acme.configure do |config|
40
+ config.organization_name_short = 'My Organization'
41
+ config.organization_name_long = 'My Organization name'
42
+ config.document_namespace = 'https://open.ribose.com/standards/mine'
43
+ config.xml_root_tag = 'mine-standard'
44
+ config.logo_path = '/metanorma-mine/lib/isodoc/mine/html/logo.jpg'
45
+ config.validate_rng_file = '/metanorma-mine/lib/asciidoctor/mine/mine.rng'
46
+ config.htmlcoverpage = '/metanorma-mine/lib/isodoc/mine/html/html_mine_titlepage.html'
47
+ config.htmlintropage = '/metanorma-mine/lib/isodoc/mine/html/html_mine_intro.html'
48
+ config.htmlstylesheet = '/metanorma-mine/lib/isodoc/mine/html/htmlstyle.scss'
49
+ config.scripts = '/metanorma-mine/lib/isodoc/mine/html/scripts.html'
50
+ config.scripts_pdf = '/metanorma-mine/lib/isodoc/mine/html/scripts.prd.html'
51
+ config.standardstylesheet = '/metanorma-mine/lib/isodoc/mine/html/'
52
+ config.header = '/metanorma-mine/lib/isodoc/mine/html/header.html'
53
+ config.wordcoverpage = '/metanorma-mine/lib/isodoc/mine/html/word_mine_titlepage.html'
54
+ config.wordintropage = '/metanorma-mine/lib/isodoc/mine/html/word_mine_intro.html'
55
+ config.wordstylesheet = '/metanorma-mine/lib/isodoc/mine/html/wordstyle.scss'
56
+ end
57
+ ---
58
+
31
59
  == Usage
32
60
 
33
61
  The preferred way to invoke this gem is via the `metanorma` script:
34
62
 
35
63
  [source,console]
36
64
  ----
37
- $ metanorma --type acme a.adoc # output HTML
65
+ $ metanorma --type acme a.adoc # output HTML
38
66
  $ metanorma --type acme --extensions html a.adoc # output just HTML
39
67
  $ metanorma --type acme --extensions xml a.adoc # output RSD XML
40
68
  ----
@@ -51,7 +79,7 @@ The gem can also be invoked directly within asciidoctor, though this is deprecat
51
79
 
52
80
  [source,console]
53
81
  ----
54
- $ asciidoctor -b acme -r 'metanorma-acme' a.adoc
82
+ $ asciidoctor -b acme -r 'metanorma-acme' a.adoc
55
83
  ----
56
84
 
57
85
  === Installation
@@ -9,14 +9,13 @@ module Asciidoctor
9
9
  # schema encapsulation of the document for validation
10
10
  #
11
11
  class Converter < Standoc::Converter
12
-
13
12
  register_for "acme"
14
13
 
15
14
  def metadata_author(node, xml)
16
15
  xml.contributor do |c|
17
16
  c.role **{ type: "author" }
18
17
  c.organization do |a|
19
- a.name Metanorma::Acme::ORGANIZATION_NAME_SHORT
18
+ a.name configuration.organization_name_short
20
19
  end
21
20
  end
22
21
  end
@@ -25,7 +24,7 @@ module Asciidoctor
25
24
  xml.contributor do |c|
26
25
  c.role **{ type: "publisher" }
27
26
  c.organization do |a|
28
- a.name Metanorma::Acme::ORGANIZATION_NAME_SHORT
27
+ a.name configuration.organization_name_short
29
28
  end
30
29
  end
31
30
  end
@@ -47,7 +46,7 @@ module Asciidoctor
47
46
  def metadata_id(node, xml)
48
47
  return unless node.attr("docnumber")
49
48
  xml.docidentifier do |i|
50
- i << "#{Metanorma::Acme::ORGANIZATION_NAME_SHORT} "\
49
+ i << "#{configuration.organization_name_short} "\
51
50
  "#{node.attr("docnumber")}"
52
51
  end
53
52
  xml.docnumber { |i| i << node.attr("docnumber") }
@@ -59,7 +58,7 @@ module Asciidoctor
59
58
  c.from from
60
59
  c.owner do |owner|
61
60
  owner.organization do |o|
62
- o.name Metanorma::Acme::ORGANIZATION_NAME_SHORT
61
+ o.name configuration.organization_name_short
63
62
  end
64
63
  end
65
64
  end
@@ -80,15 +79,16 @@ module Asciidoctor
80
79
  end
81
80
 
82
81
  def makexml(node)
83
- result = ["<?xml version='1.0' encoding='UTF-8'?>\n<acme-standard>"]
82
+ root_tag = configuration.xml_root_tag || 'acme-standard'
83
+ result = ["<?xml version='1.0' encoding='UTF-8'?>\n<#{root_tag}>"]
84
84
  @draft = node.attributes.has_key?("draft")
85
85
  result << noko { |ixml| front node, ixml }
86
86
  result << noko { |ixml| middle node, ixml }
87
- result << "</acme-standard>"
87
+ result << "</#{root_tag}>"
88
88
  result = textcleanup(result)
89
89
  ret1 = cleanup(Nokogiri::XML(result))
90
90
  validate(ret1) unless @novalid
91
- ret1.root.add_namespace(nil, Metanorma::Acme::DOCUMENT_NAMESPACE)
91
+ ret1.root.add_namespace(nil, configuration.document_namespace)
92
92
  ret1
93
93
  end
94
94
 
@@ -120,7 +120,8 @@ module Asciidoctor
120
120
  def validate(doc)
121
121
  content_validate(doc)
122
122
  schema_validate(formattedstr_strip(doc.dup),
123
- File.join(File.dirname(__FILE__), "acme.rng"))
123
+ configuration.validate_rng_file ||
124
+ File.join(File.dirname(__FILE__), "acme.rng"))
124
125
  end
125
126
 
126
127
  def html_path_acme(file)
@@ -149,6 +150,10 @@ module Asciidoctor
149
150
  def word_converter(node)
150
151
  IsoDoc::Acme::WordConvert.new(doc_extract_attributes(node))
151
152
  end
153
+
154
+ def configuration
155
+ Metanorma::Acme.configuration
156
+ end
152
157
  end
153
158
  end
154
159
  end
@@ -32,7 +32,6 @@ module IsoDoc
32
32
 
33
33
  def i18n_init(lang, script)
34
34
  super
35
- @annex_lbl = "Appendix"
36
35
  end
37
36
 
38
37
  def fileloc(loc)
@@ -250,13 +250,35 @@ 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;}
260
282
  p.Terms, li.Terms, div.Terms
261
283
  {mso-style-name:"Term\(s\)";
262
284
  mso-style-priority:8;
@@ -555,6 +577,28 @@ div.WordSection1
555
577
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
556
578
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
557
579
  mso-paper-source:0;}
580
+
581
+ @page WordSection2L
582
+ {size:841.9pt 595.3pt;
583
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
584
+ mso-header-margin:35.45pt;
585
+ mso-footer-margin:14.2pt;
586
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
587
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
588
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2l;
589
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2l;
590
+ mso-paper-source:0;}
591
+ @page WordSection2P
592
+ {size:595.3pt 841.9pt;
593
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
594
+ mso-header-margin:35.45pt;
595
+ mso-footer-margin:14.2pt;
596
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
597
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
598
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
599
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
600
+ mso-paper-source:0;}
601
+
558
602
  div.WordSection2
559
603
  {page:WordSection2;}
560
604
  @page WordSection3
@@ -568,6 +612,28 @@ div.WordSection2
568
612
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
569
613
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
570
614
  mso-paper-source:0;}
615
+ @page WordSection3L
616
+ {size:841.9pt 595.3pt;
617
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
618
+ mso-header-margin:35.45pt;
619
+ mso-footer-margin:14.2pt;
620
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2l;
621
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2l;
622
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3l;
623
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3l;
624
+ mso-paper-source:0;}
625
+ @page WordSection3P
626
+ {size:595.3pt 841.9pt;
627
+ margin:39.7pt 53.85pt 1.0cm 53.85pt;
628
+ mso-header-margin:35.45pt;
629
+ mso-footer-margin:14.2pt;
630
+ mso-page-numbers:1;
631
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
632
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
633
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
634
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
635
+ mso-paper-source:0;}
636
+
571
637
  div.WordSection3
572
638
  {page:WordSection3;}
573
639
  table.MsoISOTable
@@ -104,6 +104,14 @@ mso-line-height-rule:exactly'><span lang=EN-GB>Acme Corp.&nbsp;{{ docnumber }}:{
104
104
 
105
105
  </div>
106
106
 
107
+ <div style='mso-element:header' id=eh2l>
108
+
109
+ <p class=MsoHeaderLandscape align=left style='text-align:left;line-height:12.0pt;
110
+ mso-line-height-rule:exactly'><span lang=EN-GB>Acme Corp.&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
111
+
112
+ </div>
113
+
114
+
107
115
  <div style='mso-element:header' id=h2>
108
116
 
109
117
  <p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
@@ -111,6 +119,14 @@ mso-line-height-rule:exactly'><span lang=EN-GB>Acme Corp.&nbsp;{{ docnumber }}:{
111
119
 
112
120
  </div>
113
121
 
122
+ <div style='mso-element:header' id=h2l>
123
+
124
+ <p class=MsoHeaderLandscape align=right style='text-align:right;line-height:12.0pt;
125
+ mso-line-height-rule:exactly'><span lang=EN-GB>Acme Corp.&nbsp;{{ docnumber }}:{{ docyear }}</span></p>
126
+
127
+ </div>
128
+
129
+
114
130
  <div style='mso-element:footer' id=ef2>
115
131
 
116
132
  <p class=MsoFooter style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span
@@ -125,11 +141,24 @@ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
125
141
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
126
142
  1'>                                                                                                                                                                           </span>©
127
143
  Acme Corp.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
144
+ </div>
128
145
 
146
+ <div style='mso-element:footer' id=ef2l>
147
+ <p class=MsoFooterLandscape style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span
148
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
149
+ style='mso-element:field-begin'></span><span
150
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
151
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
152
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
153
+ style='mso-no-proof:yes'>ii</span></span><!--[if supportFields]><span
154
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
155
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
156
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
157
+ 1'>                                                                                                                                                                           </span>©
158
+ Acme Corp.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
129
159
  </div>
130
160
 
131
161
  <div style='mso-element:footer' id=f2>
132
-
133
162
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
134
163
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Acme Corp.&nbsp;{{ docyear }}&nbsp;– All
135
164
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
@@ -141,11 +170,23 @@ style='mso-no-proof:yes'>iii</span></span><!--[if supportFields]><span
141
170
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
142
171
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
143
172
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
173
+ </div>
144
174
 
175
+ <div style='mso-element:footer' id=f2l>
176
+ <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
177
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Acme Corp.&nbsp;{{ docyear }}&nbsp;– All
178
+ rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
179
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
180
+ style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
181
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
182
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
183
+ style='mso-no-proof:yes'>iii</span></span><!--[if supportFields]><span
184
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
185
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
186
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
145
187
  </div>
146
188
 
147
189
  <div style='mso-element:footer' id=ef3>
148
-
149
190
  <p class=MsoFooter style='margin-top:12.0pt;line-height:12.0pt;mso-line-height-rule:
150
191
  exactly'><!--[if supportFields]><b style='mso-bidi-font-weight:normal'><span
151
192
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
@@ -159,11 +200,25 @@ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b
159
200
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
160
201
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
161
202
  Acme Corp.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
203
+ </div>
162
204
 
205
+ <div style='mso-element:footer' id=ef3l>
206
+ <p class=MsoFooterLandscape style='margin-top:12.0pt;line-height:12.0pt;mso-line-height-rule:
207
+ exactly'><!--[if supportFields]><b style='mso-bidi-font-weight:normal'><span
208
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
209
+ style='mso-element:field-begin'></span><span
210
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
211
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span></b><![endif]--><b
212
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
213
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!--[if supportFields]><b
214
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
215
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
216
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
217
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>©
218
+ Acme Corp.&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
163
219
  </div>
164
220
 
165
221
  <div style='mso-element:footer' id=f3>
166
-
167
222
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
168
223
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Acme Corp.&nbsp;{{ docyear }}&nbsp;– All
169
224
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
@@ -176,7 +231,21 @@ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>3</span></span></b><!-
176
231
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
177
232
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
178
233
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
234
+ </div>
179
235
 
236
+ <div style='mso-element:footer' id=f3l>
237
+ <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
238
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Acme Corp.&nbsp;{{ docyear }}&nbsp;– All
239
+ rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
240
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
241
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
242
+ PAGE<span style='mso-spacerun:yes'>   </span>\* MERGEFORMAT <span
243
+ style='mso-element:field-separator'></span></span></b><![endif]--><b
244
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
245
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>3</span></span></b><!--[if supportFields]><b
246
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
247
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
248
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
180
249
  </div>
181
250
 
182
251
  </body>
@@ -158,6 +158,17 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
158
158
  mso-fareast-font-family:"Times New Roman";
159
159
  mso-ansi-language:EN-US;
160
160
  mso-fareast-language:EN-US;}
161
+ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
162
+ {mso-style-unhide:no;
163
+ margin:0cm;
164
+ margin-bottom:.0001pt;
165
+ mso-pagination:widow-orphan;
166
+ tab-stops:center 367.0pt right 734.0pt;
167
+ font-size:10.5pt;
168
+ font-family:$bodyfont;
169
+ mso-fareast-font-family:"Times New Roman";
170
+ mso-ansi-language:EN-US;
171
+ mso-fareast-language:EN-US;}
161
172
  p.MsoFooter, li.MsoFooter, div.MsoFooter
162
173
  {mso-style-unhide:no;
163
174
  margin:0cm;
@@ -169,6 +180,17 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
169
180
  mso-fareast-font-family:"Times New Roman";
170
181
  mso-ansi-language:EN-US;
171
182
  mso-fareast-language:EN-US;}
183
+ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
184
+ {mso-style-unhide:no;
185
+ margin:0cm;
186
+ margin-bottom:.0001pt;
187
+ mso-pagination:widow-orphan;
188
+ tab-stops:right 734.0pt;
189
+ font-size:10.5pt;
190
+ font-family:$bodyfont;
191
+ mso-fareast-font-family:"Times New Roman";
192
+ mso-ansi-language:EN-US;
193
+ mso-fareast-language:EN-US;}
172
194
  span.MsoCommentReference
173
195
  {mso-style-noshow:yes;
174
196
  mso-style-unhide:no;
@@ -23,13 +23,22 @@ module IsoDoc
23
23
 
24
24
  def default_file_locations(_options)
25
25
  {
26
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
27
- htmlcoverpage: html_doc_path("html_acme_titlepage.html"),
28
- htmlintropage: html_doc_path("html_acme_intro.html"),
29
- scripts: html_doc_path("scripts.html"),
26
+ htmlstylesheet: configuration.htmlstylesheet ||
27
+ html_doc_path("htmlstyle.scss"),
28
+ htmlcoverpage: configuration.htmlcoverpage ||
29
+ html_doc_path("html_acme_titlepage.html"),
30
+ htmlintropage: configuration.htmlintropage ||
31
+ html_doc_path("html_acme_intro.html"),
32
+ scripts: configuration.scripts ||
33
+ html_doc_path("scripts.html"),
34
+ i18nyaml: configuration.i18nyaml
30
35
  }
31
36
  end
32
37
 
38
+ def configuration
39
+ Metanorma::Acme.configuration
40
+ end
41
+
33
42
  def googlefonts
34
43
  <<~HEAD.freeze
35
44
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
@@ -7,19 +7,16 @@ module IsoDoc
7
7
  def initialize(lang, script, labels)
8
8
  super
9
9
  here = File.dirname(__FILE__)
10
- set(:logo, File.expand_path(File.join(here, "html", "logo.jpg")))
10
+ default_logo_path = File.expand_path(File.join(here, "html", "logo.jpg"))
11
+ set(:logo, configuration.logo_path || default_logo_path)
11
12
  end
12
13
 
13
- def title(isoxml, _out)
14
- main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
15
- set(:doctitle, main)
16
- end
17
-
18
- def subtitle(_isoxml, _out)
19
- nil
14
+ def configuration
15
+ Metanorma::Acme.configuration
20
16
  end
21
17
 
22
18
  def author(isoxml, _out)
19
+ super
23
20
  tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
24
21
  set(:tc, tc.text) if tc
25
22
  end
@@ -21,10 +21,14 @@ module IsoDoc
21
21
 
22
22
  def default_file_locations(_options)
23
23
  {
24
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
25
- htmlcoverpage: html_doc_path("html_acme_titlepage.html"),
26
- htmlintropage: html_doc_path("html_acme_intro.html"),
27
- scripts_pdf: html_doc_path("scripts.pdf.html"),
24
+ htmlstylesheet: configuration.htmlstylesheet ||
25
+ html_doc_path("htmlstyle.scss"),
26
+ htmlcoverpage: configuration.htmlcoverpage ||
27
+ html_doc_path("html_acme_titlepage.html"),
28
+ htmlintropage: configuration.htmlintropage ||
29
+ html_doc_path("html_acme_intro.html"),
30
+ scripts_pdf: configuration.scripts_pdf ||
31
+ html_doc_path("scripts.pdf.html")
28
32
  }
29
33
  end
30
34
 
@@ -39,6 +43,10 @@ module IsoDoc
39
43
  docxml
40
44
  end
41
45
 
46
+ def configuration
47
+ Metanorma::Acme.configuration
48
+ end
49
+
42
50
  include BaseConvert
43
51
  end
44
52
  end
@@ -22,16 +22,26 @@ module IsoDoc
22
22
 
23
23
  def default_file_locations(options)
24
24
  {
25
- wordstylesheet: html_doc_path("wordstyle.scss"),
26
- standardstylesheet: html_doc_path("acme.scss"),
27
- header: html_doc_path("header.html"),
28
- wordcoverpage: html_doc_path("word_acme_titlepage.html"),
29
- wordintropage: html_doc_path("word_acme_intro.html"),
25
+ wordstylesheet: configuration.wordstylesheet ||
26
+ html_doc_path("wordstyle.scss"),
27
+ standardstylesheet: configuration.standardstylesheet ||
28
+ html_doc_path("acme.scss"),
29
+ header: configuration.header ||
30
+ html_doc_path("header.html"),
31
+ wordcoverpage: configuration.wordcoverpage ||
32
+ html_doc_path("word_acme_titlepage.html"),
33
+ wordintropage: configuration.wordintropage ||
34
+ html_doc_path("word_acme_intro.html"),
35
+ i18nyaml: configuration.i18nyaml,
30
36
  ulstyle: "l3",
31
37
  olstyle: "l2",
32
38
  }
33
39
  end
34
40
 
41
+ def configuration
42
+ Metanorma::Acme.configuration
43
+ end
44
+
35
45
  include BaseConvert
36
46
  end
37
47
  end
@@ -1,12 +1,71 @@
1
1
  require "metanorma/acme/processor"
2
2
  require "metanorma/acme/version"
3
+ require 'forwardable'
3
4
 
4
5
  module Metanorma
5
6
  module Acme
6
-
7
7
  ORGANIZATION_NAME_SHORT = "Acme"
8
8
  ORGANIZATION_NAME_LONG = "Acme Corp."
9
9
  DOCUMENT_NAMESPACE = "https://open.ribose.com/standards/acme"
10
+ YAML_CONFIG_FILE = 'metanorma.yml'
11
+
12
+ class Configuration
13
+ CONFIG_ATTRS = %i[
14
+ organization_name_short
15
+ organization_name_long
16
+ document_namespace
17
+ i18nyaml
18
+ logo_path
19
+ header
20
+ htmlcoverpage
21
+ htmlintropage
22
+ htmlstylesheet
23
+ scripts
24
+ scripts_pdf
25
+ standardstylesheet
26
+ validate_rng_file
27
+ wordcoverpage
28
+ wordintropage
29
+ wordstylesheet
30
+ xml_root_tag
31
+ ].freeze
32
+
33
+ attr_accessor(*CONFIG_ATTRS)
34
+
35
+ def initialize(*args)
36
+ super
37
+ set_default_values_from_yaml_file
38
+ self.organization_name_short ||= ORGANIZATION_NAME_SHORT
39
+ self.organization_name_long ||= ORGANIZATION_NAME_LONG
40
+ self.document_namespace ||= DOCUMENT_NAMESPACE
41
+ end
42
+
43
+ # Try to set config values from yaml file in current directory
44
+ def set_default_values_from_yaml_file
45
+ return unless File.file?(YAML_CONFIG_FILE)
46
+
47
+ default_config_options = YAML.load(File.read(YAML_CONFIG_FILE))
48
+ CONFIG_ATTRS.each do |attr_name|
49
+ instance_variable_set("@#{attr_name}", default_config_options[attr_name.to_s])
50
+ end
51
+ end
52
+ end
53
+
54
+ class << self
55
+ extend Forwardable
56
+
57
+ attr_accessor :configuration
58
+
59
+ Configuration::CONFIG_ATTRS.each do |attr_name|
60
+ def_delegator :@configuration, attr_name
61
+ end
62
+
63
+ def configure
64
+ self.configuration ||= Configuration.new
65
+ yield(configuration)
66
+ end
67
+ end
10
68
 
69
+ configure {}
11
70
  end
12
71
  end
@@ -3,7 +3,6 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module Acme
5
5
  class Processor < Metanorma::Processor
6
-
7
6
  def initialize
8
7
  @short = :acme
9
8
  @input_format = :asciidoc
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Acme
3
- VERSION = "1.3.10"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
@@ -0,0 +1,16 @@
1
+ organization_name_short: My Organization
2
+ organization_name_long: My Organization name
3
+ document_namespace: https://open.ribose.com/standards/mine
4
+ xml_root_tag: 'mine-standard'
5
+ logo_path: /metanorma-mine/lib/isodoc/mine/html/logo.jpg
6
+ validate_rng_file: /metanorma-mine/lib/asciidoctor/mine/mine.rng
7
+ htmlcoverpage: /metanorma-mine/lib/isodoc/mine/html/html_mine_titlepage.html
8
+ htmlintropage: /metanorma-mine/lib/isodoc/mine/html/html_mine_intro.html
9
+ htmlstylesheet: /metanorma-mine/lib/isodoc/mine/html/htmlstyle.scss
10
+ scripts: /metanorma-mine/lib/isodoc/mine/html/scripts.html
11
+ scripts_pdf: /metanorma-mine/lib/isodoc/mine/html/scripts.prd.html
12
+ standardstylesheet: /metanorma-mine/lib/isodoc/mine/html/
13
+ header: /metanorma-mine/lib/isodoc/mine/html/header.html
14
+ wordcoverpage: /metanorma-mine/lib/isodoc/mine/html/word_mine_titlepage.html
15
+ wordintropage: /metanorma-mine/lib/isodoc/mine/html/word_mine_intro.html
16
+ wordstylesheet: /metanorma-mine/lib/isodoc/mine/html/wordstyle.scss
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.3.10
4
+ version: 1.4.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-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -262,6 +262,7 @@ files:
262
262
  - lib/metanorma/acme/processor.rb
263
263
  - lib/metanorma/acme/version.rb
264
264
  - metanorma-acme.gemspec
265
+ - metanorma.yml.example
265
266
  homepage: https://github.com/metanorma/metanorma-acme
266
267
  licenses:
267
268
  - BSD-2-Clause