isodoc 1.0.25 → 1.1.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +12 -2
  3. data/.github/workflows/ubuntu.yml +15 -3
  4. data/.github/workflows/windows.yml +12 -2
  5. data/isodoc.gemspec +2 -2
  6. data/lib/isodoc.rb +2 -0
  7. data/lib/isodoc/common.rb +0 -4
  8. data/lib/isodoc/convert.rb +18 -8
  9. data/lib/isodoc/function/blocks.rb +46 -52
  10. data/lib/isodoc/function/blocks_example_note.rb +108 -0
  11. data/lib/isodoc/function/cleanup.rb +14 -2
  12. data/lib/isodoc/function/i18n.rb +1 -0
  13. data/lib/isodoc/function/inline.rb +76 -82
  14. data/lib/isodoc/function/inline_simple.rb +72 -0
  15. data/lib/isodoc/function/lists.rb +12 -6
  16. data/lib/isodoc/function/references.rb +49 -53
  17. data/lib/isodoc/function/reqt.rb +14 -5
  18. data/lib/isodoc/function/section.rb +10 -12
  19. data/lib/isodoc/function/table.rb +4 -5
  20. data/lib/isodoc/function/terms.rb +3 -3
  21. data/lib/isodoc/function/to_word_html.rb +22 -12
  22. data/lib/isodoc/function/utils.rb +9 -3
  23. data/lib/isodoc/headlesshtml_convert.rb +12 -6
  24. data/lib/isodoc/html_convert.rb +7 -1
  25. data/lib/isodoc/html_function/footnotes.rb +1 -1
  26. data/lib/isodoc/html_function/html.rb +16 -1
  27. data/lib/isodoc/html_function/postprocess.rb +6 -5
  28. data/lib/isodoc/metadata.rb +6 -0
  29. data/lib/isodoc/metadata_date.rb +19 -7
  30. data/lib/isodoc/pdf_convert.rb +13 -6
  31. data/lib/isodoc/presentation_xml_convert.rb +29 -0
  32. data/lib/isodoc/version.rb +1 -1
  33. data/lib/isodoc/word_convert.rb +7 -1
  34. data/lib/isodoc/word_function/body.rb +14 -48
  35. data/lib/isodoc/word_function/footnotes.rb +1 -1
  36. data/lib/isodoc/word_function/inline.rb +75 -0
  37. data/lib/isodoc/word_function/postprocess.rb +1 -0
  38. data/lib/isodoc/word_function/table.rb +3 -3
  39. data/lib/isodoc/xref.rb +59 -0
  40. data/lib/isodoc/{function → xref}/xref_anchor.rb +10 -21
  41. data/lib/isodoc/xref/xref_counter.rb +74 -0
  42. data/lib/isodoc/{function → xref}/xref_gen.rb +11 -23
  43. data/lib/isodoc/{function → xref}/xref_gen_seq.rb +41 -32
  44. data/lib/isodoc/{function → xref}/xref_sect_gen.rb +54 -40
  45. data/lib/isodoc/xslfo_convert.rb +21 -4
  46. data/spec/assets/i18n.yaml +4 -1
  47. data/spec/assets/odf.emf +0 -0
  48. data/spec/assets/odf.svg +4 -0
  49. data/spec/assets/odf1.svg +4 -0
  50. data/spec/isodoc/blocks_spec.rb +271 -48
  51. data/spec/isodoc/cleanup_spec.rb +139 -17
  52. data/spec/isodoc/footnotes_spec.rb +20 -5
  53. data/spec/isodoc/i18n_spec.rb +8 -8
  54. data/spec/isodoc/inline_spec.rb +299 -4
  55. data/spec/isodoc/lists_spec.rb +8 -8
  56. data/spec/isodoc/metadata_spec.rb +110 -3
  57. data/spec/isodoc/postproc_spec.rb +10 -14
  58. data/spec/isodoc/presentation_xml_spec.rb +20 -0
  59. data/spec/isodoc/ref_spec.rb +121 -52
  60. data/spec/isodoc/section_spec.rb +232 -208
  61. data/spec/isodoc/table_spec.rb +28 -28
  62. data/spec/isodoc/terms_spec.rb +7 -7
  63. data/spec/isodoc/xref_spec.rb +206 -59
  64. metadata +24 -17
  65. data/lib/isodoc/function/blocks_example.rb +0 -53
  66. 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.0.25
4
+ version: 1.1.0
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-05-01 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -128,28 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 2.2.1
131
+ version: 2.4.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: 2.2.1
138
+ version: 2.4.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: metanorma
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.0.0
145
+ version: 1.1.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: 1.0.0
152
+ version: 1.1.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rake
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -320,10 +320,11 @@ files:
320
320
  - lib/isodoc/convert.rb
321
321
  - lib/isodoc/function.rb
322
322
  - lib/isodoc/function/blocks.rb
323
- - lib/isodoc/function/blocks_example.rb
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
327
+ - lib/isodoc/function/inline_simple.rb
327
328
  - lib/isodoc/function/lists.rb
328
329
  - lib/isodoc/function/references.rb
329
330
  - lib/isodoc/function/reqt.rb
@@ -332,11 +333,6 @@ files:
332
333
  - lib/isodoc/function/terms.rb
333
334
  - lib/isodoc/function/to_word_html.rb
334
335
  - lib/isodoc/function/utils.rb
335
- - lib/isodoc/function/xref_anchor.rb
336
- - lib/isodoc/function/xref_counter.rb
337
- - lib/isodoc/function/xref_gen.rb
338
- - lib/isodoc/function/xref_gen_seq.rb
339
- - lib/isodoc/function/xref_sect_gen.rb
340
336
  - lib/isodoc/headlesshtml_convert.rb
341
337
  - lib/isodoc/html_convert.rb
342
338
  - lib/isodoc/html_function.rb
@@ -347,15 +343,23 @@ files:
347
343
  - lib/isodoc/metadata.rb
348
344
  - lib/isodoc/metadata_date.rb
349
345
  - lib/isodoc/pdf_convert.rb
346
+ - lib/isodoc/presentation_xml_convert.rb
350
347
  - lib/isodoc/version.rb
351
348
  - lib/isodoc/word_convert.rb
352
349
  - lib/isodoc/word_function.rb
353
350
  - lib/isodoc/word_function/body.rb
354
351
  - lib/isodoc/word_function/comments.rb
355
352
  - lib/isodoc/word_function/footnotes.rb
353
+ - lib/isodoc/word_function/inline.rb
356
354
  - lib/isodoc/word_function/postprocess.rb
357
355
  - lib/isodoc/word_function/postprocess_cover.rb
358
356
  - lib/isodoc/word_function/table.rb
357
+ - lib/isodoc/xref.rb
358
+ - lib/isodoc/xref/xref_anchor.rb
359
+ - lib/isodoc/xref/xref_counter.rb
360
+ - lib/isodoc/xref/xref_gen.rb
361
+ - lib/isodoc/xref/xref_gen_seq.rb
362
+ - lib/isodoc/xref/xref_sect_gen.rb
359
363
  - lib/isodoc/xslfo_convert.rb
360
364
  - spec/assets/header.html
361
365
  - spec/assets/html.css
@@ -363,6 +367,9 @@ files:
363
367
  - spec/assets/htmlintro.html
364
368
  - spec/assets/i18n.yaml
365
369
  - spec/assets/iso.xml
370
+ - spec/assets/odf.emf
371
+ - spec/assets/odf.svg
372
+ - spec/assets/odf1.svg
366
373
  - spec/assets/rice_image1
367
374
  - spec/assets/rice_image1.png
368
375
  - spec/assets/scripts.html
@@ -378,6 +385,7 @@ files:
378
385
  - spec/isodoc/lists_spec.rb
379
386
  - spec/isodoc/metadata_spec.rb
380
387
  - spec/isodoc/postproc_spec.rb
388
+ - spec/isodoc/presentation_xml_spec.rb
381
389
  - spec/isodoc/ref_spec.rb
382
390
  - spec/isodoc/section_spec.rb
383
391
  - spec/isodoc/table_spec.rb
@@ -388,7 +396,7 @@ homepage: https://github.com/metanorma/isodoc
388
396
  licenses:
389
397
  - BSD-2-Clause
390
398
  metadata: {}
391
- post_install_message:
399
+ post_install_message:
392
400
  rdoc_options: []
393
401
  require_paths:
394
402
  - lib
@@ -403,9 +411,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
403
411
  - !ruby/object:Gem::Version
404
412
  version: '0'
405
413
  requirements: []
406
- rubyforge_project:
407
- rubygems_version: 2.7.6
408
- signing_key:
414
+ rubygems_version: 3.0.3
415
+ signing_key:
409
416
  specification_version: 4
410
417
  summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
411
418
  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 << "&nbsp;&mdash; "
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