metanorma-generic 1.4.6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,5 +1,6 @@
1
1
  require "isodoc"
2
2
  require_relative "metadata"
3
+ require_relative "xref"
3
4
  require "fileutils"
4
5
 
5
6
  module IsoDoc
@@ -9,6 +10,10 @@ module IsoDoc
9
10
  @meta = Metadata.new(lang, script, labels)
10
11
  end
11
12
 
13
+ def xref_init(lang, script, klass, labels, options)
14
+ @xrefs = Xref.new(lang, script, klass, labels, options)
15
+ end
16
+
12
17
  def baselocation(loc)
13
18
  return nil if loc.nil?
14
19
  File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
@@ -16,7 +21,7 @@ module IsoDoc
16
21
 
17
22
  def annex_name(annex, name, div)
18
23
  div.h1 **{ class: "Annex" } do |t|
19
- t << "#{anchor(annex['id'], :label)} "
24
+ t << "#{@xrefs.anchor(annex['id'], :label)} "
20
25
  t.br
21
26
  t.b do |b|
22
27
  name&.children&.each { |c2| parse(c2, b) }
@@ -54,6 +59,11 @@ module IsoDoc
54
59
  make_body3(body, docxml)
55
60
  end
56
61
  end
62
+
63
+ def info(isoxml, out)
64
+ @meta.ext isoxml, out
65
+ super
66
+ end
57
67
  end
58
68
  end
59
69
  end
@@ -1,26 +1,9 @@
1
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': true, //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
-
2
+ $("#toc").on('click', 'li', function(e) {
3
+ $(this).parent().find('li.toc-active').removeClass('toc-active');
4
+ $(this).addClass('toc-active');
5
+ });
22
6
  </script>
23
-
24
7
  <script>
25
8
  //TOC toggle animation
26
9
  $('#toggle').on('click', function(){
@@ -58,12 +41,16 @@ $('#toggle').on('click', function(){
58
41
  </script>
59
42
 
60
43
  <script>
61
- /**
62
- * AnchorJS - v4.1.0 - 2017-09-20
63
- * https://github.com/bryanbraun/anchorjs
64
- * Copyright (c) 2017 Bryan Braun; Licensed MIT
65
- */
66
- !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>
67
54
 
68
55
  <script>
69
56
  /*
@@ -50,10 +50,8 @@ module IsoDoc
50
50
  end
51
51
 
52
52
  def googlefonts
53
- <<~HEAD.freeze
54
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
55
- <link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
56
- HEAD
53
+ return unless configuration.webfont
54
+ Array(configuration.webfont).map { |x| %{<link href="#{x.gsub(/\&amp;/, '&')}" rel="stylesheet">} }.join("\n")
57
55
  end
58
56
 
59
57
  include BaseConvert
@@ -9,6 +9,9 @@ module IsoDoc
9
9
  here = File.dirname(__FILE__)
10
10
  default_logo_path = File.expand_path(File.join(here, "html", "logo.jpg"))
11
11
  set(:logo, baselocation(configuration.logo_path) || default_logo_path)
12
+ unless configuration.logo_paths.nil?
13
+ set(:logo_paths, Array(configuration.logo_paths).map { |p| baselocation(p) })
14
+ end
12
15
  end
13
16
 
14
17
  class << self
@@ -43,6 +46,13 @@ module IsoDoc
43
46
  stages = configuration&.published_stages || ["published"]
44
47
  !(Array(stages).map { |m| m.downcase }.include? status.downcase)
45
48
  end
49
+
50
+ def ext(isoxml, out)
51
+ Array(configuration.metadata_extensions).each do |e|
52
+ b = isoxml&.at(ns("//bibdata/ext/#{e}"))&.text or next
53
+ set(e.to_sym, b)
54
+ end
55
+ end
46
56
  end
47
57
  end
48
58
  end
@@ -0,0 +1,10 @@
1
+ require_relative "base_convert"
2
+ require "isodoc"
3
+
4
+ module IsoDoc
5
+ module Generic
6
+ class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,6 @@
1
+ module IsoDoc
2
+ module Generic
3
+ class Xref < IsoDoc::Xref
4
+ end
5
+ end
6
+ end
@@ -7,17 +7,21 @@ module Metanorma
7
7
  module Generic
8
8
  ORGANIZATION_NAME_SHORT = "Acme"
9
9
  ORGANIZATION_NAME_LONG = "Acme Corp."
10
- DOCUMENT_NAMESPACE = "https://metanorma.org/ns/generic"
10
+ DOCUMENT_NAMESPACE = "https://www.metanorma.org/ns/generic"
11
11
  YAML_CONFIG_FILE = 'metanorma.yml'
12
12
 
13
13
  class Configuration
14
14
  CONFIG_ATTRS = %i[
15
15
  organization_name_short
16
16
  organization_name_long
17
+ bibliography_titles
17
18
  document_namespace
18
19
  docid_template
20
+ doctypes
21
+ default_doctype
19
22
  i18nyaml
20
23
  logo_path
24
+ logo_paths
21
25
  header
22
26
  htmlcoverpage
23
27
  htmlintropage
@@ -25,12 +29,19 @@ module Metanorma
25
29
  html_bodyfont
26
30
  html_headerfont
27
31
  html_monospacefont
32
+ metadata_extensions
33
+ metanorma_name
34
+ normref_titles
28
35
  published_stages
36
+ default_stage
29
37
  stage_abbreviations
30
38
  scripts
31
39
  scripts_pdf
32
40
  standardstylesheet
41
+ symbols_titles
42
+ termsdefs_titles
33
43
  validate_rng_file
44
+ webfont
34
45
  wordcoverpage
35
46
  wordintropage
36
47
  wordstylesheet
@@ -58,6 +69,15 @@ module Metanorma
58
69
  self.organization_name_short ||= ORGANIZATION_NAME_SHORT
59
70
  self.organization_name_long ||= ORGANIZATION_NAME_LONG
60
71
  self.document_namespace ||= DOCUMENT_NAMESPACE
72
+ self.termsdefs_titles ||=
73
+ ["Terms and definitions", "Terms, definitions, symbols and abbreviated terms",
74
+ "Terms, definitions, symbols and abbreviations", "Terms, definitions and symbols",
75
+ "Terms, definitions and abbreviations", "Terms, definitions and abbreviated terms"]
76
+ self.symbols_titles ||=
77
+ ["Symbols and abbreviated terms", "Symbols", "Abbreviated terms", "Abbreviations"]
78
+ self.normref_titles ||=
79
+ ["Normative references"]
80
+ self.bibliography_titles ||= ["Bibliography"]
61
81
  end
62
82
 
63
83
  def set_default_values_from_yaml_file(config_file)
@@ -2,11 +2,30 @@ 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
21
+ def configuration
22
+ Metanorma::Generic.configuration
23
+ end
24
+
6
25
  def initialize
7
- @short = :generic
26
+ @short = configuration&.metanorma_name&.to_sym || :generic
8
27
  @input_format = :asciidoc
9
- @asciidoctor_backend = :generic
28
+ @asciidoctor_backend = configuration&.metanorma_name&.to_sym || :generic
10
29
  end
11
30
 
12
31
  def output_formats
@@ -54,14 +73,16 @@ module Metanorma
54
73
  super.merge(new_options)
55
74
  end
56
75
 
57
- def output(isodoc_node, outname, format, options={})
76
+ def output(isodoc_node, inname, outname, format, options={})
58
77
  case format
59
78
  when :html
60
- IsoDoc::Generic::HtmlConvert.new(options).convert(outname, isodoc_node)
79
+ IsoDoc::Generic::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
61
80
  when :doc
62
- IsoDoc::Generic::WordConvert.new(options).convert(outname, isodoc_node)
81
+ IsoDoc::Generic::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
63
82
  when :pdf
64
- IsoDoc::Generic::PdfConvert.new(options).convert(outname, isodoc_node)
83
+ IsoDoc::Generic::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
84
+ when :presentation
85
+ IsoDoc::Generic::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
65
86
  else
66
87
  super
67
88
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "1.4.6"
3
+ VERSION = "1.5.0"
4
4
  end
5
5
  end
@@ -28,8 +28,8 @@ 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.4.0"
32
+ spec.add_dependency "isodoc", "~> 1.1.0"
33
33
 
34
34
  spec.add_development_dependency "byebug", "~> 9.1"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -1,12 +1,19 @@
1
+ metanorma_name: generic
1
2
  organization_name_short: My Organization
2
3
  organization_name_long: My Organization name
3
4
  document_namespace: https://open.ribose.com/standards/mine
4
5
  xml_root_tag: 'mine-standard'
5
6
  logo_path: /metanorma-mine/lib/isodoc/mine/html/logo.jpg
7
+ logo_paths:
8
+ - /metanorma-mine/lib/isodoc/mine/html/logo1.jpg
9
+ - /metanorma-mine/lib/isodoc/mine/html/logo2.jpg
6
10
  validate_rng_file: /metanorma-mine/lib/asciidoctor/mine/mine.rng
7
11
  htmlcoverpage: /metanorma-mine/lib/isodoc/mine/html/html_mine_titlepage.html
8
12
  htmlintropage: /metanorma-mine/lib/isodoc/mine/html/html_mine_intro.html
9
13
  htmlstylesheet: /metanorma-mine/lib/isodoc/mine/html/htmlstyle.scss
14
+ html_bodyfont: '"Source Sans Pro",sans-serif'
15
+ html_headerfont: '"Source Sans Pro",sans-serif'
16
+ html_monospacefont: '"Source Code Pro",monospace'
10
17
  scripts: /metanorma-mine/lib/isodoc/mine/html/scripts.html
11
18
  scripts_pdf: /metanorma-mine/lib/isodoc/mine/html/scripts.prd.html
12
19
  standardstylesheet: /metanorma-mine/lib/isodoc/mine/html/
@@ -14,6 +21,41 @@ header: /metanorma-mine/lib/isodoc/mine/html/header.html
14
21
  wordcoverpage: /metanorma-mine/lib/isodoc/mine/html/word_mine_titlepage.html
15
22
  wordintropage: /metanorma-mine/lib/isodoc/mine/html/word_mine_intro.html
16
23
  wordstylesheet: /metanorma-mine/lib/isodoc/mine/html/wordstyle.scss
24
+ word_bodyfont: '"Source Sans Pro","Arial",sans-serif'
25
+ word_headerfont: '"Source Sans Pro","Arial",sans-serif'
26
+ word_monospacefont: '"Source Code Pro",monospace'
17
27
  docid_template: "{{ organization_name_short }} {{ docnumeric }}"
28
+ metadata_extensions:
29
+ - security
18
30
  published_stages:
19
31
  - published
32
+ stage_abbreviations:
33
+ draft-proposal:
34
+ draft-development:
35
+ draft-testing:
36
+ draft-implementation:
37
+ in-force:
38
+ retired:
39
+ metadata_extensions:
40
+ - security
41
+ - recipient
42
+ doctypes:
43
+ - standard
44
+ - recommendation
45
+ default_doctype: standard
46
+ termsdefs_titles:
47
+ - Terms and definitions
48
+ - Terms, definitions, symbols and abbreviated terms
49
+ - Terms, definitions, symbols and abbreviations
50
+ - Terms, definitions and symbls
51
+ - Terms, definitions and abbreviations
52
+ - Terms, definitions and abbreviated terms
53
+ symbols_titles:
54
+ - Symbols and abbreviated terms
55
+ - Symbols
56
+ - Abbreviated terms
57
+ - Abbreviations
58
+ normref_titles:
59
+ - Normative references
60
+ bibliography_titles
61
+ - Bibliography
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.6
4
+ version: 1.5.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-04-03 00:00:00.000000000 Z
11
+ date: 2020-06-27 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.4.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.4.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.1.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.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: byebug
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -235,14 +235,15 @@ files:
235
235
  - lib/isodoc/generic/html/htmlstyle.scss
236
236
  - lib/isodoc/generic/html/logo.jpg
237
237
  - lib/isodoc/generic/html/scripts.html
238
- - lib/isodoc/generic/html/scripts.pdf.html
239
238
  - lib/isodoc/generic/html/word_generic_intro.html
240
239
  - lib/isodoc/generic/html/word_generic_titlepage.html
241
240
  - lib/isodoc/generic/html/wordstyle.scss
242
241
  - lib/isodoc/generic/html_convert.rb
243
242
  - lib/isodoc/generic/metadata.rb
244
243
  - lib/isodoc/generic/pdf_convert.rb
244
+ - lib/isodoc/generic/presentation_xml_convert.rb
245
245
  - lib/isodoc/generic/word_convert.rb
246
+ - lib/isodoc/generic/xref.rb
246
247
  - lib/metanorma-generic.rb
247
248
  - lib/metanorma/generic.rb
248
249
  - lib/metanorma/generic/processor.rb
@@ -253,7 +254,7 @@ homepage: https://github.com/metanorma/metanorma-generic
253
254
  licenses:
254
255
  - BSD-2-Clause
255
256
  metadata: {}
256
- post_install_message:
257
+ post_install_message:
257
258
  rdoc_options: []
258
259
  require_paths:
259
260
  - lib
@@ -268,9 +269,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
269
  - !ruby/object:Gem::Version
269
270
  version: '0'
270
271
  requirements: []
271
- rubyforge_project:
272
- rubygems_version: 2.7.6
273
- signing_key:
272
+ rubygems_version: 3.0.3
273
+ signing_key:
274
274
  specification_version: 4
275
275
  summary: Metanorma template gem for customisation.
276
276
  test_files: []