metanorma-csd 1.3.18 → 1.3.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +0 -7
- data/.github/workflows/ubuntu.yml +2 -9
- data/.github/workflows/windows.yml +0 -8
- data/lib/asciidoctor/csd/biblio.rng +53 -26
- data/lib/asciidoctor/csd/isodoc.rng +28 -1
- data/lib/isodoc/csd/csd.standard.xsl +2593 -0
- data/lib/isodoc/csd/html/scripts.html +6 -22
- data/lib/isodoc/csd/pdf_convert.rb +13 -37
- data/lib/metanorma/csd/processor.rb +4 -0
- data/lib/metanorma/csd/version.rb +1 -1
- metadata +3 -2
@@ -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') ) {
|
@@ -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
|
+
|
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.20
|
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-01 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
|