metanorma-generic 1.4.8 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,9 +30,22 @@
30
30
  <data type="boolean"/>
31
31
  </attribute>
32
32
  </optional>
33
+ <optional>
34
+ <attribute name="number"/>
35
+ </optional>
33
36
  <optional>
34
37
  <attribute name="subsequence"/>
35
38
  </optional>
39
+ <optional>
40
+ <attribute name="keep-with-next">
41
+ <data type="boolean"/>
42
+ </attribute>
43
+ </optional>
44
+ <optional>
45
+ <attribute name="keep-lines-together">
46
+ <data type="boolean"/>
47
+ </attribute>
48
+ </optional>
36
49
  <attribute name="id">
37
50
  <data type="ID"/>
38
51
  </attribute>
@@ -141,6 +154,16 @@
141
154
  <data type="boolean"/>
142
155
  </attribute>
143
156
  </optional>
157
+ <optional>
158
+ <attribute name="keep-with-next">
159
+ <data type="boolean"/>
160
+ </attribute>
161
+ </optional>
162
+ <optional>
163
+ <attribute name="keep-lines-together">
164
+ <data type="boolean"/>
165
+ </attribute>
166
+ </optional>
144
167
  <oneOrMore>
145
168
  <ref name="BasicBlock"/>
146
169
  </oneOrMore>
@@ -2,6 +2,7 @@ require "isodoc/generic/metadata"
2
2
  require "isodoc/generic/html_convert"
3
3
  require "isodoc/generic/pdf_convert"
4
4
  require "isodoc/generic/word_convert"
5
+ require "isodoc/generic/presentation_xml_convert"
5
6
 
6
7
  module IsoDoc
7
8
  module Generic
@@ -1,35 +1,13 @@
1
1
  require "isodoc"
2
- require_relative "metadata"
3
2
  require "fileutils"
4
3
 
5
4
  module IsoDoc
6
5
  module Generic
7
6
  module BaseConvert
8
- def metadata_init(lang, script, labels)
9
- @meta = Metadata.new(lang, script, labels)
10
- end
11
-
12
7
  def baselocation(loc)
13
8
  return nil if loc.nil?
14
- File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
15
- end
16
-
17
- def annex_name(annex, name, div)
18
- div.h1 **{ class: "Annex" } do |t|
19
- t << "#{anchor(annex['id'], :label)} "
20
- t.br
21
- t.b do |b|
22
- name&.children&.each { |c2| parse(c2, b) }
23
- end
24
- end
25
- end
26
-
27
- def i18n_init(lang, script)
28
- super
29
- end
30
-
31
- def fileloc(loc)
32
- File.join(File.dirname(__FILE__), loc)
9
+ File.expand_path(File.join(
10
+ File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
33
11
  end
34
12
 
35
13
  def cleanup(docxml)
@@ -47,7 +25,8 @@ module IsoDoc
47
25
  end
48
26
 
49
27
  def make_body(xml, docxml)
50
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
28
+ body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72",
29
+ "xml:lang": "EN-US", class: "container" }
51
30
  xml.body **body_attr do |body|
52
31
  make_body1(body, docxml)
53
32
  make_body2(body, docxml)
@@ -41,12 +41,16 @@ $('#toggle').on('click', function(){
41
41
  </script>
42
42
 
43
43
  <script>
44
- /**
45
- * AnchorJS - v4.1.0 - 2017-09-20
46
- * https://github.com/bryanbraun/anchorjs
47
- * Copyright (c) 2017 Bryan Braun; Licensed MIT
48
- */
49
- !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function e(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64}function t(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}function i(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}this.options=A||{},this.elements=[],e(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var n,o,s,a,r,c,h,l,u,d,f,p=[];if(e(this.options),"touch"===(f=this.options.visible)&&(f=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(n=t(A)).length)return this;for(i(),o=document.querySelectorAll("[id]"),s=[].map.call(o,function(A){return A.id}),r=0;r<n.length;r++)if(this.hasAnchorJSLink(n[r]))p.push(r);else{if(n[r].hasAttribute("id"))a=n[r].getAttribute("id");else if(n[r].hasAttribute("data-anchor-id"))a=n[r].getAttribute("data-anchor-id");else{u=l=this.urlify(n[r].textContent),h=0;do{void 0!==c&&(u=l+"-"+h),c=s.indexOf(u),h+=1}while(-1!==c);c=void 0,s.push(u),n[r].setAttribute("id",u),a=u}a.replace(/-/g," "),(d=document.createElement("a")).className="anchorjs-link "+this.options.class,d.href="#"+a,d.setAttribute("aria-label",this.options.ariaLabel),d.setAttribute("data-anchorjs-icon",this.options.icon),"always"===f&&(d.style.opacity="1"),""===this.options.icon&&(d.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(d.style.lineHeight="inherit")),"left"===this.options.placement?(d.style.position="absolute",d.style.marginLeft="-1em",d.style.paddingRight="0.5em",n[r].insertBefore(d,n[r].firstChild)):(d.style.paddingLeft="0.375em",n[r].appendChild(d))}for(r=0;r<p.length;r++)n.splice(p[r]-r,1);return this.elements=this.elements.concat(n),this},this.remove=function(A){for(var e,i,n=t(A),o=0;o<n.length;o++)(i=n[o].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(n[o]))&&this.elements.splice(e,1),n[o].removeChild(i));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){var t=/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g;return this.options.truncate||e(this.options),A.trim().replace(/\'/gi,"").replace(t,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&(" "+A.firstChild.className+" ").indexOf(" anchorjs-link ")>-1,t=A.lastChild&&(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ")>-1;return e||t||!1}}}); </script>
44
+ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
45
+ //
46
+ // AnchorJS - v4.2.2 - 2020-04-20
47
+ // https://www.bryanbraun.com/anchorjs/
48
+ // Copyright (c) 2020 Bryan Braun; Licensed MIT
49
+ //
50
+ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
51
+ !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=p(A=A||"h2, h3, h4, h5, h6")).length)return this;for(!function(){if(null!==document.head.querySelector("style.anchorjs"))return;var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(e):document.head.insertBefore(e,A);e.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",e.sheet.cssRules.length),e.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",e.sheet.cssRules.length),e.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",e.sheet.cssRules.length),e.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',e.sheet.cssRules.length)}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
52
+ // @license-end
53
+ </script>
50
54
 
51
55
  <script>
52
56
  /*
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
@@ -51,10 +52,13 @@ module IsoDoc
51
52
 
52
53
  def googlefonts
53
54
  return unless configuration.webfont
54
- Array(configuration.webfont).map { |x| %{<link href="#{x.gsub(/\&amp;/, '&')}" rel="stylesheet">} }.join("\n")
55
+ Array(configuration.webfont).map do |x|
56
+ %{<link href="#{x.gsub(/\&amp;/, '&')}" rel="stylesheet">}
57
+ end.join("\n")
55
58
  end
56
59
 
57
60
  include BaseConvert
61
+ include Init
58
62
  end
59
63
  end
60
64
  end
@@ -0,0 +1,27 @@
1
+ require "isodoc"
2
+ require_relative "metadata"
3
+ require_relative "xref"
4
+
5
+ module IsoDoc
6
+ module Generic
7
+ module Init
8
+ def metadata_init(lang, script, i18n)
9
+ @meta = Metadata.new(lang, script, i18n)
10
+ end
11
+
12
+ def xref_init(lang, script, klass, i18n, options)
13
+ html = HtmlConvert.new(language: lang, script: script)
14
+ @xrefs = Xref.new(lang, script, html, i18n, options)
15
+ end
16
+
17
+ def i18n_init(lang, script, i18nyaml = nil)
18
+ @i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
19
+ end
20
+
21
+ def fileloc(loc)
22
+ File.join(File.dirname(__FILE__), loc)
23
+ end
24
+ end
25
+ end
26
+ end
27
+
@@ -24,7 +24,8 @@ module IsoDoc
24
24
 
25
25
  def baselocation(loc)
26
26
  return nil if loc.nil?
27
- File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
27
+ File.expand_path(File.join(
28
+ File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
28
29
  end
29
30
 
30
31
  def configuration
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
@@ -58,6 +59,7 @@ module IsoDoc
58
59
  end
59
60
 
60
61
  include BaseConvert
62
+ include Init
61
63
  end
62
64
  end
63
65
  end
@@ -0,0 +1,19 @@
1
+ require_relative "init"
2
+ require "isodoc"
3
+
4
+ module IsoDoc
5
+ module Generic
6
+ class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
7
+ def annex1(f)
8
+ lbl = @xrefs.anchor(f['id'], :label)
9
+ if t = f.at(ns("./title"))
10
+ t.children = "<strong>#{t.children.to_xml}</strong>"
11
+ end
12
+ prefix_name(f, "<br/>", lbl, "title")
13
+ end
14
+
15
+ include Init
16
+ end
17
+ end
18
+ end
19
+
@@ -1,4 +1,5 @@
1
1
  require_relative "base_convert"
2
+ require_relative "init"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
@@ -22,8 +23,10 @@ module IsoDoc
22
23
 
23
24
  def default_fonts(options)
24
25
  {
25
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : configuration.word_bodyfont || '"Arial",sans-serif'),
26
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : configuration.word_headerfont || '"Arial",sans-serif'),
26
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
27
+ configuration.word_bodyfont || '"Arial",sans-serif'),
28
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
29
+ configuration.word_headerfont || '"Arial",sans-serif'),
27
30
  monospacefont: configuration.word_monospacefont || '"Courier New",monospace'
28
31
  }
29
32
  end
@@ -51,6 +54,7 @@ module IsoDoc
51
54
  end
52
55
 
53
56
  include BaseConvert
57
+ include Init
54
58
  end
55
59
  end
56
60
  end
@@ -0,0 +1,6 @@
1
+ module IsoDoc
2
+ module Generic
3
+ class Xref < IsoDoc::Xref
4
+ end
5
+ end
6
+ end
@@ -2,6 +2,21 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Generic
5
+ def self.fonts_used
6
+ {
7
+ html: [
8
+ configuration.html_bodyfont || "Overpass", configuration.html_headerfont || "Overpass",
9
+ configuration.html_monospacefont || "Space Mono"
10
+ ].uniq,
11
+ doc: [
12
+ configuration.word_bodyfont || "Overpass", configuration.word_headerfont || "Overpass",
13
+ configuration.word_monospacefont || "Space Mono"].uniq,
14
+ pdf: [
15
+ configuration.word_bodyfont || "Overpass", configuration.word_headerfont || "Overpass",
16
+ configuration.word_monospacefont || "Space Mono"].uniq,
17
+ }
18
+ end
19
+
5
20
  class Processor < Metanorma::Processor
6
21
  def configuration
7
22
  Metanorma::Generic.configuration
@@ -25,10 +40,6 @@ module Metanorma
25
40
  "Metanorma::Generic #{Metanorma::Generic::VERSION}"
26
41
  end
27
42
 
28
- def input_to_isodoc(file, filename)
29
- Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
30
- end
31
-
32
43
  def extract_options(file)
33
44
  head = file.sub(/\n\n.*$/m, "\n")
34
45
  /\n:htmlstylesheet: (?<htmlstylesheet>[^\n]+)\n/ =~ head
@@ -58,14 +69,16 @@ module Metanorma
58
69
  super.merge(new_options)
59
70
  end
60
71
 
61
- def output(isodoc_node, outname, format, options={})
72
+ def output(isodoc_node, inname, outname, format, options={})
62
73
  case format
63
74
  when :html
64
- IsoDoc::Generic::HtmlConvert.new(options).convert(outname, isodoc_node)
75
+ IsoDoc::Generic::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
65
76
  when :doc
66
- IsoDoc::Generic::WordConvert.new(options).convert(outname, isodoc_node)
77
+ IsoDoc::Generic::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
67
78
  when :pdf
68
- IsoDoc::Generic::PdfConvert.new(options).convert(outname, isodoc_node)
79
+ IsoDoc::Generic::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
80
+ when :presentation
81
+ IsoDoc::Generic::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
69
82
  else
70
83
  super
71
84
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "1.4.8"
3
+ VERSION = "1.6.0"
4
4
  end
5
5
  end
@@ -28,10 +28,11 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
30
  spec.add_dependency "ruby-jing"
31
- spec.add_dependency "metanorma-standoc", "~> 1.3.0"
32
- spec.add_dependency "isodoc", "~> 1.0.0"
31
+ spec.add_dependency "metanorma-standoc", "~> 1.5.0"
32
+ spec.add_dependency "isodoc", "~> 1.2.0"
33
33
 
34
34
  spec.add_development_dependency "byebug", "~> 9.1"
35
+ spec.add_development_dependency "sassc", "2.4.0"
35
36
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
37
  spec.add_development_dependency "guard", "~> 2.14"
37
38
  spec.add_development_dependency "guard-rspec", "~> 4.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.8
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-13 00:00:00.000000000 Z
11
+ date: 2020-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.3.0
47
+ version: 1.5.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.3.0
54
+ version: 1.5.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: isodoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: 1.2.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0
68
+ version: 1.2.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '9.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sassc
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 2.4.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 2.4.0
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: equivalent-xml
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -235,14 +249,16 @@ files:
235
249
  - lib/isodoc/generic/html/htmlstyle.scss
236
250
  - lib/isodoc/generic/html/logo.jpg
237
251
  - lib/isodoc/generic/html/scripts.html
238
- - lib/isodoc/generic/html/scripts.pdf.html
239
252
  - lib/isodoc/generic/html/word_generic_intro.html
240
253
  - lib/isodoc/generic/html/word_generic_titlepage.html
241
254
  - lib/isodoc/generic/html/wordstyle.scss
242
255
  - lib/isodoc/generic/html_convert.rb
256
+ - lib/isodoc/generic/init.rb
243
257
  - lib/isodoc/generic/metadata.rb
244
258
  - lib/isodoc/generic/pdf_convert.rb
259
+ - lib/isodoc/generic/presentation_xml_convert.rb
245
260
  - lib/isodoc/generic/word_convert.rb
261
+ - lib/isodoc/generic/xref.rb
246
262
  - lib/metanorma-generic.rb
247
263
  - lib/metanorma/generic.rb
248
264
  - lib/metanorma/generic/processor.rb
@@ -253,7 +269,7 @@ homepage: https://github.com/metanorma/metanorma-generic
253
269
  licenses:
254
270
  - BSD-2-Clause
255
271
  metadata: {}
256
- post_install_message:
272
+ post_install_message:
257
273
  rdoc_options: []
258
274
  require_paths:
259
275
  - lib
@@ -268,9 +284,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
284
  - !ruby/object:Gem::Version
269
285
  version: '0'
270
286
  requirements: []
271
- rubyforge_project:
272
- rubygems_version: 2.7.6
273
- signing_key:
287
+ rubygems_version: 3.0.3
288
+ signing_key:
274
289
  specification_version: 4
275
290
  summary: Metanorma template gem for customisation.
276
291
  test_files: []
@@ -1,72 +0,0 @@
1
- <script>
2
- //TOC generation
3
- $('#toc').toc({
4
- 'selectors': toclevel(), //elements to use as headings
5
- 'container': 'main', //element to find all selectors in
6
- 'smoothScrolling': true, //enable or disable smooth scrolling on click
7
- 'prefix': 'toc', //prefix for anchor tags and class names
8
- 'onHighlight': function(el) {}, //called when a new section is highlighted
9
- 'highlightOnScroll': false, //add class to heading that is currently in focus
10
- 'highlightOffset': 100, //offset to trigger the next headline
11
- 'anchorName': function(i, heading, prefix) { //custom function for anchor name
12
- return prefix+i;
13
- },
14
- 'headerText': function(i, heading, $heading) { //custom function building the header-item text
15
- return $heading.text();
16
- },
17
- 'itemClass': function(i, heading, $heading, prefix) { // custom function for item class
18
- return $heading[0].tagName.toLowerCase();
19
- }
20
- });
21
-
22
- </script>
23
-
24
- <script>
25
- //TOC toggle animation
26
- $('#toggle').on('click', function(){
27
- if( $('nav').is(':visible') ) {
28
- $('nav').animate({ 'left': '-353px' }, 'slow', function(){
29
- $('nav').hide();
30
- });
31
- $('.container').animate({ 'padding-left': '31px' }, 'slow');
32
- }
33
- else {
34
- $('nav').show();
35
- $('nav').animate({ 'left': '0px' }, 'slow');
36
- $('.container').animate({ 'padding-left': '360px' }, 'slow');
37
- }
38
- });
39
- </script>
40
-
41
- <script>
42
- // Scroll to top button
43
- window.onscroll = function() {scrollFunction()};
44
-
45
- function scrollFunction() {
46
- if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
47
- document.getElementById("myBtn").style.display = "block";
48
- } else {
49
- document.getElementById("myBtn").style.display = "none";
50
- }
51
- }
52
-
53
- // When the user clicks on the button, scroll to the top of the document
54
- function topFunction() {
55
- document.body.scrollTop = 0;
56
- document.documentElement.scrollTop = 0;
57
- }
58
- </script>
59
-
60
- <script>
61
- /*
62
- $(document).ready(function() {
63
- $('[id^=toc]').each(function ()
64
- {
65
- var currentToc = $(this);
66
- var url = window.location.href;
67
- currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "' </a>");
68
- });
69
- });
70
- */
71
- </script>
72
-