metanorma-iso 1.10.3 → 1.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 496766841b7e48e3e2f8f879f5e9c485b0874212ea6316a926558ba434f1636a
4
- data.tar.gz: 24bc39c4fdf29b8dfeaba19a972d8a2d2610d940b6b9afb93da58975c8bd6ac3
3
+ metadata.gz: abbf367b7ec988ab0de353fe50309648657bc86b3d7a1495c4ac6722b4653b5b
4
+ data.tar.gz: 365546239553eb27bb0dcdc1e4920234922b93dcb235027f42f7f1a682f3fd18
5
5
  SHA512:
6
- metadata.gz: 2a780fb001362017bf69e8b64ca78eb9c877d20c7bed50670d69fbf9f7a71c40756725e272e3baa0cc9d026c4809cbb222a466f0f9b77b30fe35afbdc9038d60
7
- data.tar.gz: 9db3e3c657f3d5525e2407cc27c498bffbda194dcf06199e49def7a540af8a70755e1f6ff2b4465af09ea9440ffae9a106a965ba2e6696363774faf3bbab7004
6
+ metadata.gz: bbbdb1ad0d1b86c34f437af1ad664c2c6d19d706a28fa01a25cb5b677d1fddaec5d2eec0fdc4eb5846e5254777b3ea0d868ae31ee5c9e59c58f40f67bd17b339
7
+ data.tar.gz: eb62b3b9ab796aba24059a9c45c8432a7fc5a7ee0a3b30c6893fda63bbce62452270ee13f93c66d3f16b054dd9cf92887cca868a849f42c248b5f8c37efbfdfa
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ Encoding.default_internal = Encoding::UTF_8
4
4
  source "https://rubygems.org"
5
5
  git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
- # gem "asciimath", git: "https://github.com/asciidoctor/asciimath"
7
+ gem "relaton", git: "https://github.com/relaton/relaton"
8
8
 
9
9
  gemspec
10
10
 
@@ -28,7 +28,7 @@ module Asciidoctor
28
28
  def pdf_converter(node)
29
29
  return nil if node.attr("no-pdf")
30
30
 
31
- IsoDoc::Iso::PdfConvert.new(doc_extract_attributes(node))
31
+ IsoDoc::Iso::PdfConvert.new(pdf_extract_attributes(node))
32
32
  end
33
33
 
34
34
  def sts_converter(node)
@@ -1796,6 +1796,20 @@
1796
1796
  <data type="ID"/>
1797
1797
  </attribute>
1798
1798
  </optional>
1799
+ <optional>
1800
+ <attribute name="language"/>
1801
+ </optional>
1802
+ <optional>
1803
+ <attribute name="script"/>
1804
+ </optional>
1805
+ <optional>
1806
+ <attribute name="tag"/>
1807
+ </optional>
1808
+ <optional>
1809
+ <attribute name="multilingual-rendering">
1810
+ <ref name="MultilingualRenderingType"/>
1811
+ </attribute>
1812
+ </optional>
1799
1813
  <oneOrMore>
1800
1814
  <ref name="preferred"/>
1801
1815
  </oneOrMore>
@@ -159,6 +159,20 @@
159
159
  <data type="ID"/>
160
160
  </attribute>
161
161
  </optional>
162
+ <optional>
163
+ <attribute name="language"/>
164
+ </optional>
165
+ <optional>
166
+ <attribute name="script"/>
167
+ </optional>
168
+ <optional>
169
+ <attribute name="tag"/>
170
+ </optional>
171
+ <optional>
172
+ <attribute name="multilingual-rendering">
173
+ <ref name="MultilingualRenderingType"/>
174
+ </attribute>
175
+ </optional>
162
176
  <ref name="preferred"/>
163
177
  <zeroOrMore>
164
178
  <ref name="admitted"/>
@@ -976,3 +976,24 @@ span.keyword {
976
976
  .Admonition p,
977
977
  .admonition p {
978
978
  margin: 0; }
979
+
980
+ /* Collapse TOC */
981
+ .collapse-group {
982
+ display: flex;
983
+ align-items: center;
984
+ position: relative; }
985
+
986
+ .collapse-button {
987
+ position: absolute;
988
+ right: 0;
989
+ display: inline-block;
990
+ height: 20px;
991
+ width: 20px;
992
+ cursor: pointer;
993
+ background-image: url('data:image/svg+xml,<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgba(0,0,0,.54)" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"></path></svg>'); }
994
+
995
+ .collapse {
996
+ display: none; }
997
+
998
+ .expand {
999
+ transform: rotateZ(-180deg); }
@@ -692,3 +692,29 @@ span.keyword {
692
692
  .admonition p {
693
693
  margin: 0;
694
694
  }
695
+
696
+ /* Collapse TOC */
697
+
698
+ .collapse-group {
699
+ display: flex;
700
+ align-items: center;
701
+ position: relative;
702
+ }
703
+
704
+ .collapse-button {
705
+ position: absolute;
706
+ right: 0;
707
+ display: inline-block;
708
+ height: 20px;
709
+ width: 20px;
710
+ cursor: pointer;
711
+ background-image: url('data:image/svg+xml,<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgba(0,0,0,.54)" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"></path></svg>');
712
+ }
713
+
714
+ .collapse {
715
+ display: none;
716
+ }
717
+
718
+ .expand {
719
+ transform: rotateZ(-180deg);
720
+ }
@@ -1004,3 +1004,24 @@ span.keyword {
1004
1004
 
1005
1005
  .Admonition p, .admonition p {
1006
1006
  margin: 0; }
1007
+
1008
+ /* Collapse TOC */
1009
+ .collapse-group {
1010
+ display: flex;
1011
+ align-items: center;
1012
+ position: relative; }
1013
+
1014
+ .collapse-button {
1015
+ position: absolute;
1016
+ right: 0;
1017
+ display: inline-block;
1018
+ height: 20px;
1019
+ width: 20px;
1020
+ cursor: pointer;
1021
+ background-image: url('data:image/svg+xml,<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgba(0,0,0,.54)" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"></path></svg>'); }
1022
+
1023
+ .collapse {
1024
+ display: none; }
1025
+
1026
+ .expand {
1027
+ transform: rotateZ(-180deg); }
@@ -709,3 +709,29 @@ font-weight: 600;
709
709
  .Admonition p, .admonition p {
710
710
  margin: 0;
711
711
  }
712
+
713
+ /* Collapse TOC */
714
+
715
+ .collapse-group {
716
+ display: flex;
717
+ align-items: center;
718
+ position: relative;
719
+ }
720
+
721
+ .collapse-button {
722
+ position: absolute;
723
+ right: 0;
724
+ display: inline-block;
725
+ height: 20px;
726
+ width: 20px;
727
+ cursor: pointer;
728
+ background-image: url('data:image/svg+xml,<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgba(0,0,0,.54)" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"></path></svg>');
729
+ }
730
+
731
+ .collapse {
732
+ display: none;
733
+ }
734
+
735
+ .expand {
736
+ transform: rotateZ(-180deg);
737
+ }
@@ -10,39 +10,98 @@ module IsoDoc
10
10
  super
11
11
  end
12
12
 
13
- def googlefonts()
14
- <<~HEAD.freeze
15
- <link href="https://fonts.googleapis.com/css?family=Space+Mono:400,400i,700,700i&display=swap" rel="stylesheet">
16
- <link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,900" rel="stylesheet">
17
- HEAD
18
- end
13
+ def googlefonts
14
+ <<~HEAD.freeze
15
+ <link href="https://fonts.googleapis.com/css?family=Space+Mono:400,400i,700,700i&display=swap" rel="stylesheet">
16
+ <link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,900" rel="stylesheet">
17
+ HEAD
18
+ end
19
19
 
20
20
  def default_fonts(options)
21
21
  {
22
- bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' :
23
- options[:alt] ? '"Lato",sans-serif' : '"Cambria",serif'),
24
- headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' :
25
- options[:alt] ? '"Lato",sans-serif' : '"Cambria",serif'),
26
- monospacefont: (options[:alt] ? '"Space Mono",monospace' :
27
- '"Courier New",monospace'),
28
- normalfontsize: "1.0em",
29
- smallerfontsize: "0.9em",
30
- footnotefontsize: "0.9em",
31
- monospacefontsize: "0.8em",
22
+ bodyfont: (if options[:script] == "Hans"
23
+ '"Source Han Sans",serif'
24
+ else
25
+ options[:alt] ? '"Lato",sans-serif' : '"Cambria",serif'
26
+ end),
27
+ headerfont: (if options[:script] == "Hans"
28
+ '"Source Han Sans",sans-serif'
29
+ else
30
+ options[:alt] ? '"Lato",sans-serif' : '"Cambria",serif'
31
+ end),
32
+ monospacefont: (if options[:alt]
33
+ '"Space Mono",monospace'
34
+ else
35
+ '"Courier New",monospace'
36
+ end),
37
+ normalfontsize: "1.0em",
38
+ smallerfontsize: "0.9em",
39
+ footnotefontsize: "0.9em",
40
+ monospacefontsize: "0.8em",
32
41
  }
33
42
  end
34
43
 
35
44
  def default_file_locations(options)
36
45
  {
37
- htmlstylesheet: (options[:alt] ? html_doc_path("style-human.scss") :
38
- html_doc_path("style-iso.scss")),
39
- htmlcoverpage: html_doc_path("html_iso_titlepage.html"),
40
- htmlintropage: html_doc_path("html_iso_intro.html"),
46
+ htmlstylesheet: (if options[:alt]
47
+ html_doc_path("style-human.scss")
48
+ else
49
+ html_doc_path("style-iso.scss")
50
+ end),
51
+ htmlcoverpage: html_doc_path("html_iso_titlepage.html"),
52
+ htmlintropage: html_doc_path("html_iso_intro.html"),
41
53
  }
42
54
  end
43
55
 
44
- def footnote_reference_format(a)
45
- a.content = a.content + ")"
56
+ def footnote_reference_format(link)
57
+ link.content += ")"
58
+ end
59
+
60
+ def html_toc_entry(level, header)
61
+ if level == "h1" && header.parent.at(".//h2[not(@class = 'TermNum')]"\
62
+ "[not(@class = 'noTOC')][text()]")
63
+ <<~HDR
64
+ <li class="#{level}"><div class="collapse-group"><a href="##{header['id']}">#{header_strip(header)}</a></li>
65
+ <div class="collapse-button"></div></div>
66
+ HDR
67
+ else
68
+ %(<li class="#{level}"><a href="##{header['id']}">\
69
+ #{header_strip(header)}</a></li>)
70
+ end
71
+ end
72
+
73
+ def html_toc(docxml)
74
+ super
75
+ docxml.xpath("//div[@id = 'toc']/ul[li[@class = 'h2']]").each do |u|
76
+ html_toc1(u)
77
+ end
78
+ docxml
79
+ end
80
+
81
+ def html_toc1(ulist)
82
+ u2 = nil
83
+ ulist.xpath("./li").each do |l|
84
+ if l["class"] != "h2"
85
+ u2 = nil
86
+ elsif u2 then u2.add_child(l.remove)
87
+ else
88
+ u2 = l.replace("<ul class='content collapse'>#{l}</ul>").first
89
+ p = u2.previous_element and p << u2
90
+ end
91
+ end
92
+ end
93
+
94
+ def inject_script(doc)
95
+ scr = <<~HEAD.freeze
96
+ <script>
97
+ $(".collapse-button").click(function () {
98
+ $(this).toggleClass('expand'); // expand: the class to change the collapse button shape
99
+ // collapse: the class to collapse/expand the li elements with the h2 class
100
+ $(this).closest('li').children(".content").toggleClass('collapse');})
101
+ </script>
102
+ HEAD
103
+ a = super.split(%r{</body>})
104
+ "#{a[0]}#{scr}</body>#{a[1]}"
46
105
  end
47
106
 
48
107
  def table_th_center(docxml)