metanorma-iso 1.9.4 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ubuntu.yml +41 -0
- data/Gemfile +3 -4
- data/Makefile +44 -0
- data/Rakefile +1 -1
- data/bin/rspec +1 -2
- data/lib/asciidoctor/iso/basicdoc.rng +32 -5
- data/lib/asciidoctor/iso/biblio.rng +2 -0
- data/lib/asciidoctor/iso/cleanup.rb +7 -6
- data/lib/asciidoctor/iso/front.rb +9 -1
- data/lib/asciidoctor/iso/isodoc.rng +430 -76
- data/lib/asciidoctor/iso/isostandard-amd.rng +1 -1
- data/lib/asciidoctor/iso/isostandard.rng +9 -23
- data/lib/asciidoctor/iso/reqt.rng +24 -3
- data/lib/asciidoctor/iso/validate.rb +7 -7
- data/lib/asciidoctor/iso/validate_section.rb +1 -1
- data/lib/isodoc/iso/html/isodoc.css +1 -2
- data/lib/isodoc/iso/html/isodoc.scss +1 -1
- data/lib/isodoc/iso/html/wordstyle.css +16 -4
- data/lib/isodoc/iso/html/wordstyle.scss +16 -4
- data/lib/isodoc/iso/i18n.rb +10 -9
- data/lib/isodoc/iso/iso.amendment.xsl +200 -20
- data/lib/isodoc/iso/iso.international-standard.xsl +200 -20
- data/lib/isodoc/iso/presentation_xml_convert.rb +9 -10
- data/lib/isodoc/iso/sections.rb +2 -0
- data/lib/isodoc/iso/word_cleanup.rb +94 -0
- data/lib/isodoc/iso/word_convert.rb +12 -89
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -3
- data/spec/asciidoctor/base_spec.rb +685 -178
- data/spec/asciidoctor/blank_spec.rb +38 -0
- data/spec/asciidoctor/blocks_spec.rb +22 -47
- data/spec/asciidoctor/cleanup_spec.rb +34 -20
- data/spec/asciidoctor/inline_spec.rb +10 -2
- data/spec/asciidoctor/refs_spec.rb +87 -4
- data/spec/asciidoctor/section_spec.rb +3 -3
- data/spec/isodoc/i18n_spec.rb +29 -15
- data/spec/isodoc/inline_spec.rb +56 -26
- data/spec/isodoc/section_spec.rb +1 -1
- data/spec/isodoc/table_spec.rb +6 -8
- data/spec/isodoc/terms_spec.rb +11 -11
- data/spec/isodoc/xref_spec.rb +1397 -1376
- data/spec/metanorma/processor_spec.rb +4 -1
- data/spec/spec_helper.rb +14 -1
- data/spec/vcr_cassettes/docrels.yml +783 -0
- data/spec/vcr_cassettes/sortrefs.yml +599 -0
- metadata +38 -19
@@ -23,13 +23,16 @@ RSpec.describe Metanorma::Iso::Processor do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "generates IsoDoc XML from a blank document" do
|
26
|
-
|
26
|
+
input = <<~INPUT
|
27
27
|
#{ASCIIDOC_BLANK_HDR}
|
28
28
|
INPUT
|
29
|
+
output = <<~OUTPUT
|
29
30
|
#{BLANK_HDR}
|
30
31
|
<sections/>
|
31
32
|
</iso-standard>
|
32
33
|
OUTPUT
|
34
|
+
expect(xmlpp(processor.input_to_isodoc(input, nil)))
|
35
|
+
.to be_equivalent_to xmlpp(output)
|
33
36
|
end
|
34
37
|
|
35
38
|
it "generates HTML from IsoDoc XML" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
require "vcr"
|
2
|
+
|
3
|
+
VCR.configure do |config|
|
4
|
+
config.cassette_library_dir = "spec/vcr_cassettes"
|
5
|
+
config.hook_into :webmock
|
6
|
+
config.default_cassette_options = {
|
7
|
+
clean_outdated_http_interactions: true,
|
8
|
+
re_record_interval: 1512000,
|
9
|
+
record: :once,
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
1
13
|
require "simplecov"
|
2
14
|
SimpleCov.start do
|
3
15
|
add_filter "/spec/"
|
@@ -46,7 +58,8 @@ def xmlpp(xml)
|
|
46
58
|
s = ""
|
47
59
|
f = REXML::Formatters::Pretty.new(2)
|
48
60
|
f.compact = true
|
49
|
-
f.write(REXML::Document.new(xml
|
61
|
+
f.write(REXML::Document.new(xml
|
62
|
+
.gsub(%r{<fetched>20[0-9-]+</fetched>}, "<fetched/>")), s)
|
50
63
|
s
|
51
64
|
end
|
52
65
|
|