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 +4 -4
- data/Gemfile +1 -1
- data/lib/asciidoctor/iso/base.rb +1 -1
- data/lib/asciidoctor/iso/isodoc.rng +14 -0
- data/lib/asciidoctor/iso/isostandard.rng +14 -0
- data/lib/isodoc/iso/html/style-human.css +21 -0
- data/lib/isodoc/iso/html/style-human.scss +26 -0
- data/lib/isodoc/iso/html/style-iso.css +21 -0
- data/lib/isodoc/iso/html/style-iso.scss +26 -0
- data/lib/isodoc/iso/html_convert.rb +81 -22
- data/lib/isodoc/iso/iso.amendment.xsl +255 -103
- data/lib/isodoc/iso/iso.international-standard.xsl +255 -103
- data/lib/isodoc/iso/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/iso/word_convert.rb +0 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/postproc_spec.rb +111 -28
- data/spec/isodoc/terms_spec.rb +13 -20
- data/spec/vcr_cassettes/docrels.yml +70 -70
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abbf367b7ec988ab0de353fe50309648657bc86b3d7a1495c4ac6722b4653b5b
|
4
|
+
data.tar.gz: 365546239553eb27bb0dcdc1e4920234922b93dcb235027f42f7f1a682f3fd18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
7
|
+
gem "relaton", git: "https://github.com/relaton/relaton"
|
8
8
|
|
9
9
|
gemspec
|
10
10
|
|
data/lib/asciidoctor/iso/base.rb
CHANGED
@@ -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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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"
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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]
|
38
|
-
|
39
|
-
|
40
|
-
|
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(
|
45
|
-
|
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)
|