metanorma-standoc 1.11.0 → 1.11.3
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/asciidoctor/standoc/base.rb +4 -100
- data/lib/asciidoctor/standoc/blocks.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup.rb +2 -1
- data/lib/asciidoctor/standoc/cleanup_block.rb +1 -2
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -20
- data/lib/asciidoctor/standoc/cleanup_inline.rb +14 -4
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +25 -15
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +3 -3
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -2
- data/lib/asciidoctor/standoc/cleanup_terms.rb +58 -21
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +50 -19
- data/lib/asciidoctor/standoc/cleanup_text.rb +23 -0
- data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +6 -6
- data/lib/asciidoctor/standoc/front.rb +1 -1
- data/lib/asciidoctor/standoc/inline.rb +13 -11
- data/lib/asciidoctor/standoc/isodoc.rng +68 -18
- data/lib/asciidoctor/standoc/lists.rb +1 -3
- 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 +18 -7
- data/lib/asciidoctor/standoc/render.rb +117 -0
- data/lib/asciidoctor/standoc/reqt.rb +1 -1
- data/lib/asciidoctor/standoc/section.rb +20 -15
- data/lib/asciidoctor/standoc/utils.rb +0 -16
- 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 +3 -3
- data/spec/asciidoctor/blocks_spec.rb +99 -17
- data/spec/asciidoctor/cleanup_blocks_spec.rb +24 -0
- data/spec/asciidoctor/cleanup_sections_spec.rb +1 -1
- data/spec/asciidoctor/cleanup_spec.rb +6 -6
- data/spec/asciidoctor/cleanup_terms_spec.rb +448 -89
- 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_dl_spec.rb +4 -4
- data/spec/asciidoctor/refs_spec.rb +858 -498
- data/spec/asciidoctor/section_spec.rb +32 -3
- data/spec/spec_helper.rb +2 -2
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +179 -179
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +14 -14
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +96 -96
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +108 -108
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +18 -18
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +9 -8
@@ -686,6 +686,36 @@ RSpec.describe Asciidoctor::Standoc do
|
|
686
686
|
.to be_equivalent_to xmlpp(output)
|
687
687
|
end
|
688
688
|
|
689
|
+
it "tag and multilingual processing attributes on term" do
|
690
|
+
input = <<~INPUT
|
691
|
+
#{ASCIIDOC_BLANK_HDR}
|
692
|
+
[heading="terms, definitions, symbols and abbreviated terms"]
|
693
|
+
== Terms, Definitions, Symbols Section
|
694
|
+
|
695
|
+
[language=en,tag=x123,multilingual-rendering=all-columns]
|
696
|
+
=== Term
|
697
|
+
INPUT
|
698
|
+
output = <<~OUTPUT
|
699
|
+
#{BLANK_HDR}
|
700
|
+
<sections>
|
701
|
+
<terms id='_' obligation='normative'>
|
702
|
+
<title>Terms and definitions</title>
|
703
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
704
|
+
<term id='term-term' language='en' tag='x123' multilingual-rendering='all-columns'>
|
705
|
+
<preferred>
|
706
|
+
<expression>
|
707
|
+
<name>Term</name>
|
708
|
+
</expression>
|
709
|
+
</preferred>
|
710
|
+
</term>
|
711
|
+
</terms>
|
712
|
+
</sections>
|
713
|
+
</standard-document>
|
714
|
+
OUTPUT
|
715
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
716
|
+
.to be_equivalent_to xmlpp(output)
|
717
|
+
end
|
718
|
+
|
689
719
|
it "varies terms & symbols title" do
|
690
720
|
input = <<~INPUT
|
691
721
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1137,7 +1167,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1137
1167
|
<title>Basic concepts</title>
|
1138
1168
|
<term id='term-date'>
|
1139
1169
|
<preferred><expression><name>date</name></expression></preferred>
|
1140
|
-
<definition><
|
1170
|
+
<definition><verbal-definition>
|
1141
1171
|
<p id='_'>
|
1142
1172
|
<em>time</em>
|
1143
1173
|
(
|
@@ -1152,7 +1182,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1152
1182
|
<xref target='term-time-scale'/>
|
1153
1183
|
)
|
1154
1184
|
</p>
|
1155
|
-
</
|
1185
|
+
</verbal-definition></definition>
|
1156
1186
|
</term>
|
1157
1187
|
</terms>
|
1158
1188
|
</clause>
|
@@ -1229,5 +1259,4 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1229
1259
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1230
1260
|
.to be_equivalent_to xmlpp(output)
|
1231
1261
|
end
|
1232
|
-
|
1233
1262
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -23,7 +23,6 @@ require "equivalent-xml"
|
|
23
23
|
require "metanorma"
|
24
24
|
require "metanorma/standoc"
|
25
25
|
require "rexml/document"
|
26
|
-
require "byebug"
|
27
26
|
|
28
27
|
Dir[File.expand_path("./support/**/**/*.rb", __dir__)]
|
29
28
|
.sort.each { |f| require f }
|
@@ -61,7 +60,8 @@ def xmlpp(xml)
|
|
61
60
|
s = ""
|
62
61
|
f = REXML::Formatters::Pretty.new(2)
|
63
62
|
f.compact = true
|
64
|
-
f.write(REXML::Document.new(xml
|
63
|
+
f.write(REXML::Document.new(xml
|
64
|
+
.gsub(%r{<fetched>[^<]+</fetched>}, "<fetched/>")), s)
|
65
65
|
s
|
66
66
|
end
|
67
67
|
|