metanorma-standoc 1.5.1 → 1.6.2
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/.github/workflows/rake.yml +62 -0
- data/lib/asciidoctor/standoc/base.rb +7 -2
- 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 +14 -0
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +11 -3
- data/lib/asciidoctor/standoc/cleanup_inline.rb +62 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +6 -5
- data/lib/asciidoctor/standoc/cleanup_section.rb +19 -3
- data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -2
- data/lib/asciidoctor/standoc/converter.rb +4 -2
- data/lib/asciidoctor/standoc/front.rb +9 -3
- data/lib/asciidoctor/standoc/front_contributor.rb +58 -18
- data/lib/asciidoctor/standoc/inline.rb +21 -31
- data/lib/asciidoctor/standoc/isodoc.rng +125 -58
- data/lib/asciidoctor/standoc/log.rb +10 -1
- data/lib/asciidoctor/standoc/macros.rb +44 -33
- data/lib/asciidoctor/standoc/ref.rb +39 -44
- data/lib/asciidoctor/standoc/ref_sect.rb +12 -5
- data/lib/asciidoctor/standoc/section.rb +11 -10
- data/lib/asciidoctor/standoc/table.rb +3 -2
- data/lib/asciidoctor/standoc/utils.rb +2 -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/liquid/custom_blocks/key_iterator.rb +21 -0
- data/lib/liquid/custom_blocks/with_json_nested_context.rb +18 -0
- data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +19 -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 -4
- data/spec/asciidoctor-standoc/base_spec.rb +248 -10
- data/spec/asciidoctor-standoc/blocks_spec.rb +263 -144
- data/spec/asciidoctor-standoc/cleanup_spec.rb +199 -50
- data/spec/asciidoctor-standoc/inline_spec.rb +132 -5
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +13 -27
- 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 +6 -561
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +5 -3
- data/spec/asciidoctor-standoc/refs_spec.rb +268 -57
- data/spec/asciidoctor-standoc/section_spec.rb +0 -1
- data/spec/asciidoctor-standoc/table_spec.rb +119 -113
- data/spec/asciidoctor-standoc/validate_spec.rb +27 -1
- 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/spec_helper.rb +115 -109
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +781 -0
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +54 -238
- data/spec/vcr_cassettes/isobib_get_123.yml +14 -60
- data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -116
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +361 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -60
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -57
- 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 +42 -11
- data/.github/workflows/macos.yml +0 -46
- data/.github/workflows/ubuntu.yml +0 -49
- data/.github/workflows/windows.yml +0 -53
- 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>
|
data/spec/spec_helper.rb
CHANGED
@@ -3,6 +3,11 @@ require "vcr"
|
|
3
3
|
VCR.configure do |config|
|
4
4
|
config.cassette_library_dir = "spec/vcr_cassettes"
|
5
5
|
config.hook_into :webmock
|
6
|
+
config.default_cassette_options = {
|
7
|
+
clean_outdated_http_interactions: true,
|
8
|
+
re_record_interval: 25200,
|
9
|
+
record: :once,
|
10
|
+
}
|
6
11
|
end
|
7
12
|
|
8
13
|
require "simplecov"
|
@@ -18,7 +23,9 @@ require "equivalent-xml"
|
|
18
23
|
require "metanorma"
|
19
24
|
require "metanorma/standoc"
|
20
25
|
require "rexml/document"
|
21
|
-
require
|
26
|
+
require "byebug"
|
27
|
+
|
28
|
+
Dir[File.expand_path("./support/**/**/*.rb", __dir__)].each { |f| require f }
|
22
29
|
|
23
30
|
RSpec.configure do |config|
|
24
31
|
# Enable flags like --only-failures and --next-failure
|
@@ -44,150 +51,150 @@ def xmlpp(x)
|
|
44
51
|
s = ""
|
45
52
|
f = REXML::Formatters::Pretty.new(2)
|
46
53
|
f.compact = true
|
47
|
-
f.write(REXML::Document.new(x),s)
|
54
|
+
f.write(REXML::Document.new(x), s)
|
48
55
|
s
|
49
56
|
end
|
50
57
|
|
51
|
-
ASCIIDOC_BLANK_HDR = <<~"HDR"
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
+
ASCIIDOC_BLANK_HDR = <<~"HDR".freeze
|
59
|
+
= Document title
|
60
|
+
Author
|
61
|
+
:docfile: test.adoc
|
62
|
+
:nodoc:
|
63
|
+
:novalid:
|
64
|
+
:no-isobib:
|
58
65
|
|
59
66
|
HDR
|
60
67
|
|
61
|
-
DUMBQUOTE_BLANK_HDR = <<~"HDR"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
68
|
+
DUMBQUOTE_BLANK_HDR = <<~"HDR".freeze
|
69
|
+
= Document title
|
70
|
+
Author
|
71
|
+
:docfile: test.adoc
|
72
|
+
:nodoc:
|
73
|
+
:novalid:
|
74
|
+
:no-isobib:
|
75
|
+
:smartquotes: false
|
69
76
|
|
70
77
|
HDR
|
71
78
|
|
72
|
-
ISOBIB_BLANK_HDR = <<~"HDR"
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
+
ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
80
|
+
= Document title
|
81
|
+
Author
|
82
|
+
:docfile: test.adoc
|
83
|
+
:nodoc:
|
84
|
+
:novalid:
|
85
|
+
:no-isobib-cache:
|
79
86
|
|
80
87
|
HDR
|
81
88
|
|
82
|
-
FLUSH_CACHE_ISOBIB_BLANK_HDR = <<~"HDR"
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
+
FLUSH_CACHE_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
90
|
+
= Document title
|
91
|
+
Author
|
92
|
+
:docfile: test.adoc
|
93
|
+
:nodoc:
|
94
|
+
:novalid:
|
95
|
+
:flush-caches:
|
89
96
|
|
90
97
|
HDR
|
91
98
|
|
92
|
-
CACHED_ISOBIB_BLANK_HDR = <<~"HDR"
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
99
|
+
CACHED_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
100
|
+
= Document title
|
101
|
+
Author
|
102
|
+
:docfile: test.adoc
|
103
|
+
:nodoc:
|
104
|
+
:novalid:
|
98
105
|
|
99
106
|
HDR
|
100
107
|
|
101
|
-
LOCAL_CACHED_ISOBIB_BLANK_HDR = <<~"HDR"
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
+
LOCAL_CACHED_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
109
|
+
= Document title
|
110
|
+
Author
|
111
|
+
:docfile: test.adoc
|
112
|
+
:nodoc:
|
113
|
+
:novalid:
|
114
|
+
:local-cache:
|
108
115
|
|
109
116
|
HDR
|
110
117
|
|
111
|
-
LOCAL_ONLY_CACHED_ISOBIB_BLANK_HDR = <<~"HDR"
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
+
LOCAL_ONLY_CACHED_ISOBIB_BLANK_HDR = <<~"HDR".freeze
|
119
|
+
= Document title
|
120
|
+
Author
|
121
|
+
:docfile: test.adoc
|
122
|
+
:nodoc:
|
123
|
+
:novalid:
|
124
|
+
:local-cache-only:
|
118
125
|
|
119
126
|
HDR
|
120
127
|
|
121
|
-
VALIDATING_BLANK_HDR = <<~"HDR"
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
128
|
+
VALIDATING_BLANK_HDR = <<~"HDR".freeze
|
129
|
+
= Document title
|
130
|
+
Author
|
131
|
+
:docfile: test.adoc
|
132
|
+
:nodoc:
|
133
|
+
:no-isobib:
|
127
134
|
|
128
135
|
HDR
|
129
136
|
|
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>
|
137
|
+
NORM_REF_BOILERPLATE = <<~"HDR".freeze
|
138
|
+
<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
139
|
HDR
|
133
140
|
|
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>
|
141
|
+
BLANK_HDR = <<~"HDR".freeze
|
142
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
143
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" version="#{Metanorma::Standoc::VERSION}" type="semantic">
|
144
|
+
<bibdata type="standard">
|
145
|
+
<title language="en" format="text/plain">Document title</title>
|
146
|
+
<language>en</language>
|
147
|
+
<script>Latn</script>
|
148
|
+
<status><stage>published</stage></status>
|
149
|
+
<copyright>
|
150
|
+
<from>#{Time.new.year}</from>
|
151
|
+
</copyright>
|
152
|
+
<ext>
|
153
|
+
<doctype>article</doctype>
|
154
|
+
</ext>
|
155
|
+
</bibdata>
|
149
156
|
HDR
|
150
157
|
|
151
|
-
HTML_HDR = <<~END
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
158
|
+
HTML_HDR = <<~END.freeze
|
159
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
160
|
+
<head>
|
161
|
+
<title>test</title>
|
162
|
+
</head>
|
163
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
164
|
+
<div class="title-section">
|
165
|
+
<p> </p>
|
166
|
+
</div>
|
167
|
+
<br/>
|
168
|
+
<div class="prefatory-section">
|
169
|
+
<p> </p>
|
170
|
+
</div>
|
171
|
+
<br/>
|
172
|
+
<div class="main-section">
|
166
173
|
END
|
167
174
|
|
168
|
-
WORD_HDR = <<~END
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
175
|
+
WORD_HDR = <<~END.freeze
|
176
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
177
|
+
<head>
|
178
|
+
<title>test</title>
|
179
|
+
</head>
|
180
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
181
|
+
<div class="WordSection1">
|
182
|
+
<p> </p>
|
183
|
+
</div>
|
184
|
+
<br clear="all" class="section"/>
|
185
|
+
<div class="WordSection2">
|
186
|
+
<p> </p>
|
187
|
+
</div>
|
188
|
+
<br clear="all" class="section"/>
|
189
|
+
<div class="WordSection3">
|
183
190
|
END
|
184
191
|
|
185
192
|
def examples_path(path)
|
186
|
-
File.join(File.expand_path(
|
193
|
+
File.join(File.expand_path("./examples", __dir__), path)
|
187
194
|
end
|
188
195
|
|
189
196
|
def fixtures_path(path)
|
190
|
-
File.join(File.expand_path(
|
197
|
+
File.join(File.expand_path("./fixtures", __dir__), path)
|
191
198
|
end
|
192
199
|
|
193
200
|
def stub_fetch_ref(**opts)
|
@@ -212,8 +219,8 @@ def stub_fetch_ref(**opts)
|
|
212
219
|
hit_pages = double("hit_pages")
|
213
220
|
expect(hit_pages).to receive(:first).and_return(hit_page).at_least :once
|
214
221
|
|
215
|
-
expect(Isobib::IsoBibliography).to receive(:search)
|
216
|
-
and_wrap_original do |search, *args|
|
222
|
+
expect(Isobib::IsoBibliography).to receive(:search)
|
223
|
+
.and_wrap_original do |search, *args|
|
217
224
|
code = args[0]
|
218
225
|
expect(code).to be_instance_of String
|
219
226
|
xml = get_xml(search, code, opts)
|
@@ -246,4 +253,3 @@ def mock_open_uri(code)
|
|
246
253
|
File.read file, encoding: "utf-8"
|
247
254
|
end.at_least :once
|
248
255
|
end
|
249
|
-
|