metanorma-sample 1.0.10 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  //TOC generation
3
3
  $('#toc').toc({
4
- 'selectors': 'h1,h2:not(.TermNum)', //elements to use as headings
4
+ 'selectors': toclevel(), //elements to use as headings
5
5
  'container': 'main', //element to find all selectors in
6
6
  'smoothScrolling': true, //enable or disable smooth scrolling on click
7
7
  'prefix': 'toc', //prefix for anchor tags and class names
@@ -58,6 +58,7 @@ $('#toggle').on('click', function(){
58
58
  </script>
59
59
 
60
60
  <script>
61
+ /*
61
62
  $(document).ready(function() {
62
63
  $('[id^=toc]').each(function ()
63
64
  {
@@ -66,5 +67,6 @@ $('#toggle').on('click', function(){
66
67
  currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "' </a>");
67
68
  });
68
69
  });
70
+ */
69
71
  </script>
70
72
 
@@ -18,7 +18,7 @@ margin-left:4.25pt;margin-right:4.25pt'>
18
18
 
19
19
  <p class="MsoNormal" align="center" style='text-align:center;border:none;
20
20
  mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span
21
- lang="EN-GB" style='font-size:16.0pt'>{{ status }} {{ doctype }}</span></p>
21
+ lang="EN-GB" style='font-size:16.0pt'>{{ stage }} {{ doctype }}</span></p>
22
22
 
23
23
  {% if security %}
24
24
  <p class="MsoNormal" align="center" style='text-align:center;border:none;
@@ -312,7 +312,7 @@ span.blackgraphtx
312
312
  .MsoChpDefault
313
313
  {mso-style-type:export-only;
314
314
  mso-default-props:yes;}
315
- div.figure
315
+ div.figure, p.figure
316
316
  {text-align: center;}
317
317
 
318
318
 
@@ -1075,6 +1075,44 @@ p.Tablebody, li.Tablebody, div.Tablebody
1075
1075
  margin-left:162.0pt;
1076
1076
  text-indent:-18.0pt;}
1077
1077
 
1078
+ div.ListContLevel1
1079
+ {mso-style-priority:34;
1080
+ margin-left:18.0pt;
1081
+ margin-right:0cm;}
1082
+ div.ListContLevel2
1083
+ {mso-style-priority:34;
1084
+ margin-top:0cm;
1085
+ margin-left:36.0pt;
1086
+ margin-right:0cm;}
1087
+ div.ListContLevel3
1088
+ {mso-style-priority:34;
1089
+ margin-left:54.0pt;
1090
+ margin-right:0cm;}
1091
+ div.ListContLevel4
1092
+ {mso-style-priority:34;
1093
+ margin-left:72.0pt;
1094
+ margin-right:0cm;}
1095
+ div.ListContLevel5
1096
+ {mso-style-priority:34;
1097
+ margin-left:90.0pt;
1098
+ margin-right:0cm;}
1099
+ div.ListContLevel6
1100
+ {mso-style-priority:34;
1101
+ margin-left:108.0pt;
1102
+ margin-right:0cm;}
1103
+ div.ListContLevel7
1104
+ {mso-style-priority:34;
1105
+ margin-left:126.0pt;
1106
+ margin-right:0cm;}
1107
+ div.ListContLevel8
1108
+ {mso-style-priority:34;
1109
+ margin-left:144.0pt;
1110
+ margin-right:0cm;}
1111
+ div.ListContLevel9
1112
+ {mso-style-priority:34;
1113
+ margin-left:162.0pt;
1114
+ margin-right:0cm;}
1115
+
1078
1116
  table.MsoNormalTable
1079
1117
  {mso-style-name:"Table Normal";
1080
1118
  mso-tstyle-rowband-size:0;
@@ -1086,16 +1124,8 @@ table.MsoNormalTable
1086
1124
  mso-para-margin:0cm;
1087
1125
  mso-para-margin-bottom:.0001pt;
1088
1126
  mso-pagination:widow-orphan;
1089
- mso-table-anchor-vertical:paragraph;
1090
- mso-table-bspace:12.0pt;
1091
1127
  font-size:10.0pt;
1092
1128
  font-family:$bodyfont;}
1093
- br.section
1094
- {page-break-before:always;
1095
- mso-break-type:section-break;}
1096
- br.pagebreak
1097
- {page-break-before:always;
1098
- mso-special-character:line-break;}
1099
1129
  ol
1100
1130
  {margin-bottom:0cm;
1101
1131
  margin-left:18pt;}
@@ -1,6 +1,5 @@
1
+ require_relative "base_convert"
1
2
  require "isodoc"
2
- require_relative "metadata"
3
- require "fileutils"
4
3
 
5
4
  module IsoDoc
6
5
  module Sample
@@ -12,8 +11,6 @@ module IsoDoc
12
11
  def initialize(options)
13
12
  @libdir = File.dirname(__FILE__)
14
13
  super
15
- FileUtils.cp html_doc_path('logo.jpg'), "logo.jpg"
16
- @files_to_delete << "logo.jpg"
17
14
  end
18
15
 
19
16
  def default_fonts(options)
@@ -33,26 +30,10 @@ module IsoDoc
33
30
  }
34
31
  end
35
32
 
36
-
37
- def metadata_init(lang, script, labels)
38
- @meta = Metadata.new(lang, script, labels)
39
- end
40
-
41
- def html_head
33
+ def googlefonts
42
34
  <<~HEAD.freeze
43
- <title>{{ doctitle }}</title>
44
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
45
-
46
- <!--TOC script import-->
47
- <script type="text/javascript" src="https://cdn.rawgit.com/jgallen23/toc/0.3.2/dist/toc.min.js"></script>
48
-
49
- <!--Google fonts-->
50
35
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
51
36
  <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
52
- <!--Font awesome import for the link icon-->
53
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/solid.css" integrity="sha384-v2Tw72dyUXeU3y4aM2Y0tBJQkGfplr39mxZqlTBDUZAb9BGoC40+rdFCG0m10lXk" crossorigin="anonymous">
54
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/fontawesome.css" integrity="sha384-q3jl8XQu1OpdLgGFvNRnPdj5VIlCvgsDQTQB6owSOHWlAurxul7f+JpUOVdAiJ5P" crossorigin="anonymous">
55
- <style class="anchorjs"></style>
56
37
  HEAD
57
38
  end
58
39
 
@@ -65,55 +46,7 @@ module IsoDoc
65
46
  end
66
47
  end
67
48
 
68
- def html_toc(docxml)
69
- docxml
70
- end
71
-
72
- def annex_name(annex, name, div)
73
- div.h1 **{ class: "Annex" } do |t|
74
- t << "#{get_anchors[annex['id']][:label]} "
75
- t.br
76
- t.b do |b|
77
- name&.children&.each { |c2| parse(c2, b) }
78
- end
79
- end
80
- end
81
-
82
- def term_defs_boilerplate(div, source, term, preface)
83
- if source.empty? && term.nil?
84
- div << @no_terms_boilerplate
85
- else
86
- div << term_defs_boilerplate_cont(source, term)
87
- end
88
- end
89
-
90
- def i18n_init(lang, script)
91
- super
92
- @annex_lbl = "Appendix"
93
- end
94
-
95
- def fileloc(loc)
96
- File.join(File.dirname(__FILE__), loc)
97
- end
98
-
99
- def cleanup(docxml)
100
- super
101
- term_cleanup(docxml)
102
- end
103
-
104
- def term_cleanup(docxml)
105
- docxml.xpath("//p[@class = 'Terms']").each do |d|
106
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
107
- h2.add_child("&nbsp;")
108
- h2.add_child(d.remove)
109
- end
110
- docxml
111
- end
112
-
113
- def info(isoxml, out)
114
- @meta.security isoxml, out
115
- super
116
- end
49
+ include BaseConvert
117
50
  end
118
51
  end
119
52
  end
@@ -6,28 +6,15 @@ module IsoDoc
6
6
  class Metadata < IsoDoc::Metadata
7
7
  def initialize(lang, script, labels)
8
8
  super
9
- set(:status, "XXX")
10
- end
11
-
12
- def title(isoxml, _out)
13
- main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
14
- set(:doctitle, main)
15
- end
16
-
17
- def subtitle(_isoxml, _out)
18
- nil
9
+ here = File.dirname(__FILE__)
10
+ set(:logo, File.expand_path(File.join(here, "html", "logo.jpg")))
19
11
  end
20
12
 
21
13
  def author(isoxml, _out)
22
- tc = isoxml.at(ns("//bibdata/editorialgroup/committee"))
14
+ tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
23
15
  set(:tc, tc.text) if tc
24
16
  end
25
17
 
26
- def docid(isoxml, _out)
27
- docnumber = isoxml.at(ns("//bibdata/docidentifier"))
28
- set(:docnumber, docnumber&.text)
29
- end
30
-
31
18
  def status_abbr(status)
32
19
  case status
33
20
  when "working-draft" then "wd"
@@ -66,7 +53,7 @@ module IsoDoc
66
53
  end
67
54
 
68
55
  def security(isoxml, _out)
69
- security = isoxml.at(ns("//bibdata/security")) || return
56
+ security = isoxml.at(ns("//bibdata/ext/security")) || return
70
57
  set(:security, security.text)
71
58
  end
72
59
  end
@@ -1,6 +1,5 @@
1
+ require_relative "base_convert"
1
2
  require "isodoc"
2
- require_relative "metadata"
3
- require "fileutils"
4
3
 
5
4
  module IsoDoc
6
5
  module Sample
@@ -10,8 +9,6 @@ module IsoDoc
10
9
  def initialize(options)
11
10
  @libdir = File.dirname(__FILE__)
12
11
  super
13
- FileUtils.cp html_doc_path('logo.jpg'), "logo.jpg"
14
- @files_to_delete << "logo.jpg"
15
12
  end
16
13
 
17
14
  def default_fonts(options)
@@ -31,25 +28,10 @@ module IsoDoc
31
28
  }
32
29
  end
33
30
 
34
- def metadata_init(lang, script, labels)
35
- @meta = Metadata.new(lang, script, labels)
36
- end
37
-
38
- def html_head()
31
+ def googlefonts()
39
32
  <<~HEAD.freeze
40
- <title>{{ doctitle }}</title>
41
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
42
-
43
- <!--TOC script import-->
44
- <script type="text/javascript" src="https://cdn.rawgit.com/jgallen23/toc/0.3.2/dist/toc.min.js"></script>
45
-
46
- <!--Google fonts-->
47
33
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
48
34
  <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
49
- <!--Font awesome import for the link icon-->
50
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/solid.css" integrity="sha384-v2Tw72dyUXeU3y4aM2Y0tBJQkGfplr39mxZqlTBDUZAb9BGoC40+rdFCG0m10lXk" crossorigin="anonymous">
51
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/fontawesome.css" integrity="sha384-q3jl8XQu1OpdLgGFvNRnPdj5VIlCvgsDQTQB6owSOHWlAurxul7f+JpUOVdAiJ5P" crossorigin="anonymous">
52
- <style class="anchorjs"></style>
53
35
  HEAD
54
36
  end
55
37
 
@@ -66,51 +48,7 @@ module IsoDoc
66
48
  docxml
67
49
  end
68
50
 
69
- def annex_name(annex, name, div)
70
- div.h1 **{ class: "Annex" } do |t|
71
- t << "#{get_anchors[annex['id']][:label]} "
72
- t.br
73
- t.b do |b|
74
- name&.children&.each { |c2| parse(c2, b) }
75
- end
76
- end
77
- end
78
-
79
- def term_defs_boilerplate(div, source, term, preface)
80
- if source.empty? && term.nil?
81
- div << @no_terms_boilerplate
82
- else
83
- div << term_defs_boilerplate_cont(source, term)
84
- end
85
- end
86
-
87
- def i18n_init(lang, script)
88
- super
89
- @annex_lbl = "Appendix"
90
- end
91
-
92
- def fileloc(loc)
93
- File.join(File.dirname(__FILE__), loc)
94
- end
95
-
96
- def cleanup(docxml)
97
- super
98
- term_cleanup(docxml)
99
- end
100
-
101
- def term_cleanup(docxml)
102
- docxml.xpath("//p[@class = 'Terms']").each do |d|
103
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
104
- h2.add_child("&nbsp;")
105
- h2.add_child(d.remove)
106
- end
107
- docxml
108
- end
109
-
110
- def info(isoxml, out)
111
- @meta.security isoxml, out
112
- super
113
- end
51
+ include BaseConvert
114
52
  end
115
53
  end
116
54
  end
@@ -1,6 +1,5 @@
1
+ require_relative "base_convert"
1
2
  require "isodoc"
2
- require_relative "metadata"
3
- require "fileutils"
4
3
 
5
4
  module IsoDoc
6
5
  module Sample
@@ -11,7 +10,6 @@ module IsoDoc
11
10
  def initialize(options)
12
11
  @libdir = File.dirname(__FILE__)
13
12
  super
14
- FileUtils.cp html_doc_path('logo.jpg'), "logo.jpg"
15
13
  end
16
14
 
17
15
  def default_fonts(options)
@@ -34,10 +32,6 @@ module IsoDoc
34
32
  }
35
33
  end
36
34
 
37
- def metadata_init(lang, script, labels)
38
- @meta = Metadata.new(lang, script, labels)
39
- end
40
-
41
35
  def make_body(xml, docxml)
42
36
  body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72" }
43
37
  xml.body **body_attr do |body|
@@ -46,53 +40,8 @@ module IsoDoc
46
40
  make_body3(body, docxml)
47
41
  end
48
42
  end
49
-
50
- def info(isoxml, out)
51
- @meta.security isoxml, out
52
- super
53
- end
54
-
55
- def annex_name(annex, name, div)
56
- div.h1 **{ class: "Annex" } do |t|
57
- t << "#{get_anchors[annex['id']][:label]} "
58
- t.br
59
- t.b do |b|
60
- name&.children&.each { |c2| parse(c2, b) }
61
- end
62
- end
63
- end
64
-
65
- def term_defs_boilerplate(div, source, term, preface)
66
- if source.empty? && term.nil?
67
- div << @no_terms_boilerplate
68
- else
69
- div << term_defs_boilerplate_cont(source, term)
70
- end
71
- end
72
-
73
- def i18n_init(lang, script)
74
- super
75
- @annex_lbl = "Appendix"
76
- end
77
-
78
- def fileloc(loc)
79
- File.join(File.dirname(__FILE__), loc)
80
- end
81
-
82
- def cleanup(docxml)
83
- super
84
- term_cleanup(docxml)
85
- end
86
-
87
- def term_cleanup(docxml)
88
- docxml.xpath("//p[@class = 'Terms']").each do |d|
89
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
90
- h2.add_child("&nbsp;")
91
- h2.add_child(d.remove)
92
- end
93
- docxml
94
- end
95
-
43
+
44
+ include BaseConvert
96
45
  end
97
46
  end
98
47
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Sample
3
- VERSION = "1.0.10"
3
+ VERSION = "1.3.8"
4
4
  end
5
5
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  This gem is meant to be customised for any downstream use.
16
16
  DESCRIPTION
17
17
 
18
- spec.homepage = "https://github.com/riboseinc/metanorma-sample"
18
+ spec.homepage = "https://github.com/metanorma/metanorma-sample"
19
19
  spec.license = "BSD-2-Clause"
20
20
 
21
21
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -24,15 +24,14 @@ Gem::Specification.new do |spec|
24
24
  spec.bindir = "exe"
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
27
28
 
28
- spec.add_dependency "asciidoctor", "~> 1.5.7"
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
30
  spec.add_dependency "ruby-jing"
31
31
 
32
- spec.add_dependency "metanorma-standoc", "~> 1.0.0"
33
- spec.add_dependency "isodoc", "~> 0.9.0"
32
+ spec.add_dependency "metanorma-standoc", "~> 1.3.0"
33
+ spec.add_dependency "isodoc", "~> 1.0.0"
34
34
 
35
- spec.add_development_dependency "bundler", "~> 1.15"
36
35
  spec.add_development_dependency "byebug", "~> 9.1"
37
36
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
38
37
  spec.add_development_dependency "guard", "~> 2.14"