isodoc 2.1.0.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/isodoc.gemspec +6 -3
  3. data/lib/isodoc/base_style/blocks.scss +7 -0
  4. data/lib/isodoc/class_utils.rb +1 -1
  5. data/lib/isodoc/function/blocks.rb +1 -1
  6. data/lib/isodoc/function/cleanup.rb +1 -1
  7. data/lib/isodoc/function/inline.rb +4 -2
  8. data/lib/isodoc/function/lists.rb +24 -9
  9. data/lib/isodoc/function/table.rb +1 -1
  10. data/lib/isodoc/function/to_word_html.rb +3 -2
  11. data/lib/isodoc/function/utils.rb +18 -8
  12. data/lib/isodoc/gem_tasks.rb +19 -10
  13. data/lib/isodoc/html_function/html.rb +2 -2
  14. data/lib/isodoc/i18n.rb +19 -0
  15. data/lib/isodoc/metadata.rb +2 -2
  16. data/lib/isodoc/presentation_function/block.rb +3 -3
  17. data/lib/isodoc/presentation_function/image.rb +1 -1
  18. data/lib/isodoc/presentation_function/inline.rb +13 -6
  19. data/lib/isodoc/presentation_function/section.rb +3 -1
  20. data/lib/isodoc/presentation_function/xrefs.rb +22 -6
  21. data/lib/isodoc/presentation_xml_convert.rb +1 -0
  22. data/lib/isodoc/version.rb +1 -1
  23. data/lib/isodoc/word_function/body.rb +9 -6
  24. data/lib/isodoc/word_function/postprocess.rb +1 -1
  25. data/lib/isodoc/word_function/postprocess_cover.rb +5 -5
  26. data/lib/isodoc/xref/xref_gen.rb +4 -4
  27. metadata +5 -66
  28. data/.github/workflows/rake.yml +0 -15
  29. data/.github/workflows/release.yml +0 -24
  30. data/.hound.yml +0 -5
  31. data/.oss-guides.rubocop.yml +0 -1077
  32. data/.rubocop.yml +0 -10
  33. data/Rakefile +0 -8
  34. data/bin/rspec +0 -17
  35. data/spec/assets/header.html +0 -7
  36. data/spec/assets/html.scss +0 -20
  37. data/spec/assets/html_override.css +0 -1
  38. data/spec/assets/htmlcover.html +0 -4
  39. data/spec/assets/htmlintro.html +0 -5
  40. data/spec/assets/i18n.yaml +0 -41
  41. data/spec/assets/iso.xml +0 -8
  42. data/spec/assets/odf.emf +0 -0
  43. data/spec/assets/odf.svg +0 -1
  44. data/spec/assets/odf1.svg +0 -4
  45. data/spec/assets/outputtest/a.xml +0 -66
  46. data/spec/assets/outputtest/iso.international-standard.xsl +0 -3011
  47. data/spec/assets/rice_image1 +0 -0
  48. data/spec/assets/rice_image1.png +0 -0
  49. data/spec/assets/scripts.html +0 -3
  50. data/spec/assets/scripts_override.html +0 -3
  51. data/spec/assets/std.css +0 -2
  52. data/spec/assets/word.css +0 -2
  53. data/spec/assets/word_override.css +0 -1
  54. data/spec/assets/wordcover.html +0 -3
  55. data/spec/assets/wordintro.html +0 -4
  56. data/spec/isodoc/blocks_spec.rb +0 -2934
  57. data/spec/isodoc/cleanup_spec.rb +0 -1056
  58. data/spec/isodoc/footnotes_spec.rb +0 -264
  59. data/spec/isodoc/form_spec.rb +0 -160
  60. data/spec/isodoc/i18n_spec.rb +0 -1201
  61. data/spec/isodoc/inline_spec.rb +0 -2301
  62. data/spec/isodoc/lists_spec.rb +0 -469
  63. data/spec/isodoc/metadata_spec.rb +0 -401
  64. data/spec/isodoc/postproc_spec.rb +0 -2941
  65. data/spec/isodoc/presentation_xml_spec.rb +0 -1476
  66. data/spec/isodoc/ref_spec.rb +0 -955
  67. data/spec/isodoc/section_spec.rb +0 -2123
  68. data/spec/isodoc/table_spec.rb +0 -588
  69. data/spec/isodoc/terms_spec.rb +0 -712
  70. data/spec/isodoc/utils_spec.rb +0 -57
  71. data/spec/isodoc/xref_numbering_spec.rb +0 -378
  72. data/spec/isodoc/xref_spec.rb +0 -1837
  73. data/spec/isodoc/xslfo_convert_spec.rb +0 -103
  74. data/spec/spec_helper.rb +0 -81
@@ -1,103 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe IsoDoc do
4
- it "test default pdf_options" do
5
- convert = IsoDoc::XslfoPdfConvert.new(
6
- {
7
- datauriimage: false,
8
- },
9
- )
10
-
11
- expect(convert.pdf_options(nil)).to eq({ "--syntax-highlight": nil })
12
- end
13
-
14
- it "test default pdf_options for nil font_manifest_file" do
15
- convert = IsoDoc::XslfoPdfConvert.new(
16
- {
17
- datauriimage: false,
18
- IsoDoc::XslfoPdfConvert::MN_OPTIONS_KEY => {
19
- IsoDoc::XslfoPdfConvert::MN2PDF_FONT_MANIFEST => nil,
20
- },
21
- },
22
- )
23
-
24
- expect(convert.pdf_options(nil)).to eq({ "--syntax-highlight": nil })
25
- end
26
-
27
- it "test --font-manifest pdf_options" do
28
- mn2pdf_opts = {
29
- "--syntax-highlight": nil,
30
- font_manifest: "/tmp/manifest.yml",
31
- }
32
- convert = IsoDoc::XslfoPdfConvert.new(
33
- {
34
- datauriimage: false,
35
- IsoDoc::XslfoPdfConvert::MN_OPTIONS_KEY => mn2pdf_opts,
36
- },
37
- )
38
-
39
- expect(convert.pdf_options(nil)).to eq(mn2pdf_opts)
40
- end
41
-
42
- it "test --param align-cross-elements pdf_options" do
43
- convert = IsoDoc::XslfoPdfConvert.new(
44
- {
45
- datauriimage: false,
46
- aligncrosselements: "clause table note",
47
- },
48
- )
49
-
50
- expect(convert.pdf_options(nil))
51
- .to eq({ "--param align-cross-elements=" => "clause table note",
52
- "--syntax-highlight": nil })
53
- end
54
-
55
- it "test --baseassetpath pdf_options" do
56
- convert = IsoDoc::XslfoPdfConvert.new(
57
- {
58
- datauriimage: false,
59
- baseassetpath: "ABC",
60
- },
61
- )
62
-
63
- expect(convert.pdf_options(nil))
64
- .to eq({ "--param baseassetpath=" => "ABC",
65
- "--syntax-highlight": nil })
66
- end
67
-
68
- it "test pdf encryption options" do
69
- convert = IsoDoc::XslfoPdfConvert.new(
70
- {
71
- pdfencryptionlength: "a",
72
- pdfownerpassword: "b",
73
- pdfuserpassword: "c",
74
- pdfallowprint: "d",
75
- pdfallowcopycontent: "e",
76
- pdfalloweditcontent: "f",
77
- pdfalloweditannotations: "g",
78
- pdfallowfillinforms: "h",
79
- pdfallowaccesscontent: "i",
80
- pdfallowassembledocument: "j",
81
- pdfallowprinthq: "k",
82
- pdfencryptmetadata: "l",
83
- },
84
- )
85
-
86
- expect(convert.pdf_options(nil))
87
- .to eq({
88
- "--allow-access-content" => "i",
89
- "--allow-assemble-document" => "j",
90
- "--allow-copy-content" => "e",
91
- "--allow-edit-annotations" => "g",
92
- "--allow-edit-content" => "f",
93
- "--allow-fill-in-forms" => "h",
94
- "--allow-print" => "d",
95
- "--allow-print-hq" => "k",
96
- "--encrypt-metadata" => "l",
97
- "--encryption-length" => "a",
98
- "--owner-password" => "b",
99
- :"--syntax-highlight" => nil,
100
- "--user-password" => "c",
101
- })
102
- end
103
- end
data/spec/spec_helper.rb DELETED
@@ -1,81 +0,0 @@
1
- require "simplecov"
2
- SimpleCov.start do
3
- add_filter "/spec/"
4
- end
5
-
6
- require "bundler/setup"
7
- require "isodoc"
8
- require "rspec/matchers"
9
- require "equivalent-xml"
10
- require "rexml/document"
11
-
12
- RSpec.configure do |config|
13
- # Enable flags like --only-failures and --next-failure
14
- config.example_status_persistence_file_path = ".rspec_status"
15
-
16
- # Disable RSpec exposing methods globally on `Module` and `main`
17
- config.disable_monkey_patching!
18
-
19
- config.expect_with :rspec do |c|
20
- c.syntax = :expect
21
- end
22
- end
23
-
24
- def xmlpp(xml)
25
- s = ""
26
- f = REXML::Formatters::Pretty.new(2)
27
- f.compact = true
28
- f.write(REXML::Document.new(xml), s)
29
- s
30
- end
31
-
32
- def metadata(hash)
33
- Hash[hash.sort].delete_if do |_k, v|
34
- v.nil? || (v.respond_to?(:empty?) && v.empty?)
35
- end
36
- end
37
-
38
- def strip_guid(xml)
39
- xml.gsub(%r{ id="_[^"]+"}, ' id="_"')
40
- .gsub(%r{ target="_[^"]+"}, ' target="_"')
41
- .gsub(%r( href="#[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{13}"), ' href="#_"')
42
- .gsub(%r( id="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{13}"), ' id="_"')
43
- .gsub(%r( id="ftn[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{13}"), ' id="ftn_"')
44
- .gsub(%r( id="fn:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{13}"), ' id="fn:_"')
45
- .gsub(%r[ src="([^/]+)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.], ' src="\\1/_.')
46
- end
47
-
48
- HTML_HDR = <<~HEADER.freeze
49
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
50
- <head/>
51
- <body lang="en">
52
- <div class="title-section">
53
- <p>&#160;</p>
54
- </div>
55
- <br/>
56
- <div class="prefatory-section">
57
- <p>&#160;</p>
58
- </div>
59
- <br/>
60
- <div class="main-section">
61
- HEADER
62
-
63
- WORD_HDR = <<~HEADER.freeze
64
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
65
- <head>
66
- <style>
67
- <!--
68
- -->
69
- </style>
70
- </head>
71
- <body lang="EN-US" link="blue" vlink="#954F72">
72
- <div class="WordSection1">
73
- <p>&#160;</p>
74
- </div>
75
- <p><br clear="all" class="section"/></p>
76
- <div class="WordSection2">
77
- <p>&#160;</p>
78
- </div>
79
- <p><br clear="all" class="section"/></p>
80
- <div class="WordSection3">
81
- HEADER