isodoc 2.10.0 → 3.0.0

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/isodoc.gemspec +9 -4
  4. data/lib/isodoc/base_style/all.css +96 -0
  5. data/lib/isodoc/base_style/reset.css +96 -0
  6. data/lib/isodoc/base_style/reset.scss +75 -0
  7. data/lib/isodoc/base_style/scripts.html +45 -14
  8. data/lib/isodoc/class_utils.rb +4 -2
  9. data/lib/isodoc/convert.rb +0 -21
  10. data/lib/isodoc/css.rb +2 -4
  11. data/lib/isodoc/function/blocks.rb +37 -52
  12. data/lib/isodoc/function/blocks_example_note.rb +75 -29
  13. data/lib/isodoc/function/cleanup.rb +9 -44
  14. data/lib/isodoc/function/inline.rb +67 -13
  15. data/lib/isodoc/function/lists.rb +20 -14
  16. data/lib/isodoc/function/references.rb +9 -126
  17. data/lib/isodoc/function/reqt.rb +4 -3
  18. data/lib/isodoc/function/section.rb +30 -35
  19. data/lib/isodoc/function/section_titles.rb +22 -11
  20. data/lib/isodoc/function/table.rb +3 -3
  21. data/lib/isodoc/function/terms.rb +49 -26
  22. data/lib/isodoc/function/to_word_html.rb +46 -16
  23. data/lib/isodoc/function/utils.rb +11 -12
  24. data/lib/isodoc/gem_tasks.rb +1 -1
  25. data/lib/isodoc/html_function/footnotes.rb +2 -1
  26. data/lib/isodoc/html_function/html.rb +5 -7
  27. data/lib/isodoc/html_function/postprocess.rb +25 -6
  28. data/lib/isodoc/html_function/postprocess_cover.rb +13 -7
  29. data/lib/isodoc/html_function/postprocess_footnotes.rb +52 -47
  30. data/lib/isodoc/init.rb +31 -0
  31. data/lib/isodoc/metadata.rb +20 -13
  32. data/lib/isodoc/metadata_contributor.rb +5 -10
  33. data/lib/isodoc/metadata_date.rb +1 -1
  34. data/lib/isodoc/presentation_function/autonum.rb +153 -0
  35. data/lib/isodoc/presentation_function/bibdata.rb +4 -5
  36. data/lib/isodoc/presentation_function/block.rb +107 -40
  37. data/lib/isodoc/presentation_function/concepts.rb +184 -19
  38. data/lib/isodoc/presentation_function/docid.rb +78 -0
  39. data/lib/isodoc/presentation_function/erefs.rb +55 -31
  40. data/lib/isodoc/presentation_function/image.rb +64 -19
  41. data/lib/isodoc/presentation_function/index.rb +180 -0
  42. data/lib/isodoc/presentation_function/inline.rb +47 -16
  43. data/lib/isodoc/presentation_function/math.rb +128 -71
  44. data/lib/isodoc/presentation_function/metadata.rb +29 -66
  45. data/lib/isodoc/presentation_function/refs.rb +75 -28
  46. data/lib/isodoc/presentation_function/reqt.rb +7 -4
  47. data/lib/isodoc/presentation_function/section.rb +51 -129
  48. data/lib/isodoc/presentation_function/sourcecode.rb +52 -19
  49. data/lib/isodoc/presentation_function/terms.rb +107 -118
  50. data/lib/isodoc/presentation_function/title.rb +107 -0
  51. data/lib/isodoc/presentation_function/xrefs.rb +37 -17
  52. data/lib/isodoc/presentation_xml_convert.rb +24 -10
  53. data/lib/isodoc/version.rb +1 -1
  54. data/lib/isodoc/word_function/body.rb +9 -37
  55. data/lib/isodoc/word_function/comments.rb +0 -1
  56. data/lib/isodoc/word_function/footnotes.rb +1 -1
  57. data/lib/isodoc/word_function/lists.rb +13 -9
  58. data/lib/isodoc/word_function/postprocess.rb +6 -0
  59. data/lib/isodoc/word_function/postprocess_cover.rb +6 -4
  60. data/lib/isodoc/word_function/postprocess_table.rb +1 -1
  61. data/lib/isodoc/word_function/postprocess_toc.rb +10 -6
  62. data/lib/isodoc/word_function/table.rb +2 -2
  63. data/lib/isodoc/xref/clause_order.rb +41 -0
  64. data/lib/isodoc/xref/xref_anchor.rb +31 -16
  65. data/lib/isodoc/xref/xref_counter.rb +18 -3
  66. data/lib/isodoc/xref/xref_counter_types.rb +14 -0
  67. data/lib/isodoc/xref/xref_gen.rb +61 -37
  68. data/lib/isodoc/xref/xref_gen_seq.rb +148 -81
  69. data/lib/isodoc/xref/xref_sect_gen.rb +84 -88
  70. data/lib/isodoc/xref/xref_util.rb +53 -4
  71. data/lib/isodoc/xref.rb +29 -10
  72. data/lib/isodoc/xslfo_convert.rb +14 -9
  73. data/lib/isodoc-yaml/i18n-ar.yaml +17 -13
  74. data/lib/isodoc-yaml/i18n-de.yaml +17 -13
  75. data/lib/isodoc-yaml/i18n-en.yaml +18 -17
  76. data/lib/isodoc-yaml/i18n-es.yaml +17 -13
  77. data/lib/isodoc-yaml/i18n-fr.yaml +17 -13
  78. data/lib/isodoc-yaml/i18n-ja.yaml +56 -52
  79. data/lib/isodoc-yaml/i18n-ru.yaml +17 -16
  80. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +17 -13
  81. data/lib/nokogiri/xml/node.rb +14 -0
  82. data/lib/relaton/render-isodoc/config.yml +1 -1
  83. metadata +90 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d98a917ee770ef1034262fa29628010e3254f3ddb5d8dfe63be54c57c3d58c0
4
- data.tar.gz: 64b2107fddc44c0096653fc0319c7b0df81285327ab83600471b1b99971f3dbd
3
+ metadata.gz: 80ff8ea483a997f4ff1e6168f6c3f921b9d589ad7f855a475ae4dd82424a0793
4
+ data.tar.gz: cbb2f806aa2b7bd1d8aff9c412732a56a36619121cf27ef5fe57825037a25046
5
5
  SHA512:
6
- metadata.gz: 1b1ac5b466169fd9f2698b79617ef4d2c6dd9dbf35b0cca715102ddddfcb2a0013be3bd02153263da42a7f3cde0150ccffa4f3e16e7b750dd0f73be23420e4b1
7
- data.tar.gz: 26338d106c6e1cb5133c305c97ec5a8bb1c75292120ce2928efb93572ea6ff79b203eef4a6d73419d097cad76d6a0e22e71beac64a0f483dc09919e8d7d25e86
6
+ metadata.gz: 11bb2279603ad2b5045238fe562b233af74e5eb53fef0ec612b676cb3e7dff3ae575f7698d0294a1dd7e88ad8f47b31a5ef3bf00828fd16bde24383980841ad4
7
+ data.tar.gz: 13353c87b7fe45e8007f73b1cdfb8f9728c84001dc4d37bdee14fd27894e80e1384a738e013ccd8af750d43938b2aea136766115dbcf5e107a949a7649e46dc3
data/.rubocop.yml CHANGED
@@ -7,4 +7,4 @@ inherit_from:
7
7
  # ...
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 3.4
data/isodoc.gemspec CHANGED
@@ -26,22 +26,26 @@ Gem::Specification.new do |spec|
26
26
  f.match(%r{^(test|spec|features|bin|.github)/}) \
27
27
  || f.match(%r{Rakefile|bin/rspec})
28
28
  end
29
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
30
30
 
31
+ spec.add_dependency "base64"
32
+ spec.add_dependency "bigdecimal"
31
33
  spec.add_dependency "html2doc", "~> 1.8.1"
32
34
  # spec.add_dependency "isodoc-i18n", "~> 1.1.0" # already in relaton-render and mn-requirements
33
35
  # spec.add_dependency "relaton-cli"
34
36
  # spec.add_dependency "metanorma-utils", "~> 1.5.0" # already in isodoc-i18n
35
- spec.add_dependency "mn2pdf"
36
- spec.add_dependency "mn-requirements", "~> 0.3.4"
37
+ spec.add_dependency "mn2pdf", ">= 2.13"
38
+ spec.add_dependency "mn-requirements", "~> 0.5.0"
37
39
 
38
- spec.add_dependency "relaton-render", "~> 0.7.1"
40
+ spec.add_dependency "relaton-render", "~> 0.9.0"
39
41
  spec.add_dependency "roman-numerals"
40
42
  spec.add_dependency "rouge", "~> 4.0"
41
43
  spec.add_dependency "thread_safe"
42
44
  spec.add_dependency "twitter_cldr", ">= 6.6.0"
43
45
  spec.add_dependency "uuidtools"
46
+ spec.add_dependency "nokogiri", "<= 1.16.8"
44
47
 
48
+ spec.add_development_dependency "bigdecimal"
45
49
  spec.add_development_dependency "debug"
46
50
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
47
51
  spec.add_development_dependency "guard", "~> 2.14"
@@ -52,5 +56,6 @@ Gem::Specification.new do |spec|
52
56
  spec.add_development_dependency "sassc", "~> 2.4.0"
53
57
  spec.add_development_dependency "simplecov", "~> 0.15"
54
58
  spec.add_development_dependency "timecop", "~> 0.9"
59
+ spec.add_development_dependency "xml-c14n"
55
60
  # spec.metadata["rubygems_mfa_required"] = "true"
56
61
  end
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  html, body, div, span, applet, object, iframe,
2
3
  h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
4
  a, abbr, acronym, address, big, cite, code,
@@ -74,6 +75,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
74
75
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
75
76
  font-size: {{monospacefontsize}}; }
76
77
 
78
+ sub, sup {
79
+ font-size: 0.75em; }
80
+
77
81
  article, aside, details, figcaption, figure,
78
82
  footer, header, hgroup, menu, nav, section {
79
83
  display: block; }
@@ -169,6 +173,98 @@ table.rouge-line-table pre {
169
173
  overflow-x: visible;
170
174
  font-size: 100%; }
171
175
 
176
+ /* header § links */
177
+ a.header {
178
+ color: inherit;
179
+ text-decoration: none; }
180
+
181
+ a.header:hover {
182
+ color: #a53221 !important;
183
+ background: inherit;
184
+ box-shadow: none; }
185
+
186
+ a.header:visited {
187
+ color: inherit;
188
+ text-decoration: none; }
189
+
190
+ a.anchor {
191
+ position: absolute;
192
+ z-index: 1001;
193
+ width: 1.5ex;
194
+ margin-left: -1.5ex;
195
+ display: block;
196
+ text-decoration: none !important;
197
+ visibility: hidden;
198
+ text-align: center;
199
+ font-weight: 400; }
200
+
201
+ a.anchor::before {
202
+ content: "\00A7";
203
+ font-size: .85em;
204
+ display: block;
205
+ padding-top: .1em; }
206
+
207
+ a.anchor:hover {
208
+ color: #a53221;
209
+ background: inherit;
210
+ box-shadow: none; }
211
+
212
+ h1 > a.anchor:hover,
213
+ h2 > a.anchor:hover,
214
+ h3 > a.anchor:hover,
215
+ h4 > a.anchor:hover,
216
+ h5 > a.anchor:hover,
217
+ h6 > a.anchor:hover,
218
+ .inline-header > a.anchor:hover,
219
+ h1:hover > a.anchor,
220
+ h2:hover > a.anchor,
221
+ h3:hover > a.anchor,
222
+ h4:hover > a.anchor,
223
+ h5:hover > a.anchor,
224
+ h6:hover > a.anchor,
225
+ .inline-header:hover > a.anchor {
226
+ visibility: visible; }
227
+
228
+ /* collapsible snippets: collapsible before hidable */
229
+ .hidable {
230
+ max-height: 0;
231
+ overflow: hidden;
232
+ transition: max-height 0.2s ease-out; }
233
+
234
+ .collapsible {
235
+ background-color: #777;
236
+ color: white;
237
+ cursor: pointer;
238
+ padding: 3px 0;
239
+ margin: 0;
240
+ width: 100%;
241
+ border: none;
242
+ text-align: left;
243
+ outline: none;
244
+ font-size: 15px; }
245
+
246
+ .active, .collapsible:hover {
247
+ background-color: #555; }
248
+
249
+ .collapsible:after {
250
+ content: '\25bc';
251
+ color: white;
252
+ font-weight: bold;
253
+ float: right;
254
+ margin-left: 12px;
255
+ margin-right: 12px; }
256
+
257
+ .active:after {
258
+ content: "\25b2"; }
259
+
260
+ /* collapsible: */
261
+ .collapsible + .hidable {
262
+ margin-top: 0; }
263
+
264
+ .collapsible:not(.active) + .hidable {
265
+ overflow: hidden;
266
+ padding: 0; }
267
+
172
268
  #standard-band {
173
269
  background-color: #0AC442; }
174
270
 
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  html, body, div, span, applet, object, iframe,
2
3
  h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3
4
  a, abbr, acronym, address, big, cite, code,
@@ -74,6 +75,9 @@ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
74
75
  p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
75
76
  font-size: {{monospacefontsize}}; }
76
77
 
78
+ sub, sup {
79
+ font-size: 0.75em; }
80
+
77
81
  article, aside, details, figcaption, figure,
78
82
  footer, header, hgroup, menu, nav, section {
79
83
  display: block; }
@@ -168,3 +172,95 @@ table.rouge-line-table pre {
168
172
  padding: 0;
169
173
  overflow-x: visible;
170
174
  font-size: 100%; }
175
+
176
+ /* header § links */
177
+ a.header {
178
+ color: inherit;
179
+ text-decoration: none; }
180
+
181
+ a.header:hover {
182
+ color: #a53221 !important;
183
+ background: inherit;
184
+ box-shadow: none; }
185
+
186
+ a.header:visited {
187
+ color: inherit;
188
+ text-decoration: none; }
189
+
190
+ a.anchor {
191
+ position: absolute;
192
+ z-index: 1001;
193
+ width: 1.5ex;
194
+ margin-left: -1.5ex;
195
+ display: block;
196
+ text-decoration: none !important;
197
+ visibility: hidden;
198
+ text-align: center;
199
+ font-weight: 400; }
200
+
201
+ a.anchor::before {
202
+ content: "\00A7";
203
+ font-size: .85em;
204
+ display: block;
205
+ padding-top: .1em; }
206
+
207
+ a.anchor:hover {
208
+ color: #a53221;
209
+ background: inherit;
210
+ box-shadow: none; }
211
+
212
+ h1 > a.anchor:hover,
213
+ h2 > a.anchor:hover,
214
+ h3 > a.anchor:hover,
215
+ h4 > a.anchor:hover,
216
+ h5 > a.anchor:hover,
217
+ h6 > a.anchor:hover,
218
+ .inline-header > a.anchor:hover,
219
+ h1:hover > a.anchor,
220
+ h2:hover > a.anchor,
221
+ h3:hover > a.anchor,
222
+ h4:hover > a.anchor,
223
+ h5:hover > a.anchor,
224
+ h6:hover > a.anchor,
225
+ .inline-header:hover > a.anchor {
226
+ visibility: visible; }
227
+
228
+ /* collapsible snippets: collapsible before hidable */
229
+ .hidable {
230
+ max-height: 0;
231
+ overflow: hidden;
232
+ transition: max-height 0.2s ease-out; }
233
+
234
+ .collapsible {
235
+ background-color: #777;
236
+ color: white;
237
+ cursor: pointer;
238
+ padding: 3px 0;
239
+ margin: 0;
240
+ width: 100%;
241
+ border: none;
242
+ text-align: left;
243
+ outline: none;
244
+ font-size: 15px; }
245
+
246
+ .active, .collapsible:hover {
247
+ background-color: #555; }
248
+
249
+ .collapsible:after {
250
+ content: '\25bc';
251
+ color: white;
252
+ font-weight: bold;
253
+ float: right;
254
+ margin-left: 12px;
255
+ margin-right: 12px; }
256
+
257
+ .active:after {
258
+ content: "\25b2"; }
259
+
260
+ /* collapsible: */
261
+ .collapsible + .hidable {
262
+ margin-top: 0; }
263
+
264
+ .collapsible:not(.active) + .hidable {
265
+ overflow: hidden;
266
+ padding: 0; }
@@ -81,6 +81,10 @@ p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td sam
81
81
  font-size: $monospacefontsize;
82
82
  }
83
83
 
84
+ sub, sup {
85
+ font-size: 0.75em;
86
+ }
87
+
84
88
  article, aside, details, figcaption, figure,
85
89
  footer, header, hgroup, menu, nav, section {
86
90
  display: block;
@@ -199,3 +203,74 @@ table.rouge-line-table pre {
199
203
  overflow-x: visible;
200
204
  font-size: 100%;
201
205
  }
206
+
207
+ /* header § links */
208
+ a.header{color:inherit;text-decoration:none;}
209
+ a.header:hover{color:#a53221 !important;background:inherit;box-shadow:none;}
210
+ a.header:visited{color:inherit;text-decoration:none;}
211
+ a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
212
+ a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
213
+ a.anchor:hover{color:#a53221;background:inherit;box-shadow:none;}
214
+ h1>a.anchor:hover,
215
+ h2>a.anchor:hover,
216
+ h3>a.anchor:hover,
217
+ h4>a.anchor:hover,
218
+ h5>a.anchor:hover,
219
+ h6>a.anchor:hover,
220
+ .inline-header>a.anchor:hover,
221
+ h1:hover>a.anchor,
222
+ h2:hover>a.anchor,
223
+ h3:hover>a.anchor,
224
+ h4:hover>a.anchor,
225
+ h5:hover>a.anchor,
226
+ h6:hover>a.anchor,
227
+ .inline-header:hover>a.anchor{
228
+ visibility:visible;
229
+ }
230
+
231
+ /* collapsible snippets: collapsible before hidable */
232
+ .hidable {
233
+ max-height: 0;
234
+ overflow: hidden;
235
+ transition: max-height 0.2s ease-out;
236
+ }
237
+
238
+ .collapsible {
239
+ background-color: #777;
240
+ color: white;
241
+ cursor: pointer;
242
+ padding: 3px 0;
243
+ margin: 0;
244
+ width: 100%;
245
+ border: none;
246
+ text-align: left;
247
+ outline: none;
248
+ font-size: 15px;
249
+ }
250
+
251
+ .active, .collapsible:hover {
252
+ background-color: #555;
253
+ }
254
+
255
+ .collapsible:after {
256
+ content: '\25bc';
257
+ color: white;
258
+ font-weight: bold;
259
+ float: right;
260
+ margin-left: 12px;
261
+ margin-right: 12px;
262
+ }
263
+
264
+ .active:after {
265
+ content: "\25b2";
266
+ }
267
+
268
+ /* collapsible: */
269
+ .collapsible + .hidable {
270
+ margin-top: 0;
271
+ }
272
+
273
+ .collapsible:not(.active) + .hidable {
274
+ overflow: hidden;
275
+ padding: 0;
276
+ }
@@ -6,21 +6,34 @@
6
6
  </script>
7
7
 
8
8
  <script>
9
- //TOC toggle animation
10
- $('#toggle').on('click', function(){
11
- if( $('nav').is(':visible') ) {
12
- $('nav').animate({ 'left': '-353px' }, 'slow', function(){
13
- $('nav').hide();
9
+ //TOC toggle animation
10
+ (function() {
11
+ const jqNav = $('nav');
12
+ const jqBody = $('body');
13
+ const jqToggle = $('#toggle');
14
+ const animationSpeed = 'slow';
15
+
16
+ jqToggle.on('click', function() {
17
+ const isNavVisible = jqNav.is(':visible');
18
+ const fullNavWidth = jqNav.outerWidth();
19
+ const navLeft = isNavVisible ? '-' + fullNavWidth + 'px' : '0px';
20
+ const bodyMarginLeft = isNavVisible ? '0px' : fullNavWidth + 'px';
21
+
22
+ // Stop current animations
23
+ jqNav.stop(true, true);
24
+ jqBody.stop(true, true);
25
+
26
+ if(!isNavVisible) {
27
+ jqNav.show();
28
+ }
29
+ jqNav.animate({'left': navLeft}, animationSpeed, function() {
30
+ if(isNavVisible) {jqNav.hide()}
14
31
  });
15
- $('body').animate({ 'margin-left': '0' }, 'slow');
16
- }
17
- else {
18
- $('nav').show();
19
- $('nav').animate({ 'left': '0px' }, 'slow');
20
- $('body').animate({ 'margin-left': '298px' }, 'slow');
21
- }
22
- });
23
- </script>
32
+ jqBody.animate({'marginLeft': bodyMarginLeft}, animationSpeed);
33
+
34
+ });
35
+ })();
36
+ </script>
24
37
 
25
38
  <script>
26
39
  // Scroll to top button
@@ -185,3 +198,21 @@ $('#toggle').on('click', function(){
185
198
  anchors.add('h1, h2, h3, h4');
186
199
  </script>
187
200
 
201
+ <script>
202
+ // use .collapsible element to toggle visibility of element following it
203
+ var coll = document.getElementsByClassName("collapsible");
204
+ var i;
205
+
206
+ for (i = 0; i < coll.length; i++) {
207
+ coll[i].addEventListener("click", function() {
208
+ this.classList.toggle("active");
209
+ var content = this.nextElementSibling;
210
+ if (content.style.maxHeight){
211
+ content.style.maxHeight = null;
212
+ } else {
213
+ content.style.maxHeight = content.scrollHeight + "px";
214
+ }
215
+ });
216
+ }
217
+ </script>
218
+
@@ -66,8 +66,10 @@ module IsoDoc
66
66
  end
67
67
 
68
68
  def nearest_block_parent(node)
69
- until %w(p title td th name formula li dt dd sourcecode pre quote
70
- note example)
69
+ until %w(p fmt-title td th fmt-name formula li dt dd sourcecode pre quote
70
+ formattedref note example target clause annex term appendix
71
+ bibdata references termnote termexample term terms sourcecode
72
+ figure admonition)
71
73
  .include?(node.name)
72
74
  node = node.parent
73
75
  end
@@ -115,31 +115,10 @@ module IsoDoc
115
115
  metadata_init(@lang, @script, @locale, @i18n)
116
116
  xref_init(@lang, @script, self, @i18n,
117
117
  { locale: @locale, bibrender: @bibrender })
118
- docxml = preprocess_xslt(docxml)
119
118
  toc_init(docxml)
120
119
  [docxml, filename, dir]
121
120
  end
122
121
 
123
- def preprocess_xslt(docxml)
124
- sheets = extract_preprocess_xslt(docxml)
125
- sheets.each do |x|
126
- docxml = Nokogiri::XSLT(x).transform(docxml)
127
- end
128
- docxml
129
- rescue ::Error => e
130
- require "debug"
131
- binding.b
132
- end
133
-
134
- def extract_preprocess_xslt(docxml)
135
- docxml.xpath(ns("//metanorma-extension/render/preprocess-xslt"))
136
- .each_with_object([]) do |x, m|
137
- formats = x["format"]&.split(",") || []
138
- !formats.empty? && !formats.include?(@format.to_s) and next
139
- m << x.children.to_xml
140
- end
141
- end
142
-
143
122
  def convert_i18n_init(docxml)
144
123
  convert_i18n_init1(docxml)
145
124
  i18n_init(@lang, @script, @locale)
data/lib/isodoc/css.rb CHANGED
@@ -90,16 +90,14 @@ module IsoDoc
90
90
 
91
91
  # stripwordcss if HTML stylesheet, !stripwordcss if DOC stylesheet
92
92
  def generate_css(filename, stripwordcss)
93
- return nil if filename.nil?
94
-
93
+ filename.nil? and return nil
95
94
  filename = precompiled_style_or_original(filename)
96
95
  stylesheet = File.read(filename, encoding: "UTF-8")
97
96
  stylesheet = populate_template(stylesheet, :word)
98
97
  stylesheet.gsub!(/(\s|\{)mso-[^:]+:[^;]+;/m, "\\1") if stripwordcss
99
98
  stylesheet.gsub!(/--/, "-DOUBLE_HYPHEN_ESCAPE-") unless stripwordcss
100
- if File.extname(filename) == ".scss"
99
+ File.extname(filename) == ".scss" and
101
100
  stylesheet = convert_scss(filename, stylesheet, stripwordcss)
102
- end
103
101
  Tempfile.open([File.basename(filename, ".*"), "css"],
104
102
  mode: File::BINARY | File::SHARE_DELETE,
105
103
  encoding: "utf-8") do |f|