metanorma-standoc 1.6.0 → 1.6.5
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 +66 -0
- data/README.adoc +1 -3
- data/lib/asciidoctor/standoc/base.rb +8 -16
- data/lib/asciidoctor/standoc/basicdoc.rng +32 -0
- data/lib/asciidoctor/standoc/cleanup.rb +52 -4
- data/lib/asciidoctor/standoc/cleanup_block.rb +41 -4
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +14 -0
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +25 -0
- data/lib/asciidoctor/standoc/cleanup_inline.rb +6 -2
- data/lib/asciidoctor/standoc/cleanup_ref.rb +18 -25
- data/lib/asciidoctor/standoc/cleanup_terms.rb +3 -0
- data/lib/asciidoctor/standoc/converter.rb +61 -3
- data/lib/asciidoctor/standoc/front.rb +9 -3
- data/lib/asciidoctor/standoc/front_contributor.rb +34 -10
- data/lib/asciidoctor/standoc/isodoc.rng +29 -44
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +45 -63
- data/lib/asciidoctor/standoc/macros_terms.rb +82 -0
- data/lib/asciidoctor/standoc/ref.rb +24 -36
- data/lib/asciidoctor/standoc/ref_sect.rb +16 -8
- data/lib/asciidoctor/standoc/section.rb +5 -9
- data/lib/asciidoctor/standoc/table.rb +12 -0
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +86 -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/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +6 -3
- data/spec/asciidoctor-standoc/base_spec.rb +127 -8
- data/spec/asciidoctor-standoc/blocks_spec.rb +8 -8
- data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +1514 -0
- data/spec/asciidoctor-standoc/cleanup_spec.rb +450 -1554
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +22 -31
- data/spec/asciidoctor-standoc/lists_spec.rb +10 -1
- data/spec/asciidoctor-standoc/macros_json2text_spec.rb +1 -1
- data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +80 -0
- data/spec/asciidoctor-standoc/macros_plantuml_spec.rb +307 -0
- data/spec/asciidoctor-standoc/macros_spec.rb +378 -169
- data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -8
- data/spec/asciidoctor-standoc/refs_spec.rb +350 -101
- data/spec/asciidoctor-standoc/section_spec.rb +11 -11
- data/spec/asciidoctor-standoc/table_spec.rb +86 -0
- data/spec/asciidoctor-standoc/validate_spec.rb +26 -0
- data/spec/fixtures/diagram_definitions.lutaml +22 -0
- data/spec/fixtures/test.exp +121 -0
- data/spec/spec_helper.rb +33 -0
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +156 -4
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -233
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -58
- data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -119
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +361 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -58
- 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 +276 -158
- metadata +61 -14
- data/.github/workflows/macos.yml +0 -41
- data/.github/workflows/ubuntu.yml +0 -45
- data/.github/workflows/windows.yml +0 -43
- data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +0 -123
- data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +0 -44
- data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +0 -46
@@ -60,8 +60,7 @@ module Asciidoctor
|
|
60
60
|
ret.merge(change: node.attributes["change"],
|
61
61
|
path: node.attributes["path"],
|
62
62
|
path_end: node.attributes["path_end"],
|
63
|
-
title: node.attributes["title"]
|
64
|
-
)
|
63
|
+
title: node.attributes["title"])
|
65
64
|
end
|
66
65
|
|
67
66
|
def section(node)
|
@@ -105,13 +104,10 @@ module Asciidoctor
|
|
105
104
|
end
|
106
105
|
|
107
106
|
def set_obligation(attrs, node)
|
108
|
-
attrs[:obligation] =
|
109
|
-
node.attr("obligation")
|
110
|
-
|
111
|
-
node.parent.attr("obligation")
|
112
|
-
else
|
113
|
-
"normative"
|
114
|
-
end
|
107
|
+
attrs[:obligation] = node.attributes.has_key?("obligation") ?
|
108
|
+
node.attr("obligation") :
|
109
|
+
node.parent.attributes.has_key?("obligation") ?
|
110
|
+
node.parent.attr("obligation") : "normative"
|
115
111
|
end
|
116
112
|
|
117
113
|
def preamble(node)
|
@@ -17,6 +17,7 @@ module Asciidoctor
|
|
17
17
|
@table_fn_number = "a"
|
18
18
|
noko do |xml|
|
19
19
|
xml.table **attr_code(table_attrs(node)) do |xml_table|
|
20
|
+
colgroup(node, xml_table)
|
20
21
|
table_name(node, xml_table)
|
21
22
|
%i(head body foot).reject do |tblsec|
|
22
23
|
node.rows[tblsec].empty?
|
@@ -28,6 +29,17 @@ module Asciidoctor
|
|
28
29
|
|
29
30
|
private
|
30
31
|
|
32
|
+
def colgroup(node, xml_table)
|
33
|
+
return if node.option? "autowidth"
|
34
|
+
cols = node&.attr("cols")&.split(/,/) or return
|
35
|
+
return unless cols.size > 1 and cols.all? { |c| /\d/.match(c) }
|
36
|
+
xml_table.colgroup do |cg|
|
37
|
+
node.columns.each do |col|
|
38
|
+
cg.col **{ width: "#{col.attr 'colpcwidth'}%" }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
31
43
|
def table_name(node, xml_table)
|
32
44
|
if node.title?
|
33
45
|
xml_table.name do |n|
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true.
|
2
|
+
|
3
|
+
module Asciidoctor
|
4
|
+
module Standoc
|
5
|
+
# Intelligent term lookup xml modifier
|
6
|
+
# Lookup all `term` and `calause` tags and replace `termxref` tags with
|
7
|
+
# `xref`:target tag
|
8
|
+
class TermLookupCleanup
|
9
|
+
AUTOMATIC_GENERATED_ID_REGEXP = /\A_/
|
10
|
+
EXISTING_TERM_REGEXP = /\Aterm-/
|
11
|
+
|
12
|
+
attr_reader :xmldoc, :termlookup, :log
|
13
|
+
|
14
|
+
def initialize(xmldoc, log)
|
15
|
+
@xmldoc = xmldoc
|
16
|
+
@log = log
|
17
|
+
@termlookup = {}
|
18
|
+
end
|
19
|
+
|
20
|
+
def call
|
21
|
+
@termlookup = replace_automatic_generated_ids_terms
|
22
|
+
set_termxref_tags_target
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def set_termxref_tags_target
|
28
|
+
xmldoc.xpath('//termxref').each do |node|
|
29
|
+
target = normalize_ref_id(node.text)
|
30
|
+
if termlookup[target].nil?
|
31
|
+
remove_missing_ref(node, target)
|
32
|
+
next
|
33
|
+
end
|
34
|
+
modify_ref_node(node, target)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def remove_missing_ref(node, target)
|
39
|
+
log.add('AsciiDoc Input', node,
|
40
|
+
%(Error: Term reference in `term[#{target}]` missing: \
|
41
|
+
"#{target}" is not defined in document))
|
42
|
+
term_name_node = node.previous.previous
|
43
|
+
term_name_node.remove
|
44
|
+
term_name_node.name = "strong"
|
45
|
+
term_name_node.children.first.content =
|
46
|
+
%(term "#{term_name_node.text}" not resolved)
|
47
|
+
node.add_previous_sibling(term_name_node)
|
48
|
+
node.remove
|
49
|
+
end
|
50
|
+
|
51
|
+
def modify_ref_node(node, target)
|
52
|
+
node.name = 'xref'
|
53
|
+
node['target'] = termlookup[target]
|
54
|
+
node.children.remove
|
55
|
+
node.remove_attribute('defaultref')
|
56
|
+
end
|
57
|
+
|
58
|
+
def replace_automatic_generated_ids_terms
|
59
|
+
xmldoc.xpath('//term').each.with_object({}) do |term_node, res|
|
60
|
+
normalize_id_and_memorize(term_node, res, './preferred')
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def normalize_id_and_memorize(term_node, res_table, text_selector)
|
65
|
+
term_text = normalize_ref_id(term_node.at(text_selector).text)
|
66
|
+
unless AUTOMATIC_GENERATED_ID_REGEXP.match(term_node['id']).nil?
|
67
|
+
term_node['id'] = unique_text_id(term_text)
|
68
|
+
end
|
69
|
+
res_table[term_text] = term_node['id']
|
70
|
+
end
|
71
|
+
|
72
|
+
def normalize_ref_id(text)
|
73
|
+
text.downcase.gsub(/[[:space:]]/, '-')
|
74
|
+
end
|
75
|
+
|
76
|
+
def unique_text_id(text)
|
77
|
+
return "term-#{text}" if xmldoc.at("//*[@id = 'term-#{text}']").nil?
|
78
|
+
(1..Float::INFINITY).lazy.each do |index|
|
79
|
+
if xmldoc.at("//*[@id = 'term-#{text}-#{index}']").nil?
|
80
|
+
break("term-#{text}-#{index}")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Liquid
|
2
|
+
module CustomBlocks
|
3
|
+
class WithJsonNestedContext < Block
|
4
|
+
def initialize(tag_name, markup, tokens)
|
5
|
+
super
|
6
|
+
@context_file_variable, @context_name = markup.split(",").map(&:strip)
|
7
|
+
end
|
8
|
+
|
9
|
+
def render(context)
|
10
|
+
context_file = context[@context_file_variable].to_s.strip
|
11
|
+
context[@context_name] = JSON.parse(
|
12
|
+
File.read(context_file, encoding: "utf-8")
|
13
|
+
)
|
14
|
+
super
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Liquid
|
2
|
+
module CustomBlocks
|
3
|
+
class WithYamlNestedContext < Block
|
4
|
+
def initialize(tag_name, markup, tokens)
|
5
|
+
super
|
6
|
+
@context_file_variable, @context_name = markup.split(",").map(&:strip)
|
7
|
+
end
|
8
|
+
|
9
|
+
def render(context)
|
10
|
+
context_file = context[@context_file_variable].to_s.strip
|
11
|
+
context[@context_name] = YAML.safe_load(
|
12
|
+
File.read(context_file, encoding: "utf-8"),
|
13
|
+
[Date, Time]
|
14
|
+
)
|
15
|
+
super
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/metanorma-standoc.gemspec
CHANGED
@@ -28,17 +28,20 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
|
-
spec.add_dependency "isodoc", "~> 1.
|
31
|
+
spec.add_dependency "isodoc", "~> 1.3.0"
|
32
32
|
spec.add_dependency "iev", "~> 0.2.1"
|
33
|
+
spec.add_dependency "metanorma-plugin-datastruct"
|
34
|
+
spec.add_dependency "metanorma-plugin-lutaml", "~> 0.2.1"
|
33
35
|
# relaton-cli not just relaton, to avoid circular reference in metanorma
|
34
|
-
spec.add_dependency "relaton-cli", "~> 1.
|
35
|
-
spec.add_dependency "relaton-iev", "~> 1.
|
36
|
+
spec.add_dependency "relaton-cli", "~> 1.7.0"
|
37
|
+
spec.add_dependency "relaton-iev", "~> 1.1.0"
|
36
38
|
spec.add_dependency "sterile", "~> 1.0.14"
|
37
39
|
spec.add_dependency "concurrent-ruby"
|
38
40
|
spec.add_dependency "unicode2latex", "~> 0.0.1"
|
39
41
|
spec.add_dependency "mimemagic"
|
40
42
|
spec.add_dependency "mathml2asciimath"
|
41
43
|
spec.add_dependency "latexmath"
|
44
|
+
spec.add_dependency "fontist", "~> 1.5.0"
|
42
45
|
|
43
46
|
spec.add_development_dependency "byebug"
|
44
47
|
spec.add_development_dependency "sassc", "2.4.0"
|
@@ -34,7 +34,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
34
34
|
|
35
35
|
it "processes publisher abbreviations" do
|
36
36
|
mock_org_abbrevs
|
37
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~
|
37
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
38
38
|
= Document title
|
39
39
|
Author
|
40
40
|
:docfile: test.adoc
|
@@ -42,7 +42,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
42
42
|
:novalid:
|
43
43
|
:publisher: International Electrotechnical Commission,IETF,ISO
|
44
44
|
INPUT
|
45
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='
|
45
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type='semantic' version='#{Metanorma::Standoc::VERSION}'>
|
46
46
|
<bibdata type='standard'>
|
47
47
|
<title language='en' format='text/plain'>Document title</title>
|
48
48
|
<contributor>
|
@@ -191,7 +191,8 @@ OUTPUT
|
|
191
191
|
:role_2: editor
|
192
192
|
:affiliation_2: Rockhead and Quarry Cave Construction Company
|
193
193
|
:affiliation_abbrev_2: RQCCC
|
194
|
-
:address_2: 6A Rubble Way,
|
194
|
+
:address_2: 6A Rubble Way, + \\
|
195
|
+
Bedrock
|
195
196
|
:email_2: barney@rockhead.example.com
|
196
197
|
:phone_2: 789
|
197
198
|
:fax_2: 012
|
@@ -200,12 +201,22 @@ OUTPUT
|
|
200
201
|
:part-of: ABC
|
201
202
|
:translated-from: DEF,GHI;JKL MNO,PQR
|
202
203
|
:keywords: a, b, c
|
204
|
+
:pub-address: 1 Infinity Loop + \\
|
205
|
+
California
|
206
|
+
:pub-phone: 3333333
|
207
|
+
:pub-fax: 4444444
|
208
|
+
:pub-email: x@example.com
|
209
|
+
:pub-uri: http://www.example.com
|
210
|
+
:isbn: ISBN-13
|
211
|
+
:isbn10: ISBN-10
|
203
212
|
INPUT
|
204
213
|
<?xml version="1.0" encoding="UTF-8"?>
|
205
214
|
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
206
215
|
<bibdata type="standard">
|
207
216
|
<title language="en" format="text/plain">Main Title — Title</title>
|
208
217
|
<docidentifier>1000-1</docidentifier>
|
218
|
+
<docidentifier type='ISBN'>ISBN-13</docidentifier>
|
219
|
+
<docidentifier type='ISBN10'>ISBN-10</docidentifier>
|
209
220
|
<docnumber>1000</docnumber>
|
210
221
|
<date type="published">
|
211
222
|
<on>1000-01-01</on>
|
@@ -252,19 +263,19 @@ OUTPUT
|
|
252
263
|
<contributor>
|
253
264
|
<role type="author"/>
|
254
265
|
<organization>
|
255
|
-
<name>
|
266
|
+
<name>Hanna Barbera</name>
|
256
267
|
</organization>
|
257
268
|
</contributor>
|
258
269
|
<contributor>
|
259
270
|
<role type="author"/>
|
260
271
|
<organization>
|
261
|
-
<name>
|
272
|
+
<name>Cartoon Network</name>
|
262
273
|
</organization>
|
263
274
|
</contributor>
|
264
275
|
<contributor>
|
265
276
|
<role type="author"/>
|
266
277
|
<organization>
|
267
|
-
<name>
|
278
|
+
<name>Ribose, Inc.</name>
|
268
279
|
</organization>
|
269
280
|
</contributor>
|
270
281
|
<contributor>
|
@@ -278,7 +289,9 @@ OUTPUT
|
|
278
289
|
<name>Slate Rock and Gravel Company</name>
|
279
290
|
<abbreviation>SRG</abbreviation>
|
280
291
|
<address>
|
281
|
-
|
292
|
+
<formattedAddress>
|
293
|
+
6 Rubble Way, Bedrock
|
294
|
+
</formattedAddress>
|
282
295
|
</address>
|
283
296
|
</organization>
|
284
297
|
</affiliation>
|
@@ -300,7 +313,7 @@ OUTPUT
|
|
300
313
|
<name>Rockhead and Quarry Cave Construction Company</name>
|
301
314
|
<abbreviation>RQCCC</abbreviation>
|
302
315
|
<address>
|
303
|
-
<formattedAddress>6A Rubble Way, Bedrock</formattedAddress>
|
316
|
+
<formattedAddress>6A Rubble Way, <br/>Bedrock</formattedAddress>
|
304
317
|
</address>
|
305
318
|
</organization>
|
306
319
|
</affiliation>
|
@@ -421,6 +434,8 @@ OUTPUT
|
|
421
434
|
:relaton-uri: F
|
422
435
|
:title-eo: Dokumenttitolo
|
423
436
|
:doctype: This is a DocType
|
437
|
+
:subdivision: Subdivision
|
438
|
+
:subdivision-abbr: SD
|
424
439
|
|
425
440
|
[abstract]
|
426
441
|
== Abstract
|
@@ -535,6 +550,105 @@ OUTPUT
|
|
535
550
|
OUTPUT
|
536
551
|
end
|
537
552
|
|
553
|
+
it "processes subdivisions" do
|
554
|
+
mock_default_publisher
|
555
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
556
|
+
= Document title
|
557
|
+
Author
|
558
|
+
:docfile: test.adoc
|
559
|
+
:nodoc:
|
560
|
+
:novalid:
|
561
|
+
:revdate: 2000-01
|
562
|
+
:published-date: 1000-01
|
563
|
+
:docnumber: 1000
|
564
|
+
:partnumber: 1-1
|
565
|
+
:tc-docnumber: 2000
|
566
|
+
:language: el
|
567
|
+
:script: Grek
|
568
|
+
:subdivision: Subdivision
|
569
|
+
:subdivision-abbr: SD
|
570
|
+
:doctype: This is a DocType
|
571
|
+
:pub-address: 1 Infinity Loop + \\
|
572
|
+
California
|
573
|
+
:pub-phone: 3333333
|
574
|
+
:pub-fax: 4444444
|
575
|
+
:pub-email: x@example.com
|
576
|
+
:pub-uri: http://www.example.com
|
577
|
+
|
578
|
+
INPUT
|
579
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
580
|
+
<bibdata type='standard'>
|
581
|
+
<title language='en' format='text/plain'>Document title</title>
|
582
|
+
<docidentifier>1000-1-1</docidentifier>
|
583
|
+
<docnumber>1000</docnumber>
|
584
|
+
<date type='published'>
|
585
|
+
<on>1000-01</on>
|
586
|
+
</date>
|
587
|
+
<contributor>
|
588
|
+
<role type='author'/>
|
589
|
+
<organization>
|
590
|
+
<name>International Standards Organization</name>
|
591
|
+
<subdivision>Subdivision</subdivision>
|
592
|
+
<abbreviation>SD</abbreviation>
|
593
|
+
<address>
|
594
|
+
<formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
|
595
|
+
</address>
|
596
|
+
<phone>3333333</phone>
|
597
|
+
<phone type='fax'>4444444</phone>
|
598
|
+
<email>x@example.com</email>
|
599
|
+
<uri>http://www.example.com</uri>
|
600
|
+
</organization>
|
601
|
+
</contributor>
|
602
|
+
<contributor>
|
603
|
+
<role type='publisher'/>
|
604
|
+
<organization>
|
605
|
+
<name>International Standards Organization</name>
|
606
|
+
<subdivision>Subdivision</subdivision>
|
607
|
+
<abbreviation>SD</abbreviation>
|
608
|
+
<address>
|
609
|
+
<formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
|
610
|
+
</address>
|
611
|
+
<phone>3333333</phone>
|
612
|
+
<phone type='fax'>4444444</phone>
|
613
|
+
<email>x@example.com</email>
|
614
|
+
<uri>http://www.example.com</uri>
|
615
|
+
</organization>
|
616
|
+
</contributor>
|
617
|
+
<version>
|
618
|
+
<revision-date>2000-01</revision-date>
|
619
|
+
</version>
|
620
|
+
<language>el</language>
|
621
|
+
<script>Grek</script>
|
622
|
+
<status>
|
623
|
+
<stage>published</stage>
|
624
|
+
</status>
|
625
|
+
<copyright>
|
626
|
+
<from>2020</from>
|
627
|
+
<owner>
|
628
|
+
<organization>
|
629
|
+
<name>International Standards Organization</name>
|
630
|
+
<subdivision>Subdivision</subdivision>
|
631
|
+
<abbreviation>SD</abbreviation>
|
632
|
+
<address>
|
633
|
+
<formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
|
634
|
+
</address>
|
635
|
+
<phone>3333333</phone>
|
636
|
+
<phone type='fax'>4444444</phone>
|
637
|
+
<email>x@example.com</email>
|
638
|
+
<uri>http://www.example.com</uri>
|
639
|
+
</organization>
|
640
|
+
</owner>
|
641
|
+
</copyright>
|
642
|
+
<ext>
|
643
|
+
<doctype>this-is-a-doctype</doctype>
|
644
|
+
</ext>
|
645
|
+
</bibdata>
|
646
|
+
<sections> </sections>
|
647
|
+
</standard-document>
|
648
|
+
|
649
|
+
OUTPUT
|
650
|
+
end
|
651
|
+
|
538
652
|
it "reads scripts into blank HTML document" do
|
539
653
|
FileUtils.rm_f "test.html"
|
540
654
|
Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
|
@@ -643,6 +757,11 @@ QU1FOiB0ZXN0Cgo=
|
|
643
757
|
)
|
644
758
|
end
|
645
759
|
|
760
|
+
def mock_default_publisher
|
761
|
+
allow_any_instance_of(::Asciidoctor::Standoc::Front).to receive(:default_publisher).and_return(
|
762
|
+
"International Standards Organization"
|
763
|
+
)
|
764
|
+
end
|
646
765
|
|
647
766
|
|
648
767
|
end
|
@@ -318,7 +318,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
318
318
|
<terms id="_" obligation="normative">
|
319
319
|
<title>Terms and definitions</title>
|
320
320
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
321
|
-
<term id="
|
321
|
+
<term id="term-term1">
|
322
322
|
<preferred>Term1</preferred>
|
323
323
|
<termnote id="_">
|
324
324
|
<p id="_">This is a note</p>
|
@@ -383,7 +383,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
383
383
|
<sections>
|
384
384
|
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
385
385
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
386
|
-
<term id="
|
386
|
+
<term id="term-term1">
|
387
387
|
<preferred>Term1</preferred>
|
388
388
|
</term>
|
389
389
|
<definitions id="_" obligation="normative" type="symbols">
|
@@ -528,7 +528,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
528
528
|
<terms id="_" obligation="normative">
|
529
529
|
<title>Terms and definitions</title>
|
530
530
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
531
|
-
<term id="
|
531
|
+
<term id="term-term1">
|
532
532
|
<preferred>Term1</preferred>
|
533
533
|
|
534
534
|
<termexample id="ABC">
|
@@ -583,7 +583,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
583
583
|
#{BLANK_HDR}
|
584
584
|
<sections>
|
585
585
|
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
586
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="
|
586
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="term-term1">
|
587
587
|
<preferred>Term1</preferred>
|
588
588
|
</term>
|
589
589
|
<definitions id="_" obligation="normative" type="symbols">
|
@@ -972,7 +972,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
972
972
|
<terms id="_" obligation="normative">
|
973
973
|
<title>Terms and definitions</title><p id="_">For the purposes of this document,
|
974
974
|
the following terms and definitions apply.</p>
|
975
|
-
<term id="
|
975
|
+
<term id="term-term1">
|
976
976
|
<preferred>Term1</preferred>
|
977
977
|
<termsource status="identical">
|
978
978
|
<origin bibitemid="ISO2191" type="inline" citeas="">
|
@@ -982,7 +982,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
982
982
|
</origin>
|
983
983
|
</termsource>
|
984
984
|
</term>
|
985
|
-
<term id='
|
985
|
+
<term id='term-term2'>
|
986
986
|
<preferred>Term2</preferred>
|
987
987
|
<definition>
|
988
988
|
<p id='_'>Definition</p>
|
@@ -1032,7 +1032,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1032
1032
|
<title>Terms and definitions</title>
|
1033
1033
|
<p id="_">For the purposes of this document,
|
1034
1034
|
the following terms and definitions apply.</p>
|
1035
|
-
<term id="
|
1035
|
+
<term id="term-term1">
|
1036
1036
|
<preferred>Term1</preferred>
|
1037
1037
|
<termsource status="modified">
|
1038
1038
|
<origin bibitemid="ISO2191" type="inline" citeas="">
|
@@ -1045,7 +1045,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1045
1045
|
</modification>
|
1046
1046
|
</termsource>
|
1047
1047
|
</term>
|
1048
|
-
<term id='
|
1048
|
+
<term id='term-term2'>
|
1049
1049
|
<preferred>Term2</preferred>
|
1050
1050
|
<definition>
|
1051
1051
|
<p id='_'>Definition</p>
|