isodoc 1.0.28 → 1.1.3.pre.alpha
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 +4 -8
- data/.github/workflows/ubuntu.yml +18 -16
- data/.github/workflows/windows.yml +4 -8
- data/Rakefile +3 -1
- data/isodoc.gemspec +2 -2
- data/lib/isodoc.rb +2 -0
- data/lib/isodoc/base_style/metanorma_word.scss +0 -1
- data/lib/isodoc/base_style/reset.scss +3 -3
- data/lib/isodoc/common.rb +0 -4
- data/lib/isodoc/convert.rb +121 -58
- data/lib/isodoc/function/blocks.rb +42 -53
- data/lib/isodoc/function/blocks_example_note.rb +108 -0
- data/lib/isodoc/function/i18n.rb +1 -0
- data/lib/isodoc/function/inline.rb +25 -8
- data/lib/isodoc/function/lists.rb +12 -6
- data/lib/isodoc/function/references.rb +31 -36
- data/lib/isodoc/function/reqt.rb +14 -5
- data/lib/isodoc/function/section.rb +7 -11
- data/lib/isodoc/function/table.rb +4 -4
- data/lib/isodoc/function/terms.rb +3 -3
- data/lib/isodoc/function/to_word_html.rb +2 -2
- data/lib/isodoc/function/utils.rb +57 -50
- data/lib/isodoc/gem_tasks.rb +110 -0
- data/lib/isodoc/headlesshtml_convert.rb +7 -6
- data/lib/isodoc/html_convert.rb +2 -1
- data/lib/isodoc/html_function/html.rb +2 -2
- data/lib/isodoc/html_function/postprocess.rb +1 -1
- data/lib/isodoc/metadata.rb +69 -63
- data/lib/isodoc/pdf_convert.rb +8 -6
- data/lib/isodoc/presentation_xml_convert.rb +29 -0
- data/lib/isodoc/sassc_importer.rb +11 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_convert.rb +2 -1
- data/lib/isodoc/word_function/body.rb +14 -48
- data/lib/isodoc/word_function/inline.rb +75 -0
- data/lib/isodoc/word_function/postprocess.rb +1 -0
- data/lib/isodoc/word_function/table.rb +3 -3
- data/lib/isodoc/xref.rb +59 -0
- data/lib/isodoc/{function → xref}/xref_anchor.rb +10 -21
- data/lib/isodoc/xref/xref_counter.rb +74 -0
- data/lib/isodoc/{function → xref}/xref_gen.rb +9 -22
- data/lib/isodoc/{function → xref}/xref_gen_seq.rb +41 -32
- data/lib/isodoc/{function → xref}/xref_sect_gen.rb +33 -23
- data/lib/isodoc/xslfo_convert.rb +16 -4
- data/spec/assets/{html.css → html.scss} +0 -0
- data/spec/assets/odf.emf +0 -0
- data/spec/assets/odf.svg +4 -0
- data/spec/assets/odf1.svg +4 -0
- data/spec/isodoc/blocks_spec.rb +216 -44
- data/spec/isodoc/footnotes_spec.rb +2 -2
- data/spec/isodoc/inline_spec.rb +208 -1
- data/spec/isodoc/lists_spec.rb +8 -8
- data/spec/isodoc/metadata_spec.rb +107 -3
- data/spec/isodoc/postproc_spec.rb +1320 -1350
- data/spec/isodoc/presentation_xml_spec.rb +20 -0
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +52 -0
- data/spec/isodoc/table_spec.rb +4 -4
- data/spec/isodoc/terms_spec.rb +7 -7
- data/spec/isodoc/xref_spec.rb +165 -45
- metadata +37 -29
- data/lib/isodoc/function/blocks_example.rb +0 -53
- data/lib/isodoc/function/xref_counter.rb +0 -50
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.3.pre.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -123,61 +123,61 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: metanorma
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 1.1.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 1.1.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rake
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: '12.0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: '12.0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: byebug
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
160
|
-
type: :
|
159
|
+
version: '9.1'
|
160
|
+
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '9.1'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: sassc
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 2.4.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 2.4.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: equivalent-xml
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -320,7 +320,7 @@ files:
|
|
320
320
|
- lib/isodoc/convert.rb
|
321
321
|
- lib/isodoc/function.rb
|
322
322
|
- lib/isodoc/function/blocks.rb
|
323
|
-
- lib/isodoc/function/
|
323
|
+
- lib/isodoc/function/blocks_example_note.rb
|
324
324
|
- lib/isodoc/function/cleanup.rb
|
325
325
|
- lib/isodoc/function/i18n.rb
|
326
326
|
- lib/isodoc/function/inline.rb
|
@@ -333,11 +333,7 @@ files:
|
|
333
333
|
- lib/isodoc/function/terms.rb
|
334
334
|
- lib/isodoc/function/to_word_html.rb
|
335
335
|
- lib/isodoc/function/utils.rb
|
336
|
-
- lib/isodoc/
|
337
|
-
- lib/isodoc/function/xref_counter.rb
|
338
|
-
- lib/isodoc/function/xref_gen.rb
|
339
|
-
- lib/isodoc/function/xref_gen_seq.rb
|
340
|
-
- lib/isodoc/function/xref_sect_gen.rb
|
336
|
+
- lib/isodoc/gem_tasks.rb
|
341
337
|
- lib/isodoc/headlesshtml_convert.rb
|
342
338
|
- lib/isodoc/html_convert.rb
|
343
339
|
- lib/isodoc/html_function.rb
|
@@ -348,22 +344,34 @@ files:
|
|
348
344
|
- lib/isodoc/metadata.rb
|
349
345
|
- lib/isodoc/metadata_date.rb
|
350
346
|
- lib/isodoc/pdf_convert.rb
|
347
|
+
- lib/isodoc/presentation_xml_convert.rb
|
348
|
+
- lib/isodoc/sassc_importer.rb
|
351
349
|
- lib/isodoc/version.rb
|
352
350
|
- lib/isodoc/word_convert.rb
|
353
351
|
- lib/isodoc/word_function.rb
|
354
352
|
- lib/isodoc/word_function/body.rb
|
355
353
|
- lib/isodoc/word_function/comments.rb
|
356
354
|
- lib/isodoc/word_function/footnotes.rb
|
355
|
+
- lib/isodoc/word_function/inline.rb
|
357
356
|
- lib/isodoc/word_function/postprocess.rb
|
358
357
|
- lib/isodoc/word_function/postprocess_cover.rb
|
359
358
|
- lib/isodoc/word_function/table.rb
|
359
|
+
- lib/isodoc/xref.rb
|
360
|
+
- lib/isodoc/xref/xref_anchor.rb
|
361
|
+
- lib/isodoc/xref/xref_counter.rb
|
362
|
+
- lib/isodoc/xref/xref_gen.rb
|
363
|
+
- lib/isodoc/xref/xref_gen_seq.rb
|
364
|
+
- lib/isodoc/xref/xref_sect_gen.rb
|
360
365
|
- lib/isodoc/xslfo_convert.rb
|
361
366
|
- spec/assets/header.html
|
362
|
-
- spec/assets/html.
|
367
|
+
- spec/assets/html.scss
|
363
368
|
- spec/assets/htmlcover.html
|
364
369
|
- spec/assets/htmlintro.html
|
365
370
|
- spec/assets/i18n.yaml
|
366
371
|
- spec/assets/iso.xml
|
372
|
+
- spec/assets/odf.emf
|
373
|
+
- spec/assets/odf.svg
|
374
|
+
- spec/assets/odf1.svg
|
367
375
|
- spec/assets/rice_image1
|
368
376
|
- spec/assets/rice_image1.png
|
369
377
|
- spec/assets/scripts.html
|
@@ -379,6 +387,7 @@ files:
|
|
379
387
|
- spec/isodoc/lists_spec.rb
|
380
388
|
- spec/isodoc/metadata_spec.rb
|
381
389
|
- spec/isodoc/postproc_spec.rb
|
390
|
+
- spec/isodoc/presentation_xml_spec.rb
|
382
391
|
- spec/isodoc/ref_spec.rb
|
383
392
|
- spec/isodoc/section_spec.rb
|
384
393
|
- spec/isodoc/table_spec.rb
|
@@ -389,7 +398,7 @@ homepage: https://github.com/metanorma/isodoc
|
|
389
398
|
licenses:
|
390
399
|
- BSD-2-Clause
|
391
400
|
metadata: {}
|
392
|
-
post_install_message:
|
401
|
+
post_install_message:
|
393
402
|
rdoc_options: []
|
394
403
|
require_paths:
|
395
404
|
- lib
|
@@ -400,13 +409,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
400
409
|
version: 2.4.0
|
401
410
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
402
411
|
requirements:
|
403
|
-
- - "
|
412
|
+
- - ">"
|
404
413
|
- !ruby/object:Gem::Version
|
405
|
-
version:
|
414
|
+
version: 1.3.1
|
406
415
|
requirements: []
|
407
|
-
|
408
|
-
|
409
|
-
signing_key:
|
416
|
+
rubygems_version: 3.0.3
|
417
|
+
signing_key:
|
410
418
|
specification_version: 4
|
411
419
|
summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
|
412
420
|
test_files: []
|
@@ -1,53 +0,0 @@
|
|
1
|
-
module IsoDoc::Function
|
2
|
-
module Blocks
|
3
|
-
def example_label(node, div, name)
|
4
|
-
n = get_anchors[node["id"]]
|
5
|
-
div.p **{ class: "example-title" } do |p|
|
6
|
-
lbl = (n.nil? || n[:label].nil? || n[:label].empty?) ? @example_lbl :
|
7
|
-
l10n("#{@example_lbl} #{n[:label]}")
|
8
|
-
p << lbl
|
9
|
-
name and !lbl.nil? and p << " — "
|
10
|
-
name and name.children.each { |n| parse(n, div) }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
EXAMPLE_TBL_ATTR =
|
15
|
-
{ class: "example_label", style: "width:82.8pt;padding:0 0 0 0;\
|
16
|
-
margin-left:0pt;vertical-align:top;" }.freeze
|
17
|
-
|
18
|
-
# used if we are boxing examples
|
19
|
-
def example_div_parse(node, out)
|
20
|
-
out.div **attr_code(id: node["id"], class: "example") do |div|
|
21
|
-
example_label(node, div, node.at(ns("./name")))
|
22
|
-
node.children.each do |n|
|
23
|
-
parse(n, div) unless n.name == "name"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def example_table_attr(node)
|
29
|
-
attr_code(id: node["id"], class: "example",
|
30
|
-
style: "border-collapse:collapse;border-spacing:0;" )
|
31
|
-
end
|
32
|
-
|
33
|
-
EXAMPLE_TD_ATTR =
|
34
|
-
{ style: "vertical-align:top;padding:0;", class: "example" }.freeze
|
35
|
-
|
36
|
-
def example_table_parse(node, out)
|
37
|
-
out.table **example_table_attr(node) do |t|
|
38
|
-
t.tr do |tr|
|
39
|
-
tr.td **EXAMPLE_TBL_ATTR do |td|
|
40
|
-
example_label(node, td, node.at(ns("./name")))
|
41
|
-
end
|
42
|
-
tr.td **EXAMPLE_TD_ATTR do |td|
|
43
|
-
node.children.each { |n| parse(n, td) unless n.name == "name" }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def example_parse(node, out)
|
50
|
-
example_div_parse(node, out)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require "roman-numerals"
|
2
|
-
|
3
|
-
module IsoDoc::Function
|
4
|
-
module XrefGen
|
5
|
-
def hiersep
|
6
|
-
"."
|
7
|
-
end
|
8
|
-
|
9
|
-
def hierfigsep
|
10
|
-
"-"
|
11
|
-
end
|
12
|
-
|
13
|
-
class Counter
|
14
|
-
def initialize
|
15
|
-
@num = 0
|
16
|
-
@letter = ""
|
17
|
-
@subseq = ""
|
18
|
-
end
|
19
|
-
|
20
|
-
def increment(node)
|
21
|
-
return self if node["unnumbered"]
|
22
|
-
if node["subsequence"] != @subseq
|
23
|
-
@subseq = node["subsequence"]
|
24
|
-
@num += 1
|
25
|
-
@letter = node["subsequence"] ? "a" : ""
|
26
|
-
else
|
27
|
-
if @letter.empty?
|
28
|
-
@num += 1
|
29
|
-
else
|
30
|
-
@letter = (@letter.ord + 1).chr.to_s
|
31
|
-
end
|
32
|
-
end
|
33
|
-
self
|
34
|
-
end
|
35
|
-
|
36
|
-
def print
|
37
|
-
"#{@num}#{@letter}"
|
38
|
-
end
|
39
|
-
|
40
|
-
def listlabel(depth)
|
41
|
-
return @num.to_s if [2, 7].include? depth
|
42
|
-
return (96 + @num).chr.to_s if [1, 6].include? depth
|
43
|
-
return (64 + @num).chr.to_s if [4, 9].include? depth
|
44
|
-
return RomanNumerals.to_roman(@num).downcase if [3, 8].include? depth
|
45
|
-
return RomanNumerals.to_roman(@num).upcase if [5, 10].include? depth
|
46
|
-
return @num.to_s
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|