metanorma-standoc 1.11.1 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/standoc/blocks.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -20
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +25 -15
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -2
- data/lib/asciidoctor/standoc/cleanup_terms.rb +23 -19
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +31 -14
- data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +6 -6
- data/lib/asciidoctor/standoc/inline.rb +13 -11
- data/lib/asciidoctor/standoc/isodoc.rng +42 -17
- data/lib/asciidoctor/standoc/ref.rb +101 -75
- data/lib/asciidoctor/standoc/ref_date_id.rb +30 -1
- data/lib/asciidoctor/standoc/ref_sect.rb +16 -6
- data/lib/asciidoctor/standoc/reqt.rb +1 -1
- data/lib/asciidoctor/standoc/section.rb +1 -1
- data/lib/asciidoctor/standoc/validate.rb +1 -1
- data/lib/isodoc/html/htmlstyle.css +1 -1
- data/lib/isodoc/html/htmlstyle.scss +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +2 -2
- data/spec/asciidoctor/blocks_spec.rb +15 -15
- data/spec/asciidoctor/cleanup_sections_spec.rb +1 -1
- data/spec/asciidoctor/cleanup_spec.rb +4 -4
- data/spec/asciidoctor/cleanup_terms_spec.rb +248 -63
- data/spec/asciidoctor/datamodel/attributes_table_preprocessor_spec.rb +21 -21
- data/spec/asciidoctor/datamodel/diagram_preprocessor_spec.rb +16 -16
- data/spec/asciidoctor/inline_spec.rb +5 -5
- data/spec/asciidoctor/isobib_cache_spec.rb +4 -8
- data/spec/asciidoctor/macros_spec.rb +2 -2
- data/spec/asciidoctor/refs_spec.rb +842 -664
- data/spec/asciidoctor/section_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -1
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +176 -176
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -24
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +34 -34
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +11 -11
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +5 -5
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc::Datamodel::DiagramPreprocessor do
|
6
|
-
describe
|
7
|
-
context
|
6
|
+
describe "#process" do
|
7
|
+
context "when simple models without relations" do
|
8
8
|
let(:datamodel_file) do
|
9
|
-
examples_path(
|
9
|
+
examples_path("datamodel/common_models_diagram.adoc")
|
10
10
|
end
|
11
11
|
let(:result_file) do
|
12
|
-
examples_path(
|
12
|
+
examples_path("datamodel/common_models_diagram.xml")
|
13
13
|
end
|
14
14
|
let(:output) do
|
15
15
|
[
|
16
16
|
BLANK_HDR,
|
17
17
|
File.read(
|
18
|
-
fixtures_path(
|
19
|
-
)
|
18
|
+
fixtures_path("macros_datamodel/common_models_diagram.xml"),
|
19
|
+
),
|
20
20
|
].join
|
21
21
|
end
|
22
22
|
|
@@ -26,10 +26,10 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::DiagramPreprocessor do
|
|
26
26
|
FileUtils.rm_f(path)
|
27
27
|
FileUtils.rm_f("common_models_diagram.#{extention}")
|
28
28
|
end
|
29
|
-
FileUtils.rm_rf(
|
29
|
+
FileUtils.rm_rf("common_models_diagram_htmlimages")
|
30
30
|
end
|
31
31
|
|
32
|
-
it
|
32
|
+
it "correctly renders input" do
|
33
33
|
Asciidoctor.convert_file(datamodel_file,
|
34
34
|
backend: :standoc,
|
35
35
|
safe: :safe,
|
@@ -39,13 +39,13 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::DiagramPreprocessor do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
context
|
43
|
-
let(:datamodel_file) { examples_path(
|
44
|
-
let(:result_file) { examples_path(
|
42
|
+
context "when complex relations" do
|
43
|
+
let(:datamodel_file) { examples_path("datamodel/top_down_diagram.adoc") }
|
44
|
+
let(:result_file) { examples_path("datamodel/top_down_diagram.xml") }
|
45
45
|
let(:output) do
|
46
46
|
[
|
47
47
|
BLANK_HDR,
|
48
|
-
File.read(fixtures_path(
|
48
|
+
File.read(fixtures_path("macros_datamodel/top_down_diagram.xml")),
|
49
49
|
].join("\n")
|
50
50
|
end
|
51
51
|
|
@@ -55,11 +55,11 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::DiagramPreprocessor do
|
|
55
55
|
FileUtils.rm_f(path)
|
56
56
|
FileUtils.rm_f("top_down_diagram.#{extention}")
|
57
57
|
end
|
58
|
-
FileUtils.rm_rf(examples_path(
|
59
|
-
FileUtils.rm_rf(
|
58
|
+
FileUtils.rm_rf(examples_path("datamodel/plantuml"))
|
59
|
+
FileUtils.rm_rf("top_down_diagram_htmlimages")
|
60
60
|
end
|
61
61
|
|
62
|
-
it
|
62
|
+
it "correctly renders input" do
|
63
63
|
Asciidoctor.convert_file(datamodel_file,
|
64
64
|
backend: :standoc,
|
65
65
|
safe: :safe,
|
@@ -294,9 +294,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
294
294
|
http://example.com[Link]
|
295
295
|
http://example.com[Link,title="tip"]
|
296
296
|
link:++https://asciidoctor.org/now_this__link_works.html++[]
|
297
|
-
http://example.com[Link,
|
297
|
+
http://example.com[Link,update-type=true]
|
298
298
|
link:../example[updatetype=true]
|
299
|
-
link:../example[Link,
|
299
|
+
link:../example[Link,update-type=true]
|
300
300
|
INPUT
|
301
301
|
output = <<~OUTPUT
|
302
302
|
#{BLANK_HDR}
|
@@ -306,9 +306,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
306
306
|
<link target="http://example.com">Link</link>
|
307
307
|
<link target="http://example.com" alt="tip">Link</link>
|
308
308
|
<link target='https://asciidoctor.org/now_this__link_works.html'/>
|
309
|
-
<link target="http://example.com"
|
310
|
-
<link target="../example"
|
311
|
-
<link target="../example"
|
309
|
+
<link target="http://example.com" update-type="true">Link</link>
|
310
|
+
<link target="../example" update-type="true"/>
|
311
|
+
<link target="../example" update-type="true">Link</link></p>
|
312
312
|
</p>
|
313
313
|
</sections>
|
314
314
|
</standard-document>
|
@@ -716,29 +716,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
716
716
|
|
717
717
|
def mock_isobib_get_123
|
718
718
|
expect(RelatonIso::IsoBibliography).to receive(:get)
|
719
|
-
.with("ISO 123", "2001",
|
720
|
-
{ lang: "en", title: "<em>Standard</em>", usrlbl: nil })
|
719
|
+
.with("ISO 123", "2001", anything)
|
721
720
|
.and_return(RelatonIsoBib::XMLParser.from_xml(ISO_123_DATED))
|
722
721
|
end
|
723
722
|
|
724
723
|
def mock_isobib_get_123_undated
|
725
724
|
expect(RelatonIso::IsoBibliography).to receive(:get)
|
726
|
-
.with("ISO 123", nil,
|
727
|
-
{ lang: "en", title: "<em>Standard</em>", usrlbl: nil })
|
725
|
+
.with("ISO 123", nil, anything)
|
728
726
|
.and_return(RelatonIsoBib::XMLParser.from_xml(ISO_123_UNDATED))
|
729
727
|
end
|
730
728
|
|
731
729
|
def mock_isobib_get_124
|
732
730
|
expect(RelatonIso::IsoBibliography).to receive(:get)
|
733
|
-
.with("ISO 124", "2014",
|
734
|
-
{ lang: "en", title: "<em>Standard</em>", usrlbl: nil })
|
731
|
+
.with("ISO 124", "2014", anything)
|
735
732
|
.and_return(RelatonIsoBib::XMLParser.from_xml(ISO_124_DATED))
|
736
733
|
end
|
737
734
|
|
738
735
|
def mock_ietfbib_get_123
|
739
736
|
expect(RelatonIetf::IetfBibliography).to receive(:get)
|
740
|
-
.with("RFC 123", nil,
|
741
|
-
{ lang: "en", title: "<em>Standard</em>", usrlbl: nil })
|
737
|
+
.with("RFC 123", nil, anything)
|
742
738
|
.and_return(RelatonIsoBib::XMLParser.from_xml(IETF_123_SHORT))
|
743
739
|
end
|
744
740
|
end
|
@@ -1562,7 +1562,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1562
1562
|
<tt>missing</tt>
|
1563
1563
|
</strong>
|
1564
1564
|
</related>
|
1565
|
-
<definition><
|
1565
|
+
<definition><verbal-definition>
|
1566
1566
|
<p id='_'>paragraph</p>
|
1567
1567
|
<p id='_'>
|
1568
1568
|
<concept>
|
@@ -1620,7 +1620,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1620
1620
|
</concept>
|
1621
1621
|
is a term
|
1622
1622
|
</p>
|
1623
|
-
</
|
1623
|
+
</verbal-definition></definition>
|
1624
1624
|
</term>
|
1625
1625
|
</terms>
|
1626
1626
|
</sections>
|