metanorma-standoc 1.4.4 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +4 -9
- data/.github/workflows/ubuntu.yml +1 -5
- data/.github/workflows/windows.yml +2 -12
- data/.rubocop.yml +1 -1
- data/lib/asciidoctor/standoc/base.rb +11 -5
- data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +123 -0
- data/lib/asciidoctor/standoc/basicdoc.rng +23 -0
- data/lib/asciidoctor/standoc/cleanup.rb +32 -12
- data/lib/asciidoctor/standoc/cleanup_amend.rb +54 -0
- data/lib/asciidoctor/standoc/cleanup_block.rb +0 -2
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +11 -24
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +0 -3
- data/lib/asciidoctor/standoc/cleanup_inline.rb +62 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +10 -7
- data/lib/asciidoctor/standoc/cleanup_section.rb +91 -8
- data/lib/asciidoctor/standoc/cleanup_terms.rb +12 -2
- data/lib/asciidoctor/standoc/converter.rb +3 -3
- data/lib/asciidoctor/standoc/front.rb +0 -12
- data/lib/asciidoctor/standoc/front_contributor.rb +51 -10
- data/lib/asciidoctor/standoc/inline.rb +21 -31
- data/lib/asciidoctor/standoc/isodoc.rng +137 -21
- data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +44 -0
- data/lib/asciidoctor/standoc/log.rb +10 -1
- data/lib/asciidoctor/standoc/macros.rb +45 -33
- data/lib/asciidoctor/standoc/ref.rb +45 -45
- data/lib/asciidoctor/standoc/section.rb +39 -30
- data/lib/asciidoctor/standoc/table.rb +3 -2
- data/lib/asciidoctor/standoc/utils.rb +18 -1
- data/lib/asciidoctor/standoc/validate.rb +30 -18
- data/lib/asciidoctor/standoc/validate_section.rb +1 -1
- data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +10 -10
- data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +46 -0
- data/lib/liquid/custom_blocks/key_iterator.rb +21 -0
- data/lib/liquid/custom_filters/values.rb +7 -0
- data/lib/metanorma/standoc.rb +0 -5
- data/lib/metanorma/standoc/version.rb +20 -1
- data/metanorma-standoc.gemspec +4 -5
- data/spec/asciidoctor-standoc/base_spec.rb +140 -7
- data/spec/asciidoctor-standoc/blocks_spec.rb +275 -149
- data/spec/asciidoctor-standoc/cleanup_spec.rb +1372 -56
- data/spec/asciidoctor-standoc/inline_spec.rb +133 -6
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +9 -7
- data/spec/asciidoctor-standoc/macros_json2text_spec.rb +10 -0
- data/spec/asciidoctor-standoc/macros_spec.rb +43 -23
- data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +5 -560
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +9 -7
- data/spec/asciidoctor-standoc/refs_spec.rb +43 -34
- data/spec/asciidoctor-standoc/section_spec.rb +42 -39
- data/spec/asciidoctor-standoc/table_spec.rb +119 -113
- data/spec/asciidoctor-standoc/validate_spec.rb +45 -1
- data/spec/assets/i18n.yaml +17 -2
- data/spec/examples/codes_table.html +1365 -1365
- data/spec/fixtures/macros_datamodel/address_class_profile.xml +46 -46
- data/spec/fixtures/macros_datamodel/address_component_profile.xml +21 -21
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +21 -21
- data/spec/metanorma/processor_spec.rb +1 -2
- data/spec/spec_helper.rb +110 -109
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +629 -0
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +71 -71
- data/spec/vcr_cassettes/isobib_get_123.yml +16 -16
- data/spec/vcr_cassettes/isobib_get_123_1.yml +36 -36
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +16 -16
- data/spec/vcr_cassettes/isobib_get_124.yml +17 -17
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +39 -37
- metadata +29 -14
- data/lib/asciidoctor-yaml/i18n-en.yaml +0 -20
- data/lib/asciidoctor-yaml/i18n-fr.yaml +0 -13
- data/lib/asciidoctor-yaml/i18n-zh-Hans.yaml +0 -15
- data/lib/asciidoctor/standoc/i18n.rb +0 -39
- data/lib/asciidoctor/standoc/macros_yaml2text.rb +0 -165
- data/lib/metanorma/standoc/latexml_requirement.rb +0 -62
- data/lib/metanorma/standoc/requirement.rb +0 -13
@@ -52,93 +52,93 @@
|
|
52
52
|
<name>AddressClassProfile attributes</name>
|
53
53
|
<thead>
|
54
54
|
<tr>
|
55
|
-
<th align='left'>Name</th>
|
56
|
-
<th align='left'>Definition</th>
|
57
|
-
<th align='left'>Mandatory/ Optional/ Conditional</th>
|
58
|
-
<th align='left'>Max Occur</th>
|
59
|
-
<th align='left'>Data Type</th>
|
55
|
+
<th valign='top' align='left'>Name</th>
|
56
|
+
<th valign='top' align='left'>Definition</th>
|
57
|
+
<th valign='top' align='left'>Mandatory/ Optional/ Conditional</th>
|
58
|
+
<th valign='top' align='left'>Max Occur</th>
|
59
|
+
<th valign='top' align='left'>Data Type</th>
|
60
60
|
</tr>
|
61
61
|
</thead>
|
62
62
|
<tbody>
|
63
63
|
<tr>
|
64
|
-
<td align='left'>id</td>
|
65
|
-
<td align='left'>Unique identifier of this AddressClassProfile.</td>
|
66
|
-
<td align='left'>M</td>
|
67
|
-
<td align='left'>1</td>
|
68
|
-
<td align='left'>
|
64
|
+
<td valign='top' align='left'>id</td>
|
65
|
+
<td valign='top' align='left'>Unique identifier of this AddressClassProfile.</td>
|
66
|
+
<td valign='top' align='left'>M</td>
|
67
|
+
<td valign='top' align='left'>1</td>
|
68
|
+
<td valign='top' align='left'>
|
69
69
|
<tt>CharacterString</tt>
|
70
70
|
</td>
|
71
71
|
</tr>
|
72
72
|
<tr>
|
73
|
-
<td align='left'>type</td>
|
74
|
-
<td align='left'>Intended usage of this profile.</td>
|
75
|
-
<td align='left'>M</td>
|
76
|
-
<td align='left'>1</td>
|
77
|
-
<td align='left'>
|
73
|
+
<td valign='top' align='left'>type</td>
|
74
|
+
<td valign='top' align='left'>Intended usage of this profile.</td>
|
75
|
+
<td valign='top' align='left'>M</td>
|
76
|
+
<td valign='top' align='left'>1</td>
|
77
|
+
<td valign='top' align='left'>
|
78
78
|
<tt>CharacterString</tt>
|
79
79
|
</td>
|
80
80
|
</tr>
|
81
81
|
<tr>
|
82
|
-
<td align='left'>description</td>
|
83
|
-
<td align='left'>Textual description of this profile.</td>
|
84
|
-
<td align='left'>M</td>
|
85
|
-
<td align='left'>1</td>
|
86
|
-
<td align='left'>
|
82
|
+
<td valign='top' align='left'>description</td>
|
83
|
+
<td valign='top' align='left'>Textual description of this profile.</td>
|
84
|
+
<td valign='top' align='left'>M</td>
|
85
|
+
<td valign='top' align='left'>1</td>
|
86
|
+
<td valign='top' align='left'>
|
87
87
|
<tt>CharacterString</tt>
|
88
88
|
</td>
|
89
89
|
</tr>
|
90
90
|
<tr>
|
91
|
-
<td align='left'>localization</td>
|
92
|
-
<td align='left'>The language and script used within this profile.</td>
|
93
|
-
<td align='left'>M</td>
|
94
|
-
<td align='left'>1</td>
|
95
|
-
<td align='left'>
|
91
|
+
<td valign='top' align='left'>localization</td>
|
92
|
+
<td valign='top' align='left'>The language and script used within this profile.</td>
|
93
|
+
<td valign='top' align='left'>M</td>
|
94
|
+
<td valign='top' align='left'>1</td>
|
95
|
+
<td valign='top' align='left'>
|
96
96
|
<tt>Localization</tt>
|
97
97
|
</td>
|
98
98
|
</tr>
|
99
99
|
<tr>
|
100
|
-
<td align='left'>signature</td>
|
101
|
-
<td align='left'>
|
100
|
+
<td valign='top' align='left'>signature</td>
|
101
|
+
<td valign='top' align='left'>
|
102
102
|
The digital signature to verify the integrity of this profile, and
|
103
103
|
the identity of the publishing authority.
|
104
104
|
</td>
|
105
|
-
<td align='left'>O</td>
|
106
|
-
<td align='left'>1</td>
|
107
|
-
<td align='left'>
|
105
|
+
<td valign='top' align='left'>O</td>
|
106
|
+
<td valign='top' align='left'>1</td>
|
107
|
+
<td valign='top' align='left'>
|
108
108
|
<tt>Signature</tt>
|
109
109
|
</td>
|
110
110
|
</tr>
|
111
111
|
<tr>
|
112
|
-
<td align='left'>areaApplicability</td>
|
113
|
-
<td align='left'>
|
112
|
+
<td valign='top' align='left'>areaApplicability</td>
|
113
|
+
<td valign='top' align='left'>
|
114
114
|
The geographic representation of which this AddressClassProfile
|
115
115
|
applies to. Overlapping geographic areas are allowed across
|
116
116
|
different profiles.
|
117
117
|
</td>
|
118
|
-
<td align='left'>O</td>
|
119
|
-
<td align='left'>N</td>
|
120
|
-
<td align='left'>
|
118
|
+
<td valign='top' align='left'>O</td>
|
119
|
+
<td valign='top' align='left'>N</td>
|
120
|
+
<td valign='top' align='left'>
|
121
121
|
<tt>iso19115MD_SpatialRepresentation</tt>
|
122
122
|
</td>
|
123
123
|
</tr>
|
124
124
|
<tr>
|
125
|
-
<td align='left'>timeToLive</td>
|
126
|
-
<td align='left'>
|
125
|
+
<td valign='top' align='left'>timeToLive</td>
|
126
|
+
<td valign='top' align='left'>
|
127
127
|
The maximum time interval between refreshing of this profile via
|
128
128
|
an authoritative source, in seconds.
|
129
129
|
</td>
|
130
|
-
<td align='left'>M</td>
|
131
|
-
<td align='left'>1</td>
|
132
|
-
<td align='left'>
|
130
|
+
<td valign='top' align='left'>M</td>
|
131
|
+
<td valign='top' align='left'>1</td>
|
132
|
+
<td valign='top' align='left'>
|
133
133
|
<tt>Integer</tt>
|
134
134
|
</td>
|
135
135
|
</tr>
|
136
136
|
<tr>
|
137
|
-
<td align='left'>validity</td>
|
138
|
-
<td align='left'>The period of date and time that this profile should be considered as valid.</td>
|
139
|
-
<td align='left'>M</td>
|
140
|
-
<td align='left'>1</td>
|
141
|
-
<td align='left'>
|
137
|
+
<td valign='top' align='left'>validity</td>
|
138
|
+
<td valign='top' align='left'>The period of date and time that this profile should be considered as valid.</td>
|
139
|
+
<td valign='top' align='left'>M</td>
|
140
|
+
<td valign='top' align='left'>1</td>
|
141
|
+
<td valign='top' align='left'>
|
142
142
|
<tt>Validity</tt>
|
143
143
|
</td>
|
144
144
|
</tr>
|
@@ -146,4 +146,4 @@
|
|
146
146
|
</table>
|
147
147
|
</clause>
|
148
148
|
</sections>
|
149
|
-
</standard-document>
|
149
|
+
</standard-document>
|
@@ -23,44 +23,44 @@
|
|
23
23
|
<name>AddressComponentProfile attributes</name>
|
24
24
|
<thead>
|
25
25
|
<tr>
|
26
|
-
<th align='left'>Name</th>
|
27
|
-
<th align='left'>Definition</th>
|
28
|
-
<th align='left'>Mandatory/ Optional/ Conditional</th>
|
29
|
-
<th align='left'>Max Occur</th>
|
30
|
-
<th align='left'>Data Type</th>
|
26
|
+
<th valign='top' align='left'>Name</th>
|
27
|
+
<th valign='top' align='left'>Definition</th>
|
28
|
+
<th valign='top' align='left'>Mandatory/ Optional/ Conditional</th>
|
29
|
+
<th valign='top' align='left'>Max Occur</th>
|
30
|
+
<th valign='top' align='left'>Data Type</th>
|
31
31
|
</tr>
|
32
32
|
</thead>
|
33
33
|
<tbody>
|
34
34
|
<tr>
|
35
|
-
<td align='left'>key</td>
|
36
|
-
<td align='left'>
|
35
|
+
<td valign='top' align='left'>key</td>
|
36
|
+
<td valign='top' align='left'>
|
37
37
|
An identifier of this
|
38
38
|
<tt>AddressComponentProfile</tt>
|
39
39
|
, shall be unique within the
|
40
40
|
<tt>AddressProfile</tt>
|
41
41
|
.
|
42
42
|
</td>
|
43
|
-
<td align='left'>M</td>
|
44
|
-
<td align='left'>1</td>
|
45
|
-
<td align='left'>
|
43
|
+
<td valign='top' align='left'>M</td>
|
44
|
+
<td valign='top' align='left'>1</td>
|
45
|
+
<td valign='top' align='left'>
|
46
46
|
<tt>CharacterString</tt>
|
47
47
|
</td>
|
48
48
|
</tr>
|
49
49
|
<tr>
|
50
|
-
<td align='left'>description</td>
|
51
|
-
<td align='left'>Textual description of this component.</td>
|
52
|
-
<td align='left'>M</td>
|
53
|
-
<td align='left'>1</td>
|
54
|
-
<td align='left'>
|
50
|
+
<td valign='top' align='left'>description</td>
|
51
|
+
<td valign='top' align='left'>Textual description of this component.</td>
|
52
|
+
<td valign='top' align='left'>M</td>
|
53
|
+
<td valign='top' align='left'>1</td>
|
54
|
+
<td valign='top' align='left'>
|
55
55
|
<tt>CharacterString</tt>
|
56
56
|
</td>
|
57
57
|
</tr>
|
58
58
|
<tr>
|
59
|
-
<td align='left'>example</td>
|
60
|
-
<td align='left'>A textual example to demonstrate the correct use of this component.</td>
|
61
|
-
<td align='left'>O</td>
|
62
|
-
<td align='left'>1</td>
|
63
|
-
<td align='left'>
|
59
|
+
<td valign='top' align='left'>example</td>
|
60
|
+
<td valign='top' align='left'>A textual example to demonstrate the correct use of this component.</td>
|
61
|
+
<td valign='top' align='left'>O</td>
|
62
|
+
<td valign='top' align='left'>1</td>
|
63
|
+
<td valign='top' align='left'>
|
64
64
|
<tt>CharacterString</tt>
|
65
65
|
</td>
|
66
66
|
</tr>
|
@@ -68,4 +68,4 @@
|
|
68
68
|
</table>
|
69
69
|
</clause>
|
70
70
|
</sections>
|
71
|
-
</standard-document>
|
71
|
+
</standard-document>
|
@@ -9,38 +9,38 @@
|
|
9
9
|
<name>Signature attributes</name>
|
10
10
|
<thead>
|
11
11
|
<tr>
|
12
|
-
<th align='left'>Name</th>
|
13
|
-
<th align='left'>Definition</th>
|
14
|
-
<th align='left'>Mandatory/ Optional/ Conditional</th>
|
15
|
-
<th align='left'>Max Occur</th>
|
16
|
-
<th align='left'>Data Type</th>
|
12
|
+
<th valign='top' align='left'>Name</th>
|
13
|
+
<th valign='top' align='left'>Definition</th>
|
14
|
+
<th valign='top' align='left'>Mandatory/ Optional/ Conditional</th>
|
15
|
+
<th valign='top' align='left'>Max Occur</th>
|
16
|
+
<th valign='top' align='left'>Data Type</th>
|
17
17
|
</tr>
|
18
18
|
</thead>
|
19
19
|
<tbody>
|
20
20
|
<tr>
|
21
|
-
<td align='left'>algorithm</td>
|
22
|
-
<td align='left'>TODO: enum algorithm’s definition</td>
|
23
|
-
<td align='left'>M</td>
|
24
|
-
<td align='left'>1</td>
|
25
|
-
<td align='left'>
|
21
|
+
<td valign='top' align='left'>algorithm</td>
|
22
|
+
<td valign='top' align='left'>TODO: enum algorithm’s definition</td>
|
23
|
+
<td valign='top' align='left'>M</td>
|
24
|
+
<td valign='top' align='left'>1</td>
|
25
|
+
<td valign='top' align='left'>
|
26
26
|
<tt>iso14888Oid</tt>
|
27
27
|
</td>
|
28
28
|
</tr>
|
29
29
|
<tr>
|
30
|
-
<td align='left'>publicKey</td>
|
31
|
-
<td align='left'>TODO: enum publicKey’s definition</td>
|
32
|
-
<td align='left'>M</td>
|
33
|
-
<td align='left'>1</td>
|
34
|
-
<td align='left'>
|
30
|
+
<td valign='top' align='left'>publicKey</td>
|
31
|
+
<td valign='top' align='left'>TODO: enum publicKey’s definition</td>
|
32
|
+
<td valign='top' align='left'>M</td>
|
33
|
+
<td valign='top' align='left'>1</td>
|
34
|
+
<td valign='top' align='left'>
|
35
35
|
<tt>Uri</tt>
|
36
36
|
</td>
|
37
37
|
</tr>
|
38
38
|
<tr>
|
39
|
-
<td align='left'>signature</td>
|
40
|
-
<td align='left'>The actual digital signature value encoded in Base64 format.</td>
|
41
|
-
<td align='left'>M</td>
|
42
|
-
<td align='left'>1</td>
|
43
|
-
<td align='left'>
|
39
|
+
<td valign='top' align='left'>signature</td>
|
40
|
+
<td valign='top' align='left'>The actual digital signature value encoded in Base64 format.</td>
|
41
|
+
<td valign='top' align='left'>M</td>
|
42
|
+
<td valign='top' align='left'>1</td>
|
43
|
+
<td valign='top' align='left'>
|
44
44
|
<tt>CharacterString</tt>
|
45
45
|
</td>
|
46
46
|
</tr>
|
@@ -48,4 +48,4 @@
|
|
48
48
|
</table>
|
49
49
|
</clause>
|
50
50
|
</sections>
|
51
|
-
</standard-document>
|
51
|
+
</standard-document>
|
@@ -49,8 +49,7 @@ RSpec.describe Metanorma::Standoc::Processor do
|
|
49
49
|
expect(File.read("test.html", encoding: "utf-8").gsub(%r{^.*<main}m, "<main").gsub(%r{</main>.*}m, "</main>")).to be_equivalent_to <<~"OUTPUT"
|
50
50
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
51
51
|
<p class="zzSTDTitle1"></p>
|
52
|
-
<div id="H"><h1>
|
53
|
-
<h2 class="TermNum" id="J">1.1.</h2>
|
52
|
+
<div id="H"><h1>Terms, Definitions, Symbols and Abbreviated Terms</h1><h2 class="TermNum" id="J"></h2>
|
54
53
|
<p class="Terms" style="text-align:left;">Term2</p>
|
55
54
|
</div>
|
56
55
|
</main>
|
data/spec/spec_helper.rb
CHANGED
@@ -18,7 +18,9 @@ require "equivalent-xml"
|
|
18
18
|
require "metanorma"
|
19
19
|
require "metanorma/standoc"
|
20
20
|
require "rexml/document"
|
21
|
-
require
|
21
|
+
require "byebug"
|
22
|
+
|
23
|
+
Dir[File.expand_path("./support/**/**/*.rb", __dir__)].each { |f| require f }
|
22
24
|
|
23
25
|
RSpec.configure do |config|
|
24
26
|
# Enable flags like --only-failures and --next-failure
|
@@ -44,150 +46,150 @@ def xmlpp(x)
|
|
44
46
|
s = ""
|
45
47
|
f = REXML::Formatters::Pretty.new(2)
|
46
48
|
f.compact = true
|
47
|
-
f.write(REXML::Document.new(x),s)
|
49
|
+
f.write(REXML::Document.new(x), s)
|
48
50
|
s
|
49
51
|
end
|
50
52
|
|
51
|
-
ASCIIDOC_BLANK_HDR = <<~"HDR"
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
ASCIIDOC_BLANK_HDR = <<~"HDR".freeze
|
54
|
+
= Document title
|
55
|
+
Author
|
56
|
+
:docfile: test.adoc
|
57
|
+
:nodoc:
|
58
|
+
:novalid:
|
59
|
+
:no-isobib:
|
58
60
|
|
59
61
|
HDR
|
60
62
|
|
61
|
-
DUMBQUOTE_BLANK_HDR = <<~"HDR"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
DUMBQUOTE_BLANK_HDR = <<~"HDR".freeze
|
64
|
+
= Document title
|
65
|
+
Author
|
66
|
+
:docfile: test.adoc
|
67
|
+
:nodoc:
|
68
|
+
:novalid:
|
69
|
+
:no-isobib:
|
70
|
+
:smartquotes: false
|
69
71
|
|
70
72
|
HDR
|
71
73
|
|
72
|
-
ISOBIB_BLANK_HDR = <<~"HDR"
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
75
|
+
= Document title
|
76
|
+
Author
|
77
|
+
:docfile: test.adoc
|
78
|
+
:nodoc:
|
79
|
+
:novalid:
|
80
|
+
:no-isobib-cache:
|
79
81
|
|
80
82
|
HDR
|
81
83
|
|
82
|
-
FLUSH_CACHE_ISOBIB_BLANK_HDR = <<~"HDR"
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
FLUSH_CACHE_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
85
|
+
= Document title
|
86
|
+
Author
|
87
|
+
:docfile: test.adoc
|
88
|
+
:nodoc:
|
89
|
+
:novalid:
|
90
|
+
:flush-caches:
|
89
91
|
|
90
92
|
HDR
|
91
93
|
|
92
|
-
CACHED_ISOBIB_BLANK_HDR = <<~"HDR"
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
94
|
+
CACHED_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
95
|
+
= Document title
|
96
|
+
Author
|
97
|
+
:docfile: test.adoc
|
98
|
+
:nodoc:
|
99
|
+
:novalid:
|
98
100
|
|
99
101
|
HDR
|
100
102
|
|
101
|
-
LOCAL_CACHED_ISOBIB_BLANK_HDR = <<~"HDR"
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
103
|
+
LOCAL_CACHED_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
104
|
+
= Document title
|
105
|
+
Author
|
106
|
+
:docfile: test.adoc
|
107
|
+
:nodoc:
|
108
|
+
:novalid:
|
109
|
+
:local-cache:
|
108
110
|
|
109
111
|
HDR
|
110
112
|
|
111
|
-
LOCAL_ONLY_CACHED_ISOBIB_BLANK_HDR = <<~"HDR"
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
113
|
+
LOCAL_ONLY_CACHED_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
114
|
+
= Document title
|
115
|
+
Author
|
116
|
+
:docfile: test.adoc
|
117
|
+
:nodoc:
|
118
|
+
:novalid:
|
119
|
+
:local-cache-only:
|
118
120
|
|
119
121
|
HDR
|
120
122
|
|
121
|
-
VALIDATING_BLANK_HDR = <<~"HDR"
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
123
|
+
VALIDATING_BLANK_HDR = <<~"HDR".freeze
|
124
|
+
= Document title
|
125
|
+
Author
|
126
|
+
:docfile: test.adoc
|
127
|
+
:nodoc:
|
128
|
+
:no-isobib:
|
127
129
|
|
128
130
|
HDR
|
129
131
|
|
130
|
-
NORM_REF_BOILERPLATE = <<~"HDR"
|
131
|
-
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
132
|
+
NORM_REF_BOILERPLATE = <<~"HDR".freeze
|
133
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
132
134
|
HDR
|
133
135
|
|
134
|
-
BLANK_HDR = <<~"HDR"
|
135
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
136
|
-
<standard-document xmlns="https://www.metanorma.org/ns/standoc">
|
137
|
-
<bibdata type="standard">
|
138
|
-
<title language="en" format="text/plain">Document title</title>
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
</bibdata>
|
136
|
+
BLANK_HDR = <<~"HDR".freeze
|
137
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
138
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" version="#{Metanorma::Standoc::VERSION}" type="semantic">
|
139
|
+
<bibdata type="standard">
|
140
|
+
<title language="en" format="text/plain">Document title</title>
|
141
|
+
<language>en</language>
|
142
|
+
<script>Latn</script>
|
143
|
+
<status><stage>published</stage></status>
|
144
|
+
<copyright>
|
145
|
+
<from>#{Time.new.year}</from>
|
146
|
+
</copyright>
|
147
|
+
<ext>
|
148
|
+
<doctype>article</doctype>
|
149
|
+
</ext>
|
150
|
+
</bibdata>
|
149
151
|
HDR
|
150
152
|
|
151
|
-
HTML_HDR = <<~END
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
153
|
+
HTML_HDR = <<~END.freeze
|
154
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
155
|
+
<head>
|
156
|
+
<title>test</title>
|
157
|
+
</head>
|
158
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
159
|
+
<div class="title-section">
|
160
|
+
<p> </p>
|
161
|
+
</div>
|
162
|
+
<br/>
|
163
|
+
<div class="prefatory-section">
|
164
|
+
<p> </p>
|
165
|
+
</div>
|
166
|
+
<br/>
|
167
|
+
<div class="main-section">
|
166
168
|
END
|
167
169
|
|
168
|
-
WORD_HDR = <<~END
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
170
|
+
WORD_HDR = <<~END.freeze
|
171
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
172
|
+
<head>
|
173
|
+
<title>test</title>
|
174
|
+
</head>
|
175
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
176
|
+
<div class="WordSection1">
|
177
|
+
<p> </p>
|
178
|
+
</div>
|
179
|
+
<br clear="all" class="section"/>
|
180
|
+
<div class="WordSection2">
|
181
|
+
<p> </p>
|
182
|
+
</div>
|
183
|
+
<br clear="all" class="section"/>
|
184
|
+
<div class="WordSection3">
|
183
185
|
END
|
184
186
|
|
185
187
|
def examples_path(path)
|
186
|
-
File.join(File.expand_path(
|
188
|
+
File.join(File.expand_path("./examples", __dir__), path)
|
187
189
|
end
|
188
190
|
|
189
191
|
def fixtures_path(path)
|
190
|
-
File.join(File.expand_path(
|
192
|
+
File.join(File.expand_path("./fixtures", __dir__), path)
|
191
193
|
end
|
192
194
|
|
193
195
|
def stub_fetch_ref(**opts)
|
@@ -212,8 +214,8 @@ def stub_fetch_ref(**opts)
|
|
212
214
|
hit_pages = double("hit_pages")
|
213
215
|
expect(hit_pages).to receive(:first).and_return(hit_page).at_least :once
|
214
216
|
|
215
|
-
expect(Isobib::IsoBibliography).to receive(:search)
|
216
|
-
and_wrap_original do |search, *args|
|
217
|
+
expect(Isobib::IsoBibliography).to receive(:search)
|
218
|
+
.and_wrap_original do |search, *args|
|
217
219
|
code = args[0]
|
218
220
|
expect(code).to be_instance_of String
|
219
221
|
xml = get_xml(search, code, opts)
|
@@ -246,4 +248,3 @@ def mock_open_uri(code)
|
|
246
248
|
File.read file, encoding: "utf-8"
|
247
249
|
end.at_least :once
|
248
250
|
end
|
249
|
-
|