metanorma-csd 1.3.16 → 1.3.22
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.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +10 -10
- data/.github/workflows/ubuntu.yml +25 -11
- data/.github/workflows/windows.yml +11 -12
- data/README.adoc +3 -2
- data/lib/asciidoctor/csd/biblio.rng +131 -46
- data/lib/asciidoctor/csd/converter.rb +1 -1
- data/lib/asciidoctor/csd/isodoc.rng +32 -4
- data/lib/isodoc/csd/csd.standard.xsl +2638 -0
- data/lib/isodoc/csd/html/htmlstyle.scss +5 -2
- data/lib/isodoc/csd/html/scripts.html +16 -29
- data/lib/isodoc/csd/html_convert.rb +5 -5
- data/lib/isodoc/csd/metadata.rb +1 -1
- data/lib/isodoc/csd/pdf_convert.rb +13 -37
- data/lib/isodoc/csd/word_convert.rb +3 -3
- data/lib/metanorma/csd/processor.rb +8 -0
- data/lib/metanorma/csd/version.rb +1 -1
- metadata +3 -3
- data/lib/isodoc/csd/html/scripts.pdf.html +0 -72
@@ -1,27 +1,11 @@
|
|
1
1
|
<script>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
<script>
|
7
|
+
|
8
|
+
<script>
|
25
9
|
//TOC toggle animation
|
26
10
|
$('#toggle').on('click', function(){
|
27
11
|
if( $('nav').is(':visible') ) {
|
@@ -58,13 +42,16 @@ $('#toggle').on('click', function(){
|
|
58
42
|
</script>
|
59
43
|
|
60
44
|
<script>
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
45
|
+
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
|
46
|
+
//
|
47
|
+
// AnchorJS - v4.2.2 - 2020-04-20
|
48
|
+
// https://www.bryanbraun.com/anchorjs/
|
49
|
+
// Copyright (c) 2020 Bryan Braun; Licensed MIT
|
50
|
+
//
|
51
|
+
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
|
52
|
+
!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}}});
|
53
|
+
// @license-end
|
54
|
+
</script>
|
68
55
|
<script>
|
69
56
|
/*
|
70
57
|
$(document).ready(function() {
|
@@ -13,9 +13,9 @@ module IsoDoc
|
|
13
13
|
|
14
14
|
def default_fonts(options)
|
15
15
|
{
|
16
|
-
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"
|
17
|
-
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"
|
18
|
-
monospacefont: '"
|
16
|
+
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Source Sans Pro",sans-serif'),
|
17
|
+
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Source Sans Pro",sans-serif'),
|
18
|
+
monospacefont: '"Source Code Pro",monospace'
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|
@@ -30,8 +30,8 @@ module IsoDoc
|
|
30
30
|
|
31
31
|
def googlefonts()
|
32
32
|
<<~HEAD.freeze
|
33
|
-
<link href="https://fonts.googleapis.com/css?family=
|
34
|
-
<link href="https://fonts.googleapis.com/
|
33
|
+
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700&display=swap" rel="stylesheet">
|
34
|
+
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
35
35
|
HEAD
|
36
36
|
end
|
37
37
|
|
data/lib/isodoc/csd/metadata.rb
CHANGED
@@ -5,51 +5,27 @@ module IsoDoc
|
|
5
5
|
module Csd
|
6
6
|
# A {Converter} implementation that generates CSD output, and a document
|
7
7
|
# schema encapsulation of the document for validation
|
8
|
-
class PdfConvert < IsoDoc::
|
8
|
+
class PdfConvert < IsoDoc::XslfoPdfConvert
|
9
9
|
def initialize(options)
|
10
10
|
@libdir = File.dirname(__FILE__)
|
11
11
|
super
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
def default_file_locations(options)
|
23
|
-
{
|
24
|
-
htmlstylesheet: html_doc_path("htmlstyle.scss"),
|
25
|
-
htmlcoverpage: html_doc_path("html_csd_titlepage.html"),
|
26
|
-
htmlintropage: html_doc_path("html_csd_intro.html"),
|
27
|
-
scripts_pdf: html_doc_path("scripts.pdf.html"),
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
def googlefonts()
|
32
|
-
<<~HEAD.freeze
|
33
|
-
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
|
34
|
-
<link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
|
35
|
-
HEAD
|
36
|
-
end
|
37
|
-
|
38
|
-
def make_body(xml, docxml)
|
39
|
-
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
|
40
|
-
xml.body **body_attr do |body|
|
41
|
-
make_body1(body, docxml)
|
42
|
-
make_body2(body, docxml)
|
43
|
-
make_body3(body, docxml)
|
14
|
+
def convert(filename, file = nil, debug = false)
|
15
|
+
file = File.read(filename, encoding: "utf-8") if file.nil?
|
16
|
+
docxml, outname_html, dir = convert_init(file, filename, debug)
|
17
|
+
/\.xml$/.match(filename) or
|
18
|
+
filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
|
19
|
+
f.write file
|
20
|
+
f.path
|
44
21
|
end
|
22
|
+
FileUtils.rm_rf dir
|
23
|
+
::Metanorma::Output::XslfoPdf.new.convert(
|
24
|
+
filename, outname_html + ".pdf",
|
25
|
+
File.join(@libdir, "csd.standard.xsl"))
|
45
26
|
end
|
46
|
-
|
47
|
-
def html_toc(docxml)
|
48
|
-
docxml
|
49
|
-
end
|
50
|
-
|
51
|
-
include BaseConvert
|
52
27
|
end
|
53
28
|
end
|
54
29
|
end
|
55
30
|
|
31
|
+
|
@@ -13,9 +13,9 @@ module IsoDoc
|
|
13
13
|
|
14
14
|
def default_fonts(options)
|
15
15
|
{
|
16
|
-
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
|
17
|
-
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
|
18
|
-
monospacefont: '"Courier New",monospace'
|
16
|
+
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Source Sans Pro","Arial",sans-serif'),
|
17
|
+
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Source Sans Pro","Arial",sans-serif'),
|
18
|
+
monospacefont: '"Source Code Pro","Courier New",monospace'
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|
@@ -2,6 +2,14 @@ require "metanorma/processor"
|
|
2
2
|
|
3
3
|
module Metanorma
|
4
4
|
module Csd
|
5
|
+
def self.fonts_used
|
6
|
+
{
|
7
|
+
html: %w(SourceSansPro SourceSerifPro SourceCodePro HanSans),
|
8
|
+
doc: %w(SourceSansPro SourceSerifPro SourceCodePro HanSans),
|
9
|
+
pdf: %w(SourceSansPro SourceSerifPro SourceCodePro HanSans)
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
5
13
|
class Processor < Metanorma::Processor
|
6
14
|
|
7
15
|
def initialize
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.22
|
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-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -204,6 +204,7 @@ files:
|
|
204
204
|
- lib/asciidoctor/csd/validate.rb
|
205
205
|
- lib/asciidoctor/csd/validate_section.rb
|
206
206
|
- lib/isodoc/csd/base_convert.rb
|
207
|
+
- lib/isodoc/csd/csd.standard.xsl
|
207
208
|
- lib/isodoc/csd/html/_coverpage.scss
|
208
209
|
- lib/isodoc/csd/html/csd.scss
|
209
210
|
- lib/isodoc/csd/html/dots-w@2x.png
|
@@ -213,7 +214,6 @@ files:
|
|
213
214
|
- lib/isodoc/csd/html/html_csd_titlepage.html
|
214
215
|
- lib/isodoc/csd/html/htmlstyle.scss
|
215
216
|
- lib/isodoc/csd/html/scripts.html
|
216
|
-
- lib/isodoc/csd/html/scripts.pdf.html
|
217
217
|
- lib/isodoc/csd/html/word_csd_intro.html
|
218
218
|
- lib/isodoc/csd/html/word_csd_titlepage.html
|
219
219
|
- lib/isodoc/csd/html/wordstyle.scss
|
@@ -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
|
-
|