isodoc 1.2.4 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cd5c7cab435113879315a8de5d3219df7577d057df5adee3a87f7431b9d17f7
4
- data.tar.gz: 22f07d9de5b5b8a26c57ca5321a53fafd591e6703615921d9a79d939c0276295
3
+ metadata.gz: 1f76ecc765fd3176ab1e46bd2b91b2a1d5746554772047b7137581ecc54a1ab9
4
+ data.tar.gz: b98fe5eee6522b4d5992c4213f3180e1c95f92f358b0c56ff3a2b5f66973a900
5
5
  SHA512:
6
- metadata.gz: 1ca2bd4cf9b70ea4eb12d118c26e66e90340070453e132db89e7b6748a1a02f8a10f62c5944e2b1ffe6e18d4a69504b08f7b687ec6b8a573983f58d03de12b48
7
- data.tar.gz: 1b6702e74e5041ad95509cf1b8655e044f36f27a0fa3cbd12e6ac82684e6b535ed1c3ad9ea6ad938ab2cb42a3880f2e0153ddb0424bf322d4238806616582a54
6
+ metadata.gz: 1a2649fdf7365e2554c0e0bdec19aa0cf6e50fad624d4252dd99aa88d436b95b1ff24e823c6a0a9be4afa7e875921b11310e67595b308a9c81c8758b6e8cf302
7
+ data.tar.gz: d21cdae8851e757e999a54809868e15a8004fcc387afa78e79e60a4605df07108c454fc3c04e0a3e79f3a5c14af9ca8cdbbb855eca9fa47e254e3ff4a40d3ac4
@@ -98,8 +98,9 @@ module IsoDoc
98
98
 
99
99
  def doctype(isoxml, _out)
100
100
  b = isoxml&.at(ns('//bibdata/ext/doctype'))&.text || return
101
- t = b.split(/[- ]/).map(&:capitalize).join(' ')
102
- set(:doctype, t)
101
+ set(:doctype, status_print(b))
102
+ b = isoxml&.at(ns('//local_bibdata/ext/doctype'))&.text || return
103
+ set(:doctype_display, status_print(b))
103
104
  end
104
105
 
105
106
  def iso?(org)
@@ -135,9 +136,14 @@ module IsoDoc
135
136
  docstatus = isoxml.at(ns('//bibdata/status/stage'))
136
137
  set(:unpublished, true)
137
138
  if docstatus
139
+ docstatus_local = isoxml.at(ns('//local_bibdata/status/stage'))
138
140
  set(:stage, status_print(docstatus.text))
141
+ docstatus_local and
142
+ set(:stage_display, status_print(docstatus_local.text))
139
143
  (i = isoxml&.at(ns('//bibdata/status/substage'))&.text) &&
140
144
  set(:substage, i)
145
+ (i = isoxml&.at(ns('//local_bibdata/status/substage'))&.text) &&
146
+ set(:substage_display, i)
141
147
  (i = isoxml&.at(ns('//bibdata/status/iteration'))&.text) &&
142
148
  set(:iteration, i)
143
149
  set(:unpublished, unpublished(docstatus.text))
@@ -148,7 +154,7 @@ module IsoDoc
148
154
 
149
155
  def stage_abbr(docstatus)
150
156
  status_print(docstatus).split(/ /)
151
- .map { |s| s[0].upcase }.join('')
157
+ .map { |s| s[0].upcase }.join('')
152
158
  end
153
159
 
154
160
  def unpublished(status)
@@ -156,7 +162,7 @@ module IsoDoc
156
162
  end
157
163
 
158
164
  def status_print(status)
159
- status.split(/-/).map(&:capitalize).join(' ')
165
+ status.split(/[- ]/).map(&:capitalize).join(' ')
160
166
  end
161
167
 
162
168
  def docid(isoxml, _out)
@@ -0,0 +1,24 @@
1
+ module IsoDoc
2
+ class PresentationXMLConvert < ::IsoDoc::Convert
3
+ def bibdata(docxml)
4
+ a = docxml.at(ns("//bibdata")) or return
5
+ b = a.dup
6
+ b.name = "local_bibdata"
7
+ bibdata_i18n(b)
8
+ a.next = b
9
+ end
10
+
11
+ def bibdata_i18n(b)
12
+ hash_translate(b, @i18n.get["doctype_dict"], "./ext/doctype")
13
+ hash_translate(b, @i18n.get["stage_dict"], "./status/stage")
14
+ hash_translate(b, @i18n.get["substage_dict"], "./status/substage")
15
+ end
16
+
17
+ def hash_translate(bibdata, hash, xpath)
18
+ hash.is_a? Hash or return
19
+ x = bibdata.at(ns(xpath)) or return
20
+ hash[x.text] or return
21
+ x.children = hash[x.text]
22
+ end
23
+ end
24
+ end
@@ -7,17 +7,25 @@ module IsoDoc
7
7
  def anchor_linkend(node, linkend)
8
8
  if node["citeas"].nil? && node["bibitemid"]
9
9
  return @xrefs.anchor(node["bibitemid"] ,:xref) || "???"
10
+ elsif node["target"] && node["droploc"]
11
+ return @xrefs.anchor(node["target"], :value) ||
12
+ @xrefs.anchor(node["target"], :label) ||
13
+ @xrefs.anchor(node["target"], :xref) || "???"
10
14
  elsif node["target"] && !/.#./.match(node["target"])
11
- linkend = @xrefs.anchor(node["target"], :xref)
12
- container = @xrefs.anchor(node["target"], :container, false)
13
- (container && get_note_container_id(node) != container &&
14
- @xrefs.get[node["target"]]) &&
15
- linkend = prefix_container(container, linkend, node["target"])
16
- linkend = capitalise_xref(node, linkend)
15
+ linkend = anchor_linkend1(node)
17
16
  end
18
17
  linkend || "???"
19
18
  end
20
19
 
20
+ def anchor_linkend1(node)
21
+ linkend = @xrefs.anchor(node["target"], :xref)
22
+ container = @xrefs.anchor(node["target"], :container, false)
23
+ (container && get_note_container_id(node) != container &&
24
+ @xrefs.get[node["target"]]) &&
25
+ linkend = prefix_container(container, linkend, node["target"])
26
+ capitalise_xref(node, linkend)
27
+ end
28
+
21
29
  def capitalise_xref(node, linkend)
22
30
  return linkend unless %w(Latn Cyrl Grek).include? @script
23
31
  return linkend&.capitalize if node["case"] == "capital"
@@ -59,14 +67,19 @@ module IsoDoc
59
67
  refs.each_with_index do |r, i|
60
68
  delim = ","
61
69
  delim = ";" if r.name == "localityStack" && i>0
62
- if r.name == "localityStack"
63
- r.elements.each_with_index do |rr, j|
64
- ret += eref_localities0(rr, j, target, delim)
65
- delim = ","
66
- end
67
- else
68
- ret += eref_localities0(r, i, target, delim)
70
+ ret = eref_locality_stack(r, i, target, delim, ret)
71
+ end
72
+ ret
73
+ end
74
+
75
+ def eref_locality_stack(r, i, target, delim, ret)
76
+ if r.name == "localityStack"
77
+ r.elements.each_with_index do |rr, j|
78
+ ret += eref_localities0(rr, j, target, delim)
79
+ delim = ","
69
80
  end
81
+ else
82
+ ret += eref_localities0(r, i, target, delim)
70
83
  end
71
84
  ret
72
85
  end
@@ -79,7 +92,7 @@ module IsoDoc
79
92
  end
80
93
  end
81
94
 
82
- # TODO: move to localization file
95
+ # TODO: move to localization file
83
96
  def eref_localities1_zh(target, type, from, to, delim)
84
97
  ret = "#{delim} 第#{from.text}" if from
85
98
  ret += "&ndash;#{to.text}" if to
@@ -1,6 +1,7 @@
1
1
  require_relative "presentation_function/block"
2
2
  require_relative "presentation_function/inline"
3
3
  require_relative "presentation_function/section"
4
+ require_relative "presentation_function/bibdata"
4
5
 
5
6
  module IsoDoc
6
7
  class PresentationXMLConvert < ::IsoDoc::Convert
@@ -14,10 +15,12 @@ module IsoDoc
14
15
  @xrefs.parse docxml
15
16
  info docxml, nil
16
17
  conversions(docxml)
18
+ docxml.root["type"] = "presentation"
17
19
  docxml.to_xml
18
20
  end
19
21
 
20
22
  def conversions(docxml)
23
+ bibdata docxml
21
24
  section docxml
22
25
  block docxml
23
26
  inline docxml
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "1.2.4".freeze
2
+ VERSION = "1.2.5".freeze
3
3
  end
@@ -35,11 +35,15 @@ module IsoDoc::XrefGen
35
35
  end
36
36
 
37
37
  def anchor_struct_xref(lbl, elem)
38
+ l10n("#{elem} #{anchor_struct_value(lbl, elem)}")
39
+ end
40
+
41
+ def anchor_struct_value(lbl, elem)
38
42
  case elem
39
- when @labels["formula"] then l10n("#{elem} (#{lbl})")
40
- when @labels["inequality"] then l10n("#{elem} (#{lbl})")
43
+ when @labels["formula"] then "(#{lbl})"
44
+ when @labels["inequality"] then "(#{lbl})"
41
45
  else
42
- l10n("#{elem} #{lbl}")
46
+ lbl
43
47
  end
44
48
  end
45
49
 
@@ -50,6 +54,7 @@ module IsoDoc::XrefGen
50
54
  ret[:xref].gsub!(/ $/, "")
51
55
  ret[:container] = @klass.get_clause_id(container) unless container.nil?
52
56
  ret[:type] = type
57
+ ret[:value] = anchor_struct_value(lbl, elem)
53
58
  ret
54
59
  end
55
60
  end
@@ -36,7 +36,7 @@ module IsoDoc::XrefGen
36
36
  return if n["id"].nil? || n["id"].empty?
37
37
  c.increment(n)
38
38
  @anchors[n["id"]] =
39
- { label: termnote_label(c.print), type: "termnote",
39
+ { label: termnote_label(c.print), type: "termnote", value: c.print,
40
40
  xref: l10n("#{anchor(t['id'], :xref)}, "\
41
41
  "#{@labels["note_xref"]} #{c.print}") }
42
42
  end
@@ -52,7 +52,7 @@ module IsoDoc::XrefGen
52
52
  c.increment(n)
53
53
  idx = examples.size == 1 && !n["number"] ? "" : c.print
54
54
  @anchors[n["id"]] = {
55
- type: "termexample", label: idx,
55
+ type: "termexample", label: idx, value: c.print,
56
56
  xref: l10n("#{anchor(t['id'], :xref)}, "\
57
57
  "#{@labels["example_xref"]} #{c.print}") }
58
58
  end
@@ -113,7 +113,7 @@ module IsoDoc::XrefGen
113
113
 
114
114
  def annex_names(clause, num)
115
115
  @anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
116
- type: "clause",
116
+ type: "clause", value: num.to_s,
117
117
  xref: "#{@labels["annex"]} #{num}", level: 1 }
118
118
  if a = single_annex_special_section(clause)
119
119
  annex_names1(a, "#{num}", 1)
@@ -13,4 +13,13 @@ inform_annex: informa
13
13
  all_parts: ĉiuj partoj
14
14
  locality: {
15
15
  table: Tabelo
16
+ }
17
+ doctype_dict: {
18
+ brochure: broŝuro
19
+ }
20
+ stage_dict: {
21
+ published: publikigita
16
22
  }
23
+ substage_dict: {
24
+ withdrawn: fortirita
25
+ }
@@ -84,7 +84,7 @@ RSpec.describe IsoDoc do
84
84
  </standard-document>
85
85
  INPUT
86
86
  presxml = <<~OUTPUT
87
- <standard-document xmlns="https://www.metanorma.org/ns/standoc">
87
+ <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="presentation">
88
88
  <bibdata type="standard">
89
89
  <title language="en" format="text/plain">Document title</title>
90
90
  <language>en</language>
@@ -99,6 +99,20 @@ RSpec.describe IsoDoc do
99
99
  <doctype>article</doctype>
100
100
  </ext>
101
101
  </bibdata>
102
+ <local_bibdata type='standard'>
103
+ <title language='en' format='text/plain'>Document title</title>
104
+ <language>en</language>
105
+ <script>Latn</script>
106
+ <status>
107
+ <stage>published</stage>
108
+ </status>
109
+ <copyright>
110
+ <from>2020</from>
111
+ </copyright>
112
+ <ext>
113
+ <doctype>article</doctype>
114
+ </ext>
115
+ </local_bibdata>
102
116
  <sections>
103
117
  <clause id="A" inline-header="false" obligation="normative">
104
118
  <title depth="1">1.<tab/>Change Clause</title>
@@ -249,7 +263,7 @@ RSpec.describe IsoDoc do
249
263
  </iso-standard>
250
264
  INPUT
251
265
  <?xml version='1.0'?>
252
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
266
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
253
267
  <preface>
254
268
  <foreword>
255
269
  <note id='A' keep-with-next='true' keep-lines-together='true'>
@@ -352,7 +366,7 @@ OUTPUT
352
366
  </iso-standard>
353
367
  INPUT
354
368
  <?xml version='1.0'?>
355
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
369
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
356
370
  <preface>
357
371
  <foreword>
358
372
  <note id='note1'>
@@ -640,7 +654,7 @@ B</pre>
640
654
  </iso-standard>
641
655
  INPUT
642
656
  <?xml version='1.0'?>
643
- <iso-standard xmlns="http://riboseinc.com/isoxml">
657
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
644
658
  <preface><foreword>
645
659
  <figure id="figureA-1" keep-with-next="true" keep-lines-together="true">
646
660
  <name>Figure 1&#xA0;&#x2014; Split-it-right <em>sample</em> divider<fn reference="1"><p>X</p></fn></name>
@@ -940,7 +954,7 @@ OUTPUT
940
954
  </iso-standard>
941
955
  INPUT
942
956
  <?xml version='1.0'?>
943
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
957
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
944
958
  <preface>
945
959
  <foreword>
946
960
  <example id='samplecode' keep-with-next='true' keep-lines-together='true'>
@@ -1056,7 +1070,7 @@ OUTPUT
1056
1070
  </iso-standard>
1057
1071
  INPUT
1058
1072
  <?xml version='1.0'?>
1059
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1073
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1060
1074
  <preface>
1061
1075
  <foreword>
1062
1076
  <example id='samplecode'>
@@ -1092,7 +1106,7 @@ Que?
1092
1106
  </iso-standard>
1093
1107
  INPUT
1094
1108
  <?xml version='1.0'?>
1095
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1109
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1096
1110
  <preface>
1097
1111
  <foreword>
1098
1112
  <sourcecode lang='ruby' id='samplecode'>
@@ -1330,7 +1344,7 @@ Que?
1330
1344
  </iso-standard>
1331
1345
  INPUT
1332
1346
  <?xml version='1.0'?>
1333
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1347
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1334
1348
  <preface>
1335
1349
  <foreword>
1336
1350
  <formula id='_be9158af-7e93-4ee2-90c5-26d31c181934' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
@@ -1583,7 +1597,7 @@ it "processes blockquotes (Presentation XML)" do
1583
1597
  </iso-standard>
1584
1598
  INPUT
1585
1599
  <?xml version='1.0'?>
1586
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1600
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1587
1601
  <preface>
1588
1602
  <foreword>
1589
1603
  <quote id='_044bd364-c832-4b78-8fea-92242402a1d1'>
@@ -1722,7 +1736,7 @@ it "processes blockquotes (Presentation XML)" do
1722
1736
  </iso-standard>
1723
1737
  INPUT
1724
1738
  <?xml version='1.0'?>
1725
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1739
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1726
1740
  <preface>
1727
1741
  <foreword>
1728
1742
  <permission id='_' keep-with-next='true' keep-lines-together='true'>
@@ -2082,7 +2096,7 @@ Inherits: <a href='#rfc2616'>RFC 2616 (HTTP/1.1)</a>
2082
2096
  </iso-standard>
2083
2097
  INPUT
2084
2098
  <?xml version='1.0'?>
2085
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2099
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2086
2100
  <preface>
2087
2101
  <foreword>
2088
2102
  <requirement id='A' unnumbered='true' keep-with-next='true' keep-lines-together='true'>
@@ -2282,11 +2296,15 @@ end
2282
2296
  </iso-standard>
2283
2297
  INPUT
2284
2298
  <?xml version='1.0'?>
2285
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2299
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2286
2300
  <bibdata>
2287
2301
  <language>fr</language>
2288
2302
  <script>Latn</script>
2289
2303
  </bibdata>
2304
+ <local_bibdata>
2305
+ <language>fr</language>
2306
+ <script>Latn</script>
2307
+ </local_bibdata>
2290
2308
  <preface>
2291
2309
  <foreword>
2292
2310
  <requirement id='A' unnumbered='true'>
@@ -2351,6 +2369,10 @@ end
2351
2369
  <language>fr</language>
2352
2370
  <script>Latn</script>
2353
2371
  </bibdata>
2372
+ <local_bibdata>
2373
+ <language>fr</language>
2374
+ <script>Latn</script>
2375
+ </local_bibdata>
2354
2376
  <preface><foreword>
2355
2377
  <requirement id="A" unnumbered="true">
2356
2378
  <name>Exigence</name>
@@ -2513,7 +2535,7 @@ end
2513
2535
  </iso-standard>
2514
2536
  INPUT
2515
2537
  <?xml version='1.0'?>
2516
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2538
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2517
2539
  <preface>
2518
2540
  <foreword>
2519
2541
  <recommendation id='_' obligation='shall,could' keep-with-next='true' keep-lines-together='true'>
@@ -2677,10 +2699,13 @@ end
2677
2699
  </preface></itu-standard>
2678
2700
  INPUT
2679
2701
  <?xml version='1.0'?>
2680
- <itu-standard xmlns='http://riboseinc.com/isoxml'>
2702
+ <itu-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2681
2703
  <bibdata>
2682
2704
  <language>en</language>
2683
2705
  </bibdata>
2706
+ <local_bibdata>
2707
+ <language>en</language>
2708
+ </local_bibdata>
2684
2709
  <preface>
2685
2710
  <foreword>
2686
2711
  <figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
@@ -2709,6 +2734,9 @@ end
2709
2734
  <bibdata>
2710
2735
  <language>en</language>
2711
2736
  </bibdata>
2737
+ <local_bibdata>
2738
+ <language>en</language>
2739
+ </local_bibdata>
2712
2740
  <preface>
2713
2741
  <foreword>
2714
2742
  <figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
@@ -2751,6 +2779,9 @@ OUTPUT
2751
2779
  <bibdata>
2752
2780
  <language>en</language>
2753
2781
  </bibdata>
2782
+ <local_bibdata>
2783
+ <language>en</language>
2784
+ </local_bibdata>
2754
2785
  <preface>
2755
2786
  <foreword>
2756
2787
  <figure id='_' class='pseudocode' keep-with-next='true' keep-lines-together='true'>
@@ -68,10 +68,13 @@ RSpec.describe IsoDoc do
68
68
  INPUT
69
69
 
70
70
  presxml = <<~"PRESXML"
71
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
71
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
72
72
  <bibdata>
73
73
  <language>en</language>
74
74
  </bibdata>
75
+ <local_bibdata>
76
+ <language>en</language>
77
+ </local_bibdata>
75
78
  <preface>
76
79
  <foreword obligation='informative'>
77
80
  <title>Foreword</title>
@@ -296,10 +299,13 @@ PRESXML
296
299
  </iso-standard>
297
300
  INPUT
298
301
  <?xml version='1.0'?>
299
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
302
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
300
303
  <bibdata>
301
304
  <language>tlh</language>
302
305
  </bibdata>
306
+ <local_bibdata>
307
+ <language>tlh</language>
308
+ </local_bibdata>
303
309
  <preface>
304
310
  <foreword obligation='informative'>
305
311
  <title>Foreword</title>
@@ -449,10 +455,13 @@ PRESXML
449
455
  INPUT
450
456
 
451
457
  presxml = <<~"PRESXML"
452
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
458
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
453
459
  <bibdata>
454
460
  <language>fr</language>
455
461
  </bibdata>
462
+ <local_bibdata>
463
+ <language>fr</language>
464
+ </local_bibdata>
456
465
  <preface>
457
466
  <foreword obligation='informative'>
458
467
  <title>Foreword</title>
@@ -689,11 +698,15 @@ PRESXML
689
698
  INPUT
690
699
 
691
700
  presxml = <<~"PRESXML"
692
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
701
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
693
702
  <bibdata>
694
703
  <language>zh</language>
695
704
  <script>Hans</script>
696
705
  </bibdata>
706
+ <local_bibdata>
707
+ <language>zh</language>
708
+ <script>Hans</script>
709
+ </local_bibdata>
697
710
  <preface>
698
711
  <foreword obligation='informative'>
699
712
  <title>Foreword</title>
@@ -872,6 +885,13 @@ PRESXML
872
885
  <bibdata>
873
886
  <language>eo</language>
874
887
  <script>Latn</script>
888
+ <status>
889
+ <stage>published</stage>
890
+ <substage>withdrawn</substage>
891
+ </status>
892
+ <ext>
893
+ <doctype>brochure</doctype>
894
+ </ext>
875
895
  </bibdata>
876
896
  <preface>
877
897
  <foreword obligation="informative">
@@ -944,11 +964,29 @@ PRESXML
944
964
  INPUT
945
965
 
946
966
  presxml = <<~OUTPUT
947
- <iso-standard xmlns="http://riboseinc.com/isoxml">
967
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
948
968
  <bibdata>
949
969
  <language>eo</language>
950
970
  <script>Latn</script>
971
+ <status>
972
+ <stage>published</stage>
973
+ <substage>withdrawn</substage>
974
+ </status>
975
+ <ext>
976
+ <doctype>brochure</doctype>
977
+ </ext>
951
978
  </bibdata>
979
+ <local_bibdata>
980
+ <language>eo</language>
981
+ <script>Latn</script>
982
+ <status>
983
+ <stage>publikigita</stage>
984
+ <substage>fortirita</substage>
985
+ </status>
986
+ <ext>
987
+ <doctype>bro&#x15D;uro</doctype>
988
+ </ext>
989
+ </local_bibdata>
952
990
  <preface>
953
991
  <foreword obligation="informative">
954
992
  <title>Foreword</title>
@@ -20,7 +20,7 @@ RSpec.describe IsoDoc do
20
20
  </iso-standard>
21
21
  INPUT
22
22
  <?xml version='1.0'?>
23
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
23
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
24
24
  <sections>
25
25
  <clause id='A'>
26
26
  <title>1.</title>
@@ -57,6 +57,48 @@ INPUT
57
57
  OUTPUT
58
58
  end
59
59
 
60
+ it "droplocs xrefs" do
61
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
62
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
63
+ <sections>
64
+ <clause id="A">
65
+ <formula id="B">
66
+ </formula>
67
+ </clause>
68
+ <clause id="C">
69
+ <p>This is <xref target="A"/> and <xref target="B"/>.
70
+ This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
71
+ </clause>
72
+ </sections>
73
+ </iso-standard>
74
+ INPUT
75
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
76
+ <sections>
77
+ <clause id='A'>
78
+ <title>1.</title>
79
+ <formula id='B'>
80
+ <name>1</name>
81
+ </formula>
82
+ </clause>
83
+ <clause id='C'>
84
+ <title>2.</title>
85
+ <p>
86
+ This is
87
+ <xref target='A'>kla&#x16D;zo 1</xref>
88
+ and
89
+ <xref target='B'>kla&#x16D;zo 1, Formula (1)</xref>
90
+ . This is
91
+ <xref target='A' droploc='true'>1</xref>
92
+ and
93
+ <xref target='B' droploc='true'>(1)</xref>
94
+ .
95
+ </p>
96
+ </clause>
97
+ </sections>
98
+ </iso-standard>
99
+ OUTPUT
100
+ end
101
+
60
102
  it "processes inline formatting" do
61
103
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
62
104
  <iso-standard xmlns="http://riboseinc.com/isoxml">
@@ -238,7 +280,7 @@ end
238
280
  </iso-standard>
239
281
  INPUT
240
282
  presxml = <<~OUTPUT
241
- <iso-standard xmlns="http://riboseinc.com/isoxml">
283
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
242
284
  <preface><foreword>
243
285
  <p>
244
286
  <ul>
@@ -606,7 +648,7 @@ OUTPUT
606
648
  </iso-standard>
607
649
  INPUT
608
650
  presxml = <<~OUTPUT
609
- <iso-standard xmlns="http://riboseinc.com/isoxml">
651
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
610
652
  <preface><foreword>
611
653
  <p>
612
654
  <eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
@@ -728,7 +770,7 @@ html = <<~OUTPUT
728
770
  </iso-standard>
729
771
  INPUT
730
772
  presxml = <<~OUTPUT
731
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
773
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
732
774
  <preface>
733
775
  <foreword>
734
776
  <p>
@@ -955,7 +997,7 @@ it "cases xrefs" do
955
997
  </iso-standard>
956
998
  INPUT
957
999
  <?xml version='1.0'?>
958
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1000
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
959
1001
  <sections>
960
1002
  <clause id='A'>
961
1003
  <title>1.</title>
@@ -95,6 +95,8 @@ RSpec.describe IsoDoc do
95
95
  <doctype>international-standard</doctype>
96
96
  </ext>
97
97
  </bibdata>
98
+ <local_bibdata type="standard">
99
+ </local_bibdata>
98
100
  </iso-standard>
99
101
  INPUT
100
102
  {:accesseddate=>"2012",
@@ -127,7 +129,7 @@ INPUT
127
129
  :receiveddate=>"XXX",
128
130
  :revdate=>"2016-05-01",
129
131
  :revdate_monthyear=>"May 2016",
130
- :stage=>"Committee draft",
132
+ :stage=>"Committee Draft",
131
133
  :stageabbr=>"CD",
132
134
  :substage=>"Withdrawn",
133
135
  :transmitteddate=>"2020",
@@ -125,10 +125,13 @@ RSpec.describe IsoDoc do
125
125
  </iso-standard>
126
126
  INPUT
127
127
  presxml = <<~PRESXML
128
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
128
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
129
129
  <bibdata>
130
130
  <language>en</language>
131
131
  </bibdata>
132
+ <local_bibdata>
133
+ <language>en</language>
134
+ </local_bibdata>
132
135
  <preface>
133
136
  <foreword>
134
137
  <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
@@ -260,7 +260,7 @@ OUTPUT
260
260
  INPUT
261
261
 
262
262
  presxml = <<~"PRESXML"
263
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
263
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
264
264
  <boilerplate>
265
265
  <copyright-statement>
266
266
  <clause>
@@ -755,7 +755,7 @@ OUTPUT
755
755
  </iso-standard>
756
756
  INPUT
757
757
  <?xml version='1.0'?>
758
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
758
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
759
759
  <preface>
760
760
  <foreword obligation='informative'>
761
761
  <title>Foreword</title>
@@ -849,7 +849,7 @@ OUTPUT
849
849
  </iso-standard>
850
850
  INPUT
851
851
  <?xml version='1.0'?>
852
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
852
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
853
853
  <preface>
854
854
  <introduction id='B' obligation='informative'>
855
855
  <title>Introduction</title>
@@ -876,7 +876,7 @@ OUTPUT
876
876
  INPUT
877
877
 
878
878
  presxml = <<~"OUTPUT"
879
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
879
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
880
880
  <sections>
881
881
  <terms id='H' obligation='normative'>
882
882
  <title depth='1'>1.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
@@ -921,7 +921,7 @@ OUTPUT
921
921
  INPUT
922
922
 
923
923
  presxml = <<~"PRESXML"
924
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
924
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
925
925
  <sections>
926
926
  <clause id='M' inline-header='false' obligation='normative'>
927
927
  <title depth='1'>1.<tab/>Clause 4</title>
@@ -973,7 +973,7 @@ OUTPUT
973
973
  </iso-standard>
974
974
  INPUT
975
975
  <?xml version='1.0'?>
976
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
976
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
977
977
  <sections>
978
978
  <clause id='M' inline-header='false' obligation='normative'>
979
979
  <title depth="1">Clause 4</title>
@@ -991,7 +991,7 @@ OUTPUT
991
991
 
992
992
  it "processes sections without titles" do
993
993
  expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
994
- <iso-standard xmlns="http://riboseinc.com/isoxml">
994
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
995
995
  <preface>
996
996
  <introduction id="M" inline-header="false" obligation="normative"><clause id="N" inline-header="false" obligation="normative">
997
997
  <title>Intro</title>
@@ -1009,7 +1009,7 @@ OUTPUT
1009
1009
  </iso-standard>
1010
1010
  INPUT
1011
1011
  <?xml version='1.0'?>
1012
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1012
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1013
1013
  <preface>
1014
1014
  <introduction id='M' inline-header='false' obligation='normative'>
1015
1015
  <clause id='N' inline-header='false' obligation='normative'>
@@ -1059,7 +1059,7 @@ OUTPUT
1059
1059
  </iso-standard>
1060
1060
  INPUT
1061
1061
  presxml = <<~OUTPUT
1062
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1062
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
1063
1063
  <bibliography>
1064
1064
  <clause id="D" obligation="informative">
1065
1065
  <title depth="1">Bibliography</title>
@@ -65,7 +65,7 @@ RSpec.describe IsoDoc do
65
65
  INPUT
66
66
 
67
67
  presxml = <<~OUTPUT
68
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
68
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
69
69
  <preface>
70
70
  <foreword>
71
71
  <table id='tableD-1' alt='tool tip' summary='long desc' width='70%' keep-with-next='true' keep-lines-together='true'>
@@ -74,7 +74,7 @@ RSpec.describe IsoDoc do
74
74
  INPUT
75
75
 
76
76
  presxml = <<~"PRESXML"
77
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
77
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
78
78
  <sections>
79
79
  <terms id='_terms_and_definitions' obligation='normative'>
80
80
  <title depth='1'>
@@ -14,7 +14,7 @@ RSpec.describe IsoDoc do
14
14
  </iso-standard
15
15
  INPUT
16
16
  <?xml version='1.0'?>
17
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
17
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
18
18
  <preface>
19
19
  <foreword>
20
20
  <p>
@@ -167,7 +167,7 @@ RSpec.describe IsoDoc do
167
167
  </iso-standard>
168
168
  INPUT
169
169
  <?xml version='1.0'?>
170
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
170
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
171
171
  <preface>
172
172
  <foreword>
173
173
  <p>
@@ -377,7 +377,7 @@ RSpec.describe IsoDoc do
377
377
  </iso-standard>
378
378
  INPUT
379
379
  <?xml version='1.0'?>
380
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
380
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
381
381
  <preface>
382
382
  <foreword id='fwd'>
383
383
  <p>
@@ -546,7 +546,7 @@ RSpec.describe IsoDoc do
546
546
  </iso-standard>
547
547
  INPUT
548
548
  <?xml version='1.0'?>
549
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
549
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
550
550
  <preface>
551
551
  <foreword id='fwd'>
552
552
  <p>
@@ -684,7 +684,7 @@ RSpec.describe IsoDoc do
684
684
  </iso-standard>
685
685
  INPUT
686
686
  <?xml version='1.0'?>
687
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
687
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
688
688
  <preface>
689
689
  <foreword>
690
690
  <p>
@@ -844,7 +844,7 @@ RSpec.describe IsoDoc do
844
844
  </iso-standard>
845
845
  INPUT
846
846
  <?xml version='1.0'?>
847
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
847
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
848
848
  <preface>
849
849
  <foreword>
850
850
  <p>
@@ -1002,7 +1002,7 @@ RSpec.describe IsoDoc do
1002
1002
  </iso-standard>
1003
1003
  INPUT
1004
1004
  <?xml version='1.0'?>
1005
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1005
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1006
1006
  <preface>
1007
1007
  <foreword>
1008
1008
  <p>
@@ -1162,7 +1162,7 @@ RSpec.describe IsoDoc do
1162
1162
  </iso-standard>
1163
1163
  INPUT
1164
1164
  <?xml version='1.0'?>
1165
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1165
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1166
1166
  <preface>
1167
1167
  <foreword>
1168
1168
  <p>
@@ -1322,7 +1322,7 @@ RSpec.describe IsoDoc do
1322
1322
  </iso-standard>
1323
1323
  INPUT
1324
1324
  <?xml version='1.0'?>
1325
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1325
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1326
1326
  <preface>
1327
1327
  <foreword>
1328
1328
  <p>
@@ -1465,7 +1465,7 @@ OUTPUT
1465
1465
  </iso-standard>
1466
1466
  INPUT
1467
1467
  <?xml version='1.0'?>
1468
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1468
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1469
1469
  <preface>
1470
1470
  <foreword>
1471
1471
  <p>
@@ -1656,7 +1656,7 @@ OUTPUT
1656
1656
  </iso-standard>
1657
1657
  INPUT
1658
1658
  <?xml version='1.0'?>
1659
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1659
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1660
1660
  <preface>
1661
1661
  <foreword>
1662
1662
  <p>
@@ -1831,7 +1831,7 @@ OUTPUT
1831
1831
  </iso-standard>
1832
1832
  INPUT
1833
1833
  <?xml version='1.0'?>
1834
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1834
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1835
1835
  <preface>
1836
1836
  <foreword>
1837
1837
  <p>
@@ -1976,7 +1976,7 @@ OUTPUT
1976
1976
  </iso-standard>
1977
1977
  INPUT
1978
1978
  <?xml version='1.0'?>
1979
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
1979
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1980
1980
  <preface>
1981
1981
  <foreword obligation='informative'>
1982
1982
  <title>Foreword</title>
@@ -2191,7 +2191,7 @@ OUTPUT
2191
2191
  </iso-standard>
2192
2192
  INPUT
2193
2193
  <?xml version='1.0'?>
2194
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2194
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2195
2195
  <preface>
2196
2196
  <foreword>
2197
2197
  <p>
@@ -2355,7 +2355,7 @@ OUTPUT
2355
2355
  </iso-standard>
2356
2356
  INPUT
2357
2357
  <?xml version='1.0'?>
2358
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2358
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2359
2359
  <preface>
2360
2360
  <foreword>
2361
2361
  <p>
@@ -2491,7 +2491,7 @@ OUTPUT
2491
2491
  </iso-standard>
2492
2492
  INPUT
2493
2493
  <?xml version='1.0'?>
2494
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2494
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2495
2495
  <preface>
2496
2496
  <foreword>
2497
2497
  <p>
@@ -2592,7 +2592,7 @@ OUTPUT
2592
2592
  </iso-standard>
2593
2593
  INPUT
2594
2594
  <?xml version='1.0'?>
2595
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2595
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2596
2596
  <preface>
2597
2597
  <foreword id='fwd'>
2598
2598
  <p>
@@ -2710,7 +2710,7 @@ INPUT
2710
2710
  </iso-standard>
2711
2711
  INPUT
2712
2712
  <?xml version='1.0'?>
2713
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
2713
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
2714
2714
  <preface>
2715
2715
  <foreword id='fwd'>
2716
2716
  <p>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -352,6 +352,7 @@ files:
352
352
  - lib/isodoc/metadata.rb
353
353
  - lib/isodoc/metadata_date.rb
354
354
  - lib/isodoc/pdf_convert.rb
355
+ - lib/isodoc/presentation_function/bibdata.rb
355
356
  - lib/isodoc/presentation_function/block.rb
356
357
  - lib/isodoc/presentation_function/inline.rb
357
358
  - lib/isodoc/presentation_function/section.rb