metanorma-rsd 1.3.11 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -71,7 +71,7 @@ p.MsoNormal, li.MsoNormal, div.MsoNormal
71
71
  margin:0cm;
72
72
  margin-bottom:12.0pt;
73
73
  mso-pagination:widow-orphan;
74
- font-size:10.5pt;
74
+ font-size:12.0pt;
75
75
  font-family:$bodyfont;
76
76
  mso-fareast-font-family:"Times New Roman";
77
77
  mso-ansi-language:EN-US;
@@ -84,9 +84,9 @@ p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
84
84
  margin-right:0cm;
85
85
  margin-bottom:12.0pt;
86
86
  /* do not put in margin-left, it is specific to list level */
87
- mso-add-space:auto;
87
+ /*mso-add-space:auto;*/
88
88
  mso-pagination:widow-orphan;
89
- font-size:10.5pt;
89
+ font-size:12.0pt;
90
90
  font-family:$bodyfont;
91
91
  mso-ansi-language:EN-AU;
92
92
  mso-fareast-language:EN-US;}
@@ -99,9 +99,9 @@ p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphC
99
99
  margin-right:0cm;
100
100
  margin-bottom:12.0pt;
101
101
  /* do not put in margin-left, it is specific to list level */
102
- mso-add-space:auto;
102
+ /*mso-add-space:auto;*/
103
103
  mso-pagination:widow-orphan;
104
- font-size:10.5pt;
104
+ font-size:12.0pt;
105
105
  font-family:$bodyfont;
106
106
  mso-ansi-language:EN-AU;
107
107
  mso-fareast-language:EN-US;}
@@ -114,9 +114,9 @@ p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagrap
114
114
  margin-right:0cm;
115
115
  margin-bottom:12.0pt;
116
116
  /* do not put in margin-left, it is specific to list level */
117
- mso-add-space:auto;
117
+ /*mso-add-space:auto;*/
118
118
  mso-pagination:widow-orphan;
119
- font-size:10.5pt;
119
+ font-size:12.0pt;
120
120
  font-family:$bodyfont;
121
121
  mso-ansi-language:EN-AU;
122
122
  mso-fareast-language:EN-US;}
@@ -129,9 +129,9 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
129
129
  margin-right:0cm;
130
130
  margin-bottom:12.0pt;
131
131
  /* do not put in margin-left, it is specific to list level */
132
- mso-add-space:auto;
132
+ /*mso-add-space:auto;*/
133
133
  mso-pagination:widow-orphan;
134
- font-size:10.5pt;
134
+ font-size:12.0pt;
135
135
  font-family:$bodyfont;
136
136
  mso-ansi-language:EN-AU;
137
137
  mso-fareast-language:EN-US;}
@@ -153,22 +153,44 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
153
153
  margin-bottom:.0001pt;
154
154
  mso-pagination:widow-orphan;
155
155
  tab-stops:center 216.0pt right 482.0pt;
156
- font-size:10.5pt;
156
+ font-size:12.0pt;
157
157
  font-family:$bodyfont;
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:12.0pt;
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;
164
175
  margin-bottom:.0001pt;
165
176
  mso-pagination:widow-orphan;
166
177
  tab-stops:right 482.0pt;
167
- font-size:10.5pt;
178
+ font-size:10.0pt;
168
179
  font-family:$bodyfont;
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.0pt;
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;
@@ -267,7 +289,7 @@ p.MsoTitleCxSpLast, li.MsoTitleCxSpLast, div.MsoTitleCxSpLast
267
289
  a:link, span.MsoHyperlink
268
290
  {mso-style-unhide:no;
269
291
  mso-style-parent:"";
270
- color:blue;
292
+ color:#ED7D31;
271
293
  text-decoration:underline;
272
294
  text-underline:single;}
273
295
  a:visited, span.MsoHyperlinkFollowed
@@ -340,6 +362,7 @@ h1
340
362
  font-family:$headerfont;
341
363
  mso-fareast-font-family:$headerfont;
342
364
  color:#0E1A85;
365
+ font-weight:normal;
343
366
  mso-font-kerning:0pt;
344
367
  mso-ansi-language:EN-GB;
345
368
  mso-fareast-language:JA;
@@ -364,9 +387,10 @@ h1.Annex
364
387
  mso-list:l1 level1 lfo6;
365
388
  mso-hyphenate:none;
366
389
  tab-stops:20.0pt list 21.6pt left 28.0pt;
367
- font-size:12.0pt;
390
+ font-size:13.0pt;
368
391
  mso-bidi-font-size:11.0pt;
369
392
  font-family:$headerfont;
393
+ font-weight:normal;
370
394
  mso-fareast-font-family:$headerfont;
371
395
  color:#0E1A85;
372
396
  mso-font-kerning:0pt;
@@ -394,7 +418,7 @@ h1.Annex
394
418
  font-size:12.0pt;
395
419
  mso-bidi-font-size:11.0pt;
396
420
  font-family:$headerfont;
397
- font-weight:bold;
421
+ font-weight:normal;
398
422
  mso-fareast-font-family:$headerfont;
399
423
  color:#0E1A85;
400
424
  mso-ansi-language:EN-GB;
@@ -422,6 +446,7 @@ h2
422
446
  font-size:12.0pt;
423
447
  mso-bidi-font-size:11.0pt;
424
448
  font-family:$headerfont;
449
+ font-weight:normal;
425
450
  mso-fareast-font-family:$headerfont;
426
451
  color:#0E1A85;
427
452
  mso-ansi-language:EN-GB;
@@ -448,6 +473,7 @@ h3
448
473
  tab-stops:list 36.0pt left 44.0pt;
449
474
  font-size:11.0pt;
450
475
  font-family:$headerfont;
476
+ font-weight:normal;
451
477
  color:#0E1A85;
452
478
  mso-fareast-font-family:$headerfont;
453
479
  mso-ansi-language:EN-GB;
@@ -474,6 +500,7 @@ h4
474
500
  tab-stops:51.05pt 57.0pt 68.0pt;
475
501
  font-size:11.0pt;
476
502
  font-family:$headerfont;
503
+ font-weight:normal;
477
504
  color:#0E1A85;
478
505
  mso-fareast-font-family:$headerfont;
479
506
  mso-ansi-language:EN-GB;
@@ -500,6 +527,7 @@ h5
500
527
  tab-stops:51.05pt list 54.0pt;
501
528
  font-size:11.0pt;
502
529
  font-family:$headerfont;
530
+ font-weight:normal;
503
531
  mso-fareast-font-family:$headerfont;
504
532
  color:#0E1A85;
505
533
  mso-ansi-language:EN-GB;
@@ -526,6 +554,7 @@ h6
526
554
  tab-stops:51.05pt list 72.0pt;
527
555
  font-size:11.0pt;
528
556
  font-family:$headerfont;
557
+ font-weight:normal;
529
558
  color:#0E1A85;
530
559
  mso-fareast-font-family:$headerfont;
531
560
  mso-ansi-language:EN-GB;
@@ -545,12 +574,12 @@ p.MsoToc1, li.MsoToc1, div.MsoToc1
545
574
  mso-pagination:widow-orphan;
546
575
  mso-hyphenate:none;
547
576
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
548
- font-size:10.5pt;
577
+ font-size:12.0pt;
549
578
  font-family:$bodyfont;
550
579
  mso-fareast-font-family:$bodyfont;
551
580
  mso-bidi-font-family:$bodyfont;
552
581
  mso-ansi-language:EN-GB;
553
- font-weight:bold;
582
+ font-weight:normal;
554
583
  mso-bidi-font-weight:normal;}
555
584
  p.MsoToc2, li.MsoToc2, div.MsoToc2
556
585
  {mso-style-noshow:yes;
@@ -568,12 +597,12 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2
568
597
  mso-pagination:widow-orphan;
569
598
  mso-hyphenate:none;
570
599
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
571
- font-size:10.5pt;
600
+ font-size:12.0pt;
572
601
  font-family:$bodyfont;
573
602
  mso-fareast-font-family:$bodyfont;
574
603
  mso-bidi-font-family:$bodyfont;
575
604
  mso-ansi-language:EN-GB;
576
- font-weight:bold;
605
+ font-weight:normal;
577
606
  mso-bidi-font-weight:normal;}
578
607
  p.MsoToc3, li.MsoToc3, div.MsoToc3
579
608
  {mso-style-noshow:yes;
@@ -591,12 +620,12 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
591
620
  mso-pagination:widow-orphan;
592
621
  mso-hyphenate:none;
593
622
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
594
- font-size:10.5pt;
623
+ font-size:12.0pt;
595
624
  font-family:$bodyfont;
596
625
  mso-fareast-font-family:$bodyfont;
597
626
  mso-bidi-font-family:$bodyfont;
598
627
  mso-ansi-language:EN-GB;
599
- font-weight:bold;
628
+ font-weight:normal;
600
629
  mso-bidi-font-weight:normal;}
601
630
  span.MsoFootnoteReference
602
631
  {mso-style-priority:99;
@@ -631,7 +660,7 @@ p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
631
660
  text-align:justify;
632
661
  line-height:12.0pt;
633
662
  mso-pagination:widow-orphan;
634
- font-size:10.5pt;
663
+ font-size:12.0pt;
635
664
  font-family:$bodyfont;
636
665
  mso-fareast-font-family:$bodyfont;
637
666
  mso-bidi-font-family:$bodyfont;
@@ -645,12 +674,13 @@ span.Heading1Char
645
674
  mso-style-link:"Heading 1";
646
675
  mso-ansi-font-size:13.0pt;
647
676
  font-family:$headerfont;
677
+ color:#0E1A85;
678
+ font-weight:normal;
648
679
  mso-ascii-font-family:Cambria;
649
680
  mso-fareast-font-family:$headerfont;
650
681
  mso-hansi-font-family:$headerfont;
651
682
  mso-ansi-language:EN-GB;
652
683
  mso-fareast-language:JA;
653
- font-weight:bold;
654
684
  mso-bidi-font-weight:normal;}
655
685
  span.Heading2Char
656
686
  {mso-style-name:"Heading 2 Char";
@@ -661,12 +691,13 @@ span.Heading2Char
661
691
  mso-style-link:"Heading 2";
662
692
  mso-ansi-font-size:12.0pt;
663
693
  font-family:$headerfont;
694
+ color:#0E1A85;
695
+ font-weight:normal;
664
696
  mso-ascii-font-family:Cambria;
665
697
  mso-fareast-font-family:$headerfont;
666
698
  mso-hansi-font-family:$headerfont;
667
699
  mso-ansi-language:EN-GB;
668
700
  mso-fareast-language:JA;
669
- font-weight:bold;
670
701
  mso-bidi-font-weight:normal;}
671
702
  span.Heading3Char
672
703
  {mso-style-name:"Heading 3 Char";
@@ -677,12 +708,13 @@ span.Heading3Char
677
708
  mso-style-link:"Heading 3";
678
709
  mso-ansi-font-size:11.0pt;
679
710
  font-family:$headerfont;
711
+ color:#0E1A85;
712
+ font-weight:normal;
680
713
  mso-ascii-font-family:$headerfont;
681
714
  mso-fareast-font-family:$headerfont;
682
715
  mso-hansi-font-family:$headerfont;
683
716
  mso-ansi-language:EN-GB;
684
717
  mso-fareast-language:JA;
685
- font-weight:bold;
686
718
  mso-bidi-font-weight:normal;}
687
719
  span.Heading4Char
688
720
  {mso-style-name:"Heading 4 Char";
@@ -693,12 +725,13 @@ span.Heading4Char
693
725
  mso-style-link:"Heading 4";
694
726
  mso-ansi-font-size:11.0pt;
695
727
  font-family:$headerfont;
728
+ color:#0E1A85;
729
+ font-weight:normal;
696
730
  mso-ascii-font-family:$headerfont;
697
731
  mso-fareast-font-family:$headerfont;
698
732
  mso-hansi-font-family:$headerfont;
699
733
  mso-ansi-language:EN-GB;
700
734
  mso-fareast-language:JA;
701
- font-weight:bold;
702
735
  mso-bidi-font-weight:normal;}
703
736
  span.Heading5Char
704
737
  {mso-style-name:"Heading 5 Char";
@@ -709,12 +742,13 @@ span.Heading5Char
709
742
  mso-style-link:"Heading 5";
710
743
  mso-ansi-font-size:11.0pt;
711
744
  font-family:$headerfont;
745
+ color:#0E1A85;
746
+ font-weight:normal;
712
747
  mso-ascii-font-family:$headerfont;
713
748
  mso-fareast-font-family:$headerfont;
714
749
  mso-hansi-font-family:$headerfont;
715
750
  mso-ansi-language:EN-GB;
716
751
  mso-fareast-language:JA;
717
- font-weight:bold;
718
752
  mso-bidi-font-weight:normal;}
719
753
  span.Heading6Char
720
754
  {mso-style-name:"Heading 6 Char";
@@ -725,12 +759,13 @@ span.Heading6Char
725
759
  mso-style-link:"Heading 6";
726
760
  mso-ansi-font-size:11.0pt;
727
761
  font-family:$headerfont;
762
+ color:#0E1A85;
763
+ font-weight:normal;
728
764
  mso-ascii-font-family:$headerfont;
729
765
  mso-fareast-font-family:$headerfont;
730
766
  mso-hansi-font-family:$headerfont;
731
767
  mso-ansi-language:EN-GB;
732
768
  mso-fareast-language:JA;
733
- font-weight:bold;
734
769
  mso-bidi-font-weight:normal;}
735
770
  p.Tablebody, li.Tablebody, div.Tablebody
736
771
  {mso-style-name:"Table body";
@@ -1124,7 +1159,7 @@ table.MsoNormalTable
1124
1159
  mso-para-margin:0cm;
1125
1160
  mso-para-margin-bottom:.0001pt;
1126
1161
  mso-pagination:widow-orphan;
1127
- font-size:10.0pt;
1162
+ font-size:12.0pt;
1128
1163
  font-family:$bodyfont;}
1129
1164
  ol
1130
1165
  {margin-bottom:0cm;
@@ -1,50 +1,31 @@
1
- require_relative "base_convert"
2
1
  require "isodoc"
2
+ require "isodoc/generic/html_convert"
3
+ require "isodoc/rsd/metadata"
3
4
 
4
5
  module IsoDoc
5
6
  module Rsd
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 default_fonts(options)
17
- {
18
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
19
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
20
- monospacefont: '"Space Mono",monospace'
21
- }
22
- end
23
-
24
- def default_file_locations(_options)
25
- {
26
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
27
- htmlcoverpage: html_doc_path("html_rsd_titlepage.html"),
28
- htmlintropage: html_doc_path("html_rsd_intro.html"),
29
- scripts: html_doc_path("scripts.html"),
30
- }
31
- end
32
-
33
- def googlefonts
34
- <<~HEAD.freeze
35
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
36
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
37
- HEAD
10
+ class HtmlConvert < IsoDoc::Generic::HtmlConvert
11
+ def configuration
12
+ Metanorma::Rsd.configuration
38
13
  end
39
14
 
40
- def make_body(xml, docxml)
41
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
42
- xml.body **body_attr do |body|
43
- make_body1(body, docxml)
44
- make_body2(body, docxml)
45
- make_body3(body, docxml)
46
- end
15
+ def make_body3(body, docxml)
16
+ body.div **{ class: "main-section" } do |div3|
17
+ boilerplate docxml, div3
18
+ abstract docxml, div3
19
+ foreword docxml, div3
20
+ executivesummary docxml, div3
21
+ introduction docxml, div3
22
+ preface docxml, div3
23
+ acknowledgements docxml, div3
24
+ middle docxml, div3
25
+ footnotes div3
26
+ comments div3
47
27
  end
28
+ end
48
29
 
49
30
  include BaseConvert
50
31
  end
@@ -3,77 +3,37 @@ require "isodoc"
3
3
  module IsoDoc
4
4
  module Rsd
5
5
 
6
- class Metadata < IsoDoc::Metadata
7
- def initialize(lang, script, labels)
8
- super
9
- here = File.dirname(__FILE__)
10
- set(:logo_svg,
11
- File.expand_path(File.join(here, "html", "logo.svg")))
12
- end
13
-
14
- def title(isoxml, _out)
15
- main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
16
- set(:doctitle, main)
17
- end
18
-
19
- def subtitle(_isoxml, _out)
20
- nil
6
+ class Metadata < IsoDoc::Generic::Metadata
7
+ def configuration
8
+ Metanorma::Rsd.configuration
21
9
  end
22
10
 
23
- def author(isoxml, _out)
24
- tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
25
- set(:tc, tc.text) if tc
26
- end
27
-
28
- def docid(isoxml, _out)
29
- docnumber = isoxml.at(ns("//bibdata/docidentifier"))
30
- set(:docnumber, docnumber&.text)
31
- end
32
-
33
- def status_abbr(status)
34
- case status
35
- when "working-draft" then "wd"
36
- when "committee-draft" then "cd"
37
- when "draft-standard" then "d"
38
- else
39
- ""
40
- end
11
+ def security(isoxml, _out)
12
+ security = isoxml.at(ns("//bibdata/ext/security")) || return
13
+ set(:security, security.text)
41
14
  end
42
15
 
43
- def unpublished(status)
44
- !%w(published withdrawn).include? status.downcase
16
+ def recipient(isoxml, _out)
17
+ recipient = isoxml.at(ns("//bibdata/ext/recipient")) || return
18
+ set(:recipient, recipient.text)
45
19
  end
46
20
 
47
21
  def version(isoxml, _out)
48
22
  super
49
23
  revdate = get[:revdate]
50
- set(:revdate_monthyear, monthyr(revdate))
51
- end
52
-
53
- MONTHS = {
54
- "01": "January",
55
- "02": "February",
56
- "03": "March",
57
- "04": "April",
58
- "05": "May",
59
- "06": "June",
60
- "07": "July",
61
- "08": "August",
62
- "09": "September",
63
- "10": "October",
64
- "11": "November",
65
- "12": "December",
66
- }.freeze
67
-
68
- def monthyr(isodate)
69
- m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)/.match isodate
70
- return isodate unless m && m[:yr] && m[:mo]
71
- return "#{MONTHS[m[:mo].to_sym]} #{m[:yr]}"
72
- end
73
-
74
- def security(isoxml, _out)
75
- security = isoxml.at(ns("//bibdata/ext/security")) || return
76
- set(:security, security.text)
24
+ set(:revdate_MMMddyyyy, MMMddyyyy(revdate))
25
+ end
26
+
27
+ def MMMddyyyy(isodate)
28
+ return nil if isodate.nil?
29
+ arr = isodate.split("-")
30
+ date = if arr.size == 1 and (/^\d+$/.match isodate)
31
+ Date.new(*arr.map(&:to_i)).strftime("%Y")
32
+ elsif arr.size == 2
33
+ Date.new(*arr.map(&:to_i)).strftime("%B %Y")
34
+ else
35
+ Date.parse(isodate).strftime("%B %d, %Y")
36
+ end
77
37
  end
78
38
  end
79
39
  end