metanorma-standoc 2.0.0 → 2.0.1
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/Gemfile +0 -1
- data/lib/isodoc/html/htmlstyle.css +25 -19
- data/lib/isodoc/html/htmlstyle.scss +7 -2
- data/lib/metanorma/standoc/base.rb +14 -0
- data/lib/metanorma/standoc/cleanup.rb +12 -1
- data/lib/metanorma/standoc/converter.rb +1 -0
- data/lib/metanorma/standoc/macros_terms.rb +13 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/spec/metanorma/base_spec.rb +440 -413
- data/spec/metanorma/cleanup_terms_spec.rb +203 -203
- data/spec/metanorma/macros_spec.rb +2 -0
- data/spec/metanorma/refs_spec.rb +101 -6
- data/spec/vcr_cassettes/hide_refs.yml +599 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5ab9cbdae658ec4088c0670d2ce1a117799a9325dbb8b8aa24e59b44e94e24c
|
|
4
|
+
data.tar.gz: da30d4d7b276b67e2363643e8ae1296a352bc4acee0ef9f2727da00ad276b3cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8600c60d56d27820da72dbc7259db4e3a91a3e362a4cefa0a5497b545076dab93277e87c5a0368f3037249ed79b5421e92300a8847bcf7c5bdcaca2392a3eab
|
|
7
|
+
data.tar.gz: 216bdaa7621b5b722f65a7d86eabbeaf65788df7f135927d04044838c6db31d50999155de829df6e57f5563a4f201121f36cde9c9c023a9af546019ab65d848e
|
data/Gemfile
CHANGED
|
@@ -243,59 +243,65 @@ body {
|
|
|
243
243
|
/*
|
|
244
244
|
2. Responsive navigation layout
|
|
245
245
|
*/
|
|
246
|
-
#toc {
|
|
246
|
+
#toc, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
247
247
|
font-family: {{bodyfont}};
|
|
248
248
|
font-weight: 400; }
|
|
249
|
-
#toc ul {
|
|
249
|
+
#toc ul, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) ul {
|
|
250
250
|
margin: 0;
|
|
251
251
|
padding: 0;
|
|
252
252
|
list-style: none; }
|
|
253
|
-
#toc ul li a {
|
|
253
|
+
#toc ul li a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) ul li a {
|
|
254
254
|
padding: 5px 10px; }
|
|
255
|
-
#toc ul a {
|
|
255
|
+
#toc ul a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a {
|
|
256
256
|
color: #485094;
|
|
257
257
|
text-decoration: none;
|
|
258
258
|
display: block; }
|
|
259
|
-
#toc ul a:hover {
|
|
259
|
+
#toc ul a:hover, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a:hover {
|
|
260
260
|
box-shadow: none;
|
|
261
261
|
color: #485094; }
|
|
262
|
-
#toc .h2 {
|
|
262
|
+
#toc .h2, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .h2 {
|
|
263
263
|
padding-left: 30px; }
|
|
264
|
-
#toc .h3 {
|
|
264
|
+
#toc .h3, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .h3 {
|
|
265
265
|
padding-left: 50px; }
|
|
266
|
-
#toc .toc-active, #toc li:hover {
|
|
266
|
+
#toc .toc-active, #toc li:hover, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
|
|
267
267
|
background: #C70039;
|
|
268
268
|
box-shadow: inset -5px 0px 10px -5px #C70039 !important; }
|
|
269
|
-
#toc .toc-active a, #toc li:hover a {
|
|
269
|
+
#toc .toc-active a, #toc li:hover a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
|
|
270
270
|
color: #485094; }
|
|
271
271
|
@media print {
|
|
272
|
-
#toc .toc-active, #toc li:hover {
|
|
272
|
+
#toc .toc-active, #toc li:hover, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
|
|
273
273
|
background: white;
|
|
274
274
|
box-shadow: none !important; }
|
|
275
|
-
#toc .toc-active a {
|
|
275
|
+
#toc .toc-active a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a {
|
|
276
276
|
color: #485094; }
|
|
277
|
-
#toc li:hover a {
|
|
277
|
+
#toc li:hover a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
|
|
278
278
|
color: black; } }
|
|
279
279
|
@media screen and (max-width: 768px) {
|
|
280
|
-
#toc {
|
|
280
|
+
#toc, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
281
281
|
padding: 0 1.5em;
|
|
282
282
|
overflow: visible; } }
|
|
283
|
-
#toc .toc-active a {
|
|
283
|
+
#toc .toc-active a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a {
|
|
284
284
|
color: white; }
|
|
285
285
|
#toc .toc-active,
|
|
286
|
-
#toc li:hover
|
|
286
|
+
#toc li:hover, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active,
|
|
287
|
+
#toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
|
|
287
288
|
box-shadow: none !important; }
|
|
288
289
|
#toc .toc-active a,
|
|
289
|
-
#toc li:hover a
|
|
290
|
+
#toc li:hover a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a,
|
|
291
|
+
#toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
|
|
290
292
|
color: white;
|
|
291
293
|
background: none;
|
|
292
294
|
box-shadow: none; }
|
|
293
|
-
#toc li a {
|
|
295
|
+
#toc li a, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) li a {
|
|
294
296
|
text-transform: uppercase; }
|
|
295
|
-
#toc ul a:hover {
|
|
297
|
+
#toc ul a:hover, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a:hover {
|
|
296
298
|
box-shadow: none;
|
|
297
299
|
color: white; }
|
|
298
300
|
|
|
301
|
+
#toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
302
|
+
margin-top: 0;
|
|
303
|
+
margin-bottom: 0; }
|
|
304
|
+
|
|
299
305
|
@media screen and (min-width: 768px) {
|
|
300
306
|
nav {
|
|
301
307
|
position: fixed;
|
|
@@ -349,7 +355,7 @@ body {
|
|
|
349
355
|
display: none; }
|
|
350
356
|
h1.toc-contents {
|
|
351
357
|
margin-top: 1em; }
|
|
352
|
-
ul#toc-list {
|
|
358
|
+
ul#toc-list, ul#toc-list > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
353
359
|
padding: 0;
|
|
354
360
|
margin: 0; } }
|
|
355
361
|
|
|
@@ -48,7 +48,7 @@ body {
|
|
|
48
48
|
2. Responsive navigation layout
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
#toc {
|
|
51
|
+
#toc, #toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
52
52
|
@include toc(#485094, #C70039, #485094);
|
|
53
53
|
@include sidebarToc();
|
|
54
54
|
|
|
@@ -79,6 +79,11 @@ body {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
#toc > ul > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
83
|
+
margin-top: 0;
|
|
84
|
+
margin-bottom: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
82
87
|
nav {
|
|
83
88
|
@include sidebarNav(#f7f7f7, 323px, 45px);
|
|
84
89
|
}
|
|
@@ -100,7 +105,7 @@ nav {
|
|
|
100
105
|
margin-top: 1em;
|
|
101
106
|
}
|
|
102
107
|
|
|
103
|
-
ul#toc-list {
|
|
108
|
+
ul#toc-list, ul#toc-list > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
|
|
104
109
|
padding: 0;
|
|
105
110
|
margin: 0;
|
|
106
111
|
}
|
|
@@ -66,6 +66,7 @@ module Metanorma
|
|
|
66
66
|
@htmltoclevels = node.attr("htmltoclevels")
|
|
67
67
|
@doctoclevels = node.attr("doctoclevels")
|
|
68
68
|
@toclevels = node.attr("toclevels")
|
|
69
|
+
@metadata_attrs = metadata_attrs(node)
|
|
69
70
|
end
|
|
70
71
|
|
|
71
72
|
def document(node)
|
|
@@ -135,6 +136,19 @@ module Metanorma
|
|
|
135
136
|
end
|
|
136
137
|
end
|
|
137
138
|
|
|
139
|
+
def metadata_attrs(node)
|
|
140
|
+
node.attributes.each_with_object([]) do |(k, v), ret|
|
|
141
|
+
%w(presentation semantic).each do |t|
|
|
142
|
+
next unless /^#{t}-metadata-/.match?(k)
|
|
143
|
+
|
|
144
|
+
k = k.sub(/^#{t}-metadata-/, "")
|
|
145
|
+
csv_split(v, ",")&.each do |c|
|
|
146
|
+
ret << "<#{t}-metadata><#{k}>#{c}</#{k}></#{t}-metadata>"
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end.join
|
|
150
|
+
end
|
|
151
|
+
|
|
138
152
|
private
|
|
139
153
|
|
|
140
154
|
def outputdir(node)
|
|
@@ -63,6 +63,7 @@ module Metanorma
|
|
|
63
63
|
svgmap_cleanup(xmldoc)
|
|
64
64
|
boilerplate_cleanup(xmldoc)
|
|
65
65
|
toc_cleanup(xmldoc)
|
|
66
|
+
metadata_cleanup(xmldoc)
|
|
66
67
|
smartquotes_cleanup(xmldoc)
|
|
67
68
|
variant_cleanup(xmldoc)
|
|
68
69
|
para_cleanup(xmldoc)
|
|
@@ -135,12 +136,22 @@ module Metanorma
|
|
|
135
136
|
|
|
136
137
|
def variant_space_cleanup(xmldoc)
|
|
137
138
|
xmldoc.xpath("//*[variant]").each do |c|
|
|
138
|
-
if c
|
|
139
|
+
next if c.next.nil? || c.next.next.nil?
|
|
140
|
+
|
|
141
|
+
if c.next.text? && c.next.next.name == "variant"
|
|
139
142
|
c.next.text.gsub(/\s/, "").empty? and
|
|
140
143
|
c.next.remove
|
|
141
144
|
end
|
|
142
145
|
end
|
|
143
146
|
end
|
|
147
|
+
|
|
148
|
+
def metadata_cleanup(xmldoc)
|
|
149
|
+
return if @metadata_attrs.nil? || @metadata_attrs.empty?
|
|
150
|
+
|
|
151
|
+
ins = xmldoc.at("//misc-container") ||
|
|
152
|
+
xmldoc.at("//bibdata").after("<misc-container/>").next_element
|
|
153
|
+
ins << @metadata_attrs
|
|
154
|
+
end
|
|
144
155
|
end
|
|
145
156
|
end
|
|
146
157
|
end
|
|
@@ -30,6 +30,7 @@ module Metanorma
|
|
|
30
30
|
preprocessor Metanorma::Plugin::Lutaml::LutamlUmlDatamodelDescriptionPreprocessor
|
|
31
31
|
inline_macro Metanorma::Standoc::PreferredTermInlineMacro
|
|
32
32
|
inline_macro Metanorma::Standoc::AltTermInlineMacro
|
|
33
|
+
inline_macro Metanorma::Standoc::AdmittedTermInlineMacro
|
|
33
34
|
inline_macro Metanorma::Standoc::DeprecatedTermInlineMacro
|
|
34
35
|
inline_macro Metanorma::Standoc::RelatedTermInlineMacro
|
|
35
36
|
inline_macro Metanorma::Standoc::DomainTermInlineMacro
|
|
@@ -27,6 +27,19 @@ module Metanorma
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
class AdmittedTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
|
31
|
+
use_dsl
|
|
32
|
+
named :admitted
|
|
33
|
+
parse_content_as :text
|
|
34
|
+
using_format :short
|
|
35
|
+
|
|
36
|
+
def process(parent, _target, attrs)
|
|
37
|
+
out = Asciidoctor::Inline.new(parent, :quoted,
|
|
38
|
+
attrs["text"]).convert
|
|
39
|
+
%{<admitted><expression><name>#{out}</name></expression></admitted>}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
30
43
|
class DeprecatedTermInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
|
31
44
|
use_dsl
|
|
32
45
|
named :deprecated
|