metanorma-ieee 1.5.6 → 1.6.0

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.
@@ -7,6 +7,11 @@ module IsoDoc
7
7
  end
8
8
 
9
9
  def bibdata_dates(bib)
10
+ bibdata_date_format(bib)
11
+ bibdata_date_defaults(bib)
12
+ end
13
+
14
+ def bibdata_date_format(bib)
10
15
  bib.xpath(ns("./date")).each do |d|
11
16
  d.next = d.dup
12
17
  d.next["format"] = "ddMMMyyyy"
@@ -16,6 +21,18 @@ module IsoDoc
16
21
  end
17
22
  end
18
23
 
24
+ def bibdata_date_defaults(bib)
25
+ bib.at(ns("./date[@type = 'ieee-sasb-approved']")) and return
26
+ ins = bib.at(ns("./docnumber")) ||
27
+ bib.at(ns("./docidentifier[last()]")) ||
28
+ bib.at(ns("./title[last()]")) or return
29
+ ins.next = <<~XML
30
+ <date type="ieee-sasb-approved" format="text">
31
+ <on>&lt;Date Approved&gt;</on>
32
+ </date>
33
+ XML
34
+ end
35
+
19
36
  def ddMMMyyyy(isodate)
20
37
  isodate.nil? and return nil
21
38
  arr = isodate.split("-")
@@ -29,7 +29,7 @@ module IsoDoc
29
29
 
30
30
  def author_date(xml, renderings)
31
31
  author_date?(xml) or return
32
- cit = renderings[xml["id"]][:citation]
32
+ cit = renderings[xml["id"]][:citation][:author_date]
33
33
  xml << "<docidentifier type='metanorma'>#{cit}</docidentifier>"
34
34
  xml.at(ns("./biblio-tag"))&.remove
35
35
  xml << "<biblio-tag>#{cit}, </biblio-tag>"
@@ -53,7 +53,7 @@ module IsoDoc
53
53
  template: "{{ creatornames }}",
54
54
  extenttemplate: { (bib["type"] || "misc").to_sym => "{{page}}" },
55
55
  sizetemplate: { (bib["type"] || "misc").to_sym => "{{data}}" })
56
- .render1(RelatonBib::XMLParser.from_xml(bib.to_xml))
56
+ .render1(RelatonBib::XMLParser.from_xml(bib.to_xml), false)
57
57
  end
58
58
 
59
59
  def bibliography_bibitem_number1(bibitem, idx, normative)
@@ -17,24 +17,16 @@ module IsoDoc
17
17
 
18
18
  # Style manual 19
19
19
  def anchor_linkend(node, linkend)
20
- if node["citeas"] && i = @bibanchors[node["bibitemid"]]
21
- biblio_anchor_linkend(node, i, linkend)
22
- elsif node["citeas"] && (i = @normrefanchors[node["bibitemid"]])
23
- cit = normref_anchor_linkend(node, i)
24
- cit || super
25
- else super
20
+ if node["citeas"] && bib = @bibanchors[node["bibitemid"]]
21
+ biblio_anchor_linkend(node, bib, linkend)
22
+ else
23
+ node["citeas"] && (bib = @normrefanchors[node["bibitemid"]]) &&
24
+ !%w(standard).include?(bib[:type]) and
25
+ node["style"] ||= "author_date"
26
+ super
26
27
  end
27
28
  end
28
29
 
29
- # force Author-Date referencing on non-standards in norm ref
30
- def normref_anchor_linkend(node, bib)
31
- @ref_renderings or return nil
32
- %w(standard).include?(bib[:type]) and return nil
33
- cit = @ref_renderings[node["bibitemid"]][:citation]&.strip
34
- cit.empty? and cit = nil
35
- cit
36
- end
37
-
38
30
  def biblio_anchor_linkend(node, bib, linkend)
39
31
  if %w(standard).include?(bib[:type])
40
32
  biblio_anchor_linkend_std(node, bib, linkend)
@@ -191,6 +191,11 @@ module IsoDoc
191
191
 
192
192
  def term(docxml); end
193
193
 
194
+ #def term1(elem)
195
+ #super
196
+ #elem.at(ns("./fmt-name"))&.remove # keep fmt-xref-label
197
+ #end
198
+
194
199
  def license_termnote(elem, idx)
195
200
  elem.name = "fn"
196
201
  elem["reference"] = "_termnote_license_#{idx}"
@@ -81,11 +81,10 @@ module IsoDoc
81
81
  warn "Failure to convert MathML to LaTeX\n#{node.parent.to_xml}\n#{e}"
82
82
  end
83
83
 
84
- def ol(docxml)
85
- ol_numbering(docxml)
86
- @xrefs.list_anchor_names(docxml.xpath(ns(@xrefs.sections_xpath)))
87
- docxml.xpath(ns("//ol/li")).each { |f| ol_label(f) }
88
- end
84
+ #def ol(docxml)
85
+ #ol_prep(docxml)
86
+ # docxml.xpath(ns("//ol/li")).each { |f| ol_label(f) }
87
+ #end
89
88
 
90
89
  def ol_numbering_containers
91
90
  "//clause | //annex | //foreword | //acknowledgements | " \
@@ -173,6 +173,7 @@ module IsoDoc
173
173
  end
174
174
 
175
175
  def abstract_header(dest)
176
+ dest.elements.empty? and return
176
177
  dest.elements.first.add_first_child <<~XML
177
178
  <span class='IEEEStdsAbstractHeader'><span lang='EN-US'>Abstract:</span></span>
178
179
  XML
@@ -869,7 +869,7 @@ depending on whether the items exist as independent documents, or are parts of a
869
869
  </zeroOrMore>
870
870
  </element>
871
871
  </define>
872
- <define name="BibItemType" combine="choice">
872
+ <define name="BibItemType">
873
873
  <a:documentation>Type of bibliographic item.
874
874
  The value list complies with the types provided in ISO 690:2021.
875
875
  NOTE: These values represent a strict superset to BibTeX
@@ -106,3 +106,5 @@ module Metanorma
106
106
  end
107
107
  end
108
108
  end
109
+
110
+ require_relative "log"
@@ -311,17 +311,28 @@ and is intended to be referenced by a callout within the source code</a:document
311
311
  </ref>
312
312
  </optional>
313
313
  <choice>
314
- <a:documentation>Content of the figure</a:documentation>
315
- <ref name="image"/>
314
+ <a:documentation>Content of the figure </a:documentation>
315
+ <ref name="image">
316
+ <a:documentation>by default the content of a figure is a media file</a:documentation>
317
+ </ref>
316
318
  <ref name="video"/>
317
319
  <ref name="audio"/>
318
- <ref name="pre"/>
320
+ <ref name="pre">
321
+ <a:documentation>figures can contain ASCII art</a:documentation>
322
+ </ref>
319
323
  <oneOrMore>
320
- <ref name="paragraph-with-footnote"/>
324
+ <ref name="paragraph-with-footnote">
325
+ <a:documentation>figures can contain discursive art</a:documentation>
326
+ </ref>
321
327
  </oneOrMore>
322
328
  <zeroOrMore>
323
- <ref name="figure"/>
329
+ <ref name="figure">
330
+ <a:documentation>subfigures, nested directly within a figure</a:documentation>
331
+ </ref>
324
332
  </zeroOrMore>
333
+ <ref name="table">
334
+ <a:documentation>Table is understood in this context to be a tabular arrangement of subfigures</a:documentation>
335
+ </ref>
325
336
  </choice>
326
337
  <zeroOrMore>
327
338
  <ref name="fn">
@@ -354,17 +365,28 @@ and is intended to be referenced by a callout within the source code</a:document
354
365
  </ref>
355
366
  </optional>
356
367
  <choice>
357
- <a:documentation>Content of the figure</a:documentation>
358
- <ref name="image-no-id"/>
368
+ <a:documentation>Content of the figure </a:documentation>
369
+ <ref name="image-no-id">
370
+ <a:documentation>by default the content of a figure is a media file</a:documentation>
371
+ </ref>
359
372
  <ref name="video-no-id"/>
360
373
  <ref name="audio-no-id"/>
361
- <ref name="pre-no-id"/>
374
+ <ref name="pre-no-id">
375
+ <a:documentation>figures can contain ASCII art</a:documentation>
376
+ </ref>
362
377
  <oneOrMore>
363
- <ref name="paragraph-with-footnote-no-id"/>
378
+ <ref name="paragraph-with-footnote-no-id">
379
+ <a:documentation>figures can contain discursive art</a:documentation>
380
+ </ref>
364
381
  </oneOrMore>
365
382
  <zeroOrMore>
366
- <ref name="figure-no-id"/>
383
+ <ref name="figure-no-id">
384
+ <a:documentation>subfigures, nested directly within a figure</a:documentation>
385
+ </ref>
367
386
  </zeroOrMore>
387
+ <ref name="table-no-id">
388
+ <a:documentation>Table is understood in this context to be a tabular arrangement of subfigures</a:documentation>
389
+ </ref>
368
390
  </choice>
369
391
  <zeroOrMore>
370
392
  <ref name="fn">
@@ -876,6 +898,9 @@ titlecase, or lowercase</a:documentation>
876
898
  <data type="boolean"/>
877
899
  </attribute>
878
900
  </optional>
901
+ <ref name="LocalizedStringAttributes">
902
+ <a:documentation>Specify language of bibitem, can be used to render it with language-specific bibliographic style</a:documentation>
903
+ </ref>
879
904
  <ref name="ReducedBibliographicItem"/>
880
905
  </element>
881
906
  </define>
@@ -0,0 +1,100 @@
1
+ module Metanorma
2
+ module Ieee
3
+ class Converter
4
+ IEEE_LOG_MESSAGES = {
5
+ # rubocop:disable Naming/VariableNumber
6
+ "IEEE_2": { category: "Style",
7
+ error: "%s is a 4-digit number in a table column with numbers broken up in threes",
8
+ severity: 2 },
9
+ "IEEE_3": { category: "Style",
10
+ error: "Expected title to start as: %s",
11
+ severity: 2 },
12
+ "IEEE_4": { category: "Style",
13
+ error: "Title contains uncapitalised word other than preposition",
14
+ severity: 2 },
15
+ "IEEE_5": { category: "Document Attributes",
16
+ error: "%s is not a recognised document type",
17
+ severity: 2 },
18
+ "IEEE_6": { category: "Document Attributes",
19
+ error: "%s is not a recognised document subtype",
20
+ severity: 2 },
21
+ "IEEE_7": { category: "Document Attributes",
22
+ error: "%s is not a recognised stage",
23
+ severity: 2 },
24
+ "IEEE_8": { category: "Style",
25
+ error: "Cross-reference contains range, should be separate cross-references",
26
+ severity: 2 },
27
+ "IEEE_9": { category: "Style",
28
+ error: "Undated reference %s should not contain specific elements",
29
+ severity: 2 },
30
+ "IEEE_10": { category: "Style",
31
+ error: "Normative reference %s is not dated.",
32
+ severity: 2 },
33
+ "IEEE_11": { category: "Style",
34
+ error: "Use ordered lists for lists more than two levels deep.",
35
+ severity: 2 },
36
+ "IEEE_12": { category: "Style",
37
+ error: "Ordered lists should not be more than five levels deep.",
38
+ severity: 2 },
39
+ "IEEE_13": { category: "Style",
40
+ error: "Image name %s is expected to be %s",
41
+ severity: 2 },
42
+ #
43
+ "IEEE_15": { category: "Style",
44
+ error: "More than one image in the table cell",
45
+ severity: 2 },
46
+ "IEEE_16": { category: "Style",
47
+ error: "Editorial instruction is missing from change",
48
+ severity: 2 },
49
+ "IEEE_17": { category: "Style",
50
+ error: "'Add' change description should start with _Insert_",
51
+ severity: 2 },
52
+ "IEEE_18": { category: "Style",
53
+ error: "'Delete' change description should start with _Delete_",
54
+ severity: 2 },
55
+ "IEEE_19": { category: "Style",
56
+ error: "'Modify' change description should start with _Change_ or _Replace_",
57
+ severity: 2 },
58
+ "IEEE_20": { category: "Style",
59
+ error: "'Modify' change description for change involving figure or equation should start with _Replace_",
60
+ severity: 2 },
61
+ "IEEE_21": { category: "Style",
62
+ error: "'Modify' change description for change not involving figure or equation should start with _Change_",
63
+ severity: 2 },
64
+ "IEEE_22": { category: "Style",
65
+ error: "Overview clause missing",
66
+ severity: 2 },
67
+ "IEEE_23": { category: "Style",
68
+ error: "Scope subclause missing",
69
+ severity: 2 },
70
+ "IEEE_24": { category: "Style",
71
+ error: "Word Usage subclause missing",
72
+ severity: 2 },
73
+ "IEEE_25": { category: "Style",
74
+ error: "Normative references missing",
75
+ severity: 2 },
76
+ "IEEE_26": { category: "Style",
77
+ error: "Definitions missing",
78
+ severity: 2 },
79
+ "IEEE_27": { category: "Style",
80
+ error: "(section sequencing) %s",
81
+ severity: 2 },
82
+ "IEEE_28": { category: "Style",
83
+ error: "Document must include (references) Normative References",
84
+ severity: 2 },
85
+ #
86
+ "IEEE_30": { category: "Style",
87
+ error: "subclause is only child",
88
+ severity: 2 },
89
+ "IEEE_31": { category: "Style",
90
+ error: "Bibliography must be either the first or the last document annex",
91
+ severity: 2 },
92
+ }.freeze
93
+ # rubocop:enable Naming/VariableNumber
94
+
95
+ def log_messages
96
+ super.merge(IEEE_LOG_MESSAGES)
97
+ end
98
+ end
99
+ end
100
+ end
@@ -28,19 +28,16 @@ module Metanorma
28
28
  def doctype_validate(xmldoc)
29
29
  %w(standard recommended-practice guide whitepaper redline other)
30
30
  .include?(@doctype) or
31
- @log.add("Document Attributes", nil,
32
- "#{@doctype} is not a recognised document type")
31
+ @log.add("IEEE_5", nil, params: [@doctype])
33
32
  docsubtype = xmldoc.at("//bibdata/ext/subdoctype")&.text or return
34
33
  %w(amendment corrigendum erratum document).include? docsubtype or
35
- @log.add("Document Attributes", nil,
36
- "#{docsubtype} is not a recognised document subtype")
34
+ @log.add("IEEE_6", nil, params: [docsubtype])
37
35
  end
38
36
 
39
37
  def stage_validate(xmldoc)
40
38
  stage = xmldoc&.at("//bibdata/status/stage")&.text
41
39
  %w(draft approved superseded withdrawn).include? stage or
42
- @log.add("Document Attributes", nil,
43
- "#{stage} is not a recognised stage")
40
+ @log.add("IEEE_7", nil, params: [stage])
44
41
  end
45
42
 
46
43
  def locality_validate(root)
@@ -52,8 +49,7 @@ module Metanorma
52
49
  def locality_range_validate(root)
53
50
  root.xpath("//eref | xref").each do |e|
54
51
  e.at(".//localityStack[@connective = 'from'] | .//referenceTo") and
55
- @log.add("Style", e, "Cross-reference contains range, " \
56
- "should be separate cross-references")
52
+ @log.add("IEEE_8", e)
57
53
  end
58
54
  end
59
55
 
@@ -61,9 +57,7 @@ module Metanorma
61
57
  def locality_erefs_validate(root)
62
58
  root.xpath("//eref[descendant::locality]").each do |t|
63
59
  if !/[:-](\d+{4})($|-\d\d)/.match?(t["citeas"])
64
- @log.add("Style", t,
65
- "Undated reference #{t['citeas']} should not contain " \
66
- "specific elements")
60
+ @log.add("IEEE_9", t, params: [t["citeas"]])
67
61
  end
68
62
  end
69
63
  end
@@ -76,8 +70,7 @@ module Metanorma
76
70
  def normative_dated_refs(root)
77
71
  root.xpath("//references[@normative = 'true']/bibitem").each do |b|
78
72
  b.at(".//date") or
79
- @log.add("Style", b,
80
- "Normative reference #{b.at('./@anchor')&.text} is not dated.")
73
+ @log.add("IEEE_10", b, params: [b.at("./@anchor")&.text])
81
74
  end
82
75
  end
83
76
 
@@ -91,14 +84,12 @@ module Metanorma
91
84
  doc.xpath("//ul[.//ul//ul]").each do |u|
92
85
  next unless u.ancestors("ul").empty?
93
86
 
94
- @log.add("Style", u,
95
- "Use ordered lists for lists more than two levels deep.")
87
+ @log.add("IEEE_11", u)
96
88
  end
97
89
  doc.xpath("//ol[.//ol//ol//ol//ol//ol]").each do |u|
98
90
  next unless u.ancestors("ol").empty?
99
91
 
100
- @log.add("Style", u,
101
- "Ordered lists should not be more than five levels deep.")
92
+ @log.add("IEEE_12", u)
102
93
  end
103
94
  end
104
95
 
@@ -148,13 +139,12 @@ module Metanorma
148
139
  pref = image_name_prefix(xmldoc)
149
140
  (xmldoc.xpath("//figure") - xmldoc.xpath("//table//figure"))
150
141
  .each do |f|
151
- (i = f.at("./image") and !i["src"]&.start_with?("data:")) or next
152
- num = xrefs.anchor(f["id"], :label)
153
- base = File.basename(i["src"], ".*")
154
- base == "#{pref}_fig#{num}" or
155
- @log.add("Style", i,
156
- "Image name #{base} is expected to be #{pref}_fig#{num}")
157
- end
142
+ (i = f.at("./image") and !i["src"]&.start_with?("data:")) or next
143
+ num = xrefs.anchor(f["id"], :label)
144
+ base = File.basename(i["src"], ".*")
145
+ base == "#{pref}_fig#{num}" or
146
+ @log.add("IEEE_13", i, params: [base, "#{pref}_fig#{num}"])
147
+ end
158
148
  end
159
149
 
160
150
  # Style manual 17.2
@@ -172,8 +162,7 @@ module Metanorma
172
162
  num = tablefigurenumber(t, f, xrefs)
173
163
  base = File.basename(i["src"])
174
164
  base == num or
175
- @log.add("Style", i,
176
- "Image name #{base} is expected to be #{num}")
165
+ @log.add("IEEE_13", i, params: [base, num])
177
166
  end
178
167
  end
179
168
  end
@@ -190,8 +179,7 @@ module Metanorma
190
179
  def table_figure_quantity_validate(xmldoc)
191
180
  xmldoc.xpath("//td[.//image] | //th[.//image]").each do |d|
192
181
  d.xpath(".//image").size > 1 and
193
- @log.add("Style", d,
194
- "More than one image in the table cell")
182
+ @log.add("IEEE_15", d)
195
183
  end
196
184
  end
197
185
 
@@ -203,8 +191,7 @@ module Metanorma
203
191
  amend_validate1(a, desc.text.strip,
204
192
  a.at("./newcontent//figure | " \
205
193
  "./newcontent//formula"))
206
- else @log.add("Style", a,
207
- "Editorial instruction is missing from change")
194
+ else @log.add("IEEE_16", a)
208
195
  end
209
196
  end
210
197
  end
@@ -212,31 +199,21 @@ module Metanorma
212
199
  def amend_validate1(amend, description, figure_or_formula)
213
200
  case amend["change"]
214
201
  when "add" then /^Insert /.match?(description) or
215
- @log.add("Style", amend,
216
- "'Add' change description should start with _Insert_")
202
+ @log.add("IEEE_17", amend)
217
203
  when "delete" then /^Insert /.match?(description) or
218
- @log.add("Style", amend,
219
- "'Delete' change description should start with _Delete_")
204
+ @log.add("IEEE_18", amend)
220
205
  when "modify"
221
206
  amend_validate_modify(amend, description, figure_or_formula)
222
207
  end
223
208
  end
224
209
 
225
- AMD_VALID_MOD = [
226
- "'Modify' change description should start with _Change_ or _Replace_",
227
- "'Modify' change description for change involving figure or equation " \
228
- "should start with _Replace_",
229
- "'Modify' change description for change not involving figure or " \
230
- "equation should start with _Change_",
231
- ].freeze
232
-
233
210
  def amend_validate_modify(amend, description, figure_or_formula)
234
211
  if !/^Change |^Replace/.match?(description)
235
- @log.add("Style", amend, AMD_VALID_MOD[0])
212
+ @log.add("IEEE_19", amend)
236
213
  elsif /^Change /.match?(description)
237
- !figure_or_formula or @log.add("Style", amend, AMD_VALID_MOD[1])
214
+ !figure_or_formula or @log.add("IEEE_20", amend)
238
215
  else
239
- figure_or_formula or @log.add("Style", amend, AMD_VALID_MOD[2])
216
+ figure_or_formula or @log.add("IEEE_21", amend)
240
217
  end
241
218
  end
242
219
  end
@@ -13,15 +13,17 @@ module Metanorma
13
13
 
14
14
  def sections_presence_validate(root)
15
15
  root.at("//sections/clause[@type = 'overview']") or
16
- @log.add("Style", nil, "Overview clause missing")
16
+ @log.add("IEEE_22", nil)
17
17
  root.at("//sections/clause[@type = 'overview']/clause[@type = 'scope']") or
18
- @log.add("Style", nil, "Scope subclause missing")
18
+ @log.add("IEEE_23", nil)
19
19
  root.at("//sections/clause[@type = 'overview']/clause[@type = 'word-usage']") or
20
- @log.add("Style", nil, "Word Usage subclause missing")
20
+ @log.add("IEEE_24", nil)
21
+ # ID = IEEE_24
21
22
  root.at("//references[@normative = 'true']") or
22
- @log.add("Style", nil, "Normative references missing")
23
+ @log.add("IEEE_25", nil)
24
+ # ID = IEEE_25
23
25
  root.at("//terms") or
24
- @log.add("Style", nil, "Definitions missing")
26
+ @log.add("IEEE_26", nil)
25
27
  end
26
28
 
27
29
  def seqcheck(names, msg, accepted)
@@ -30,7 +32,7 @@ module Metanorma
30
32
 
31
33
  test = accepted.map { |a| n.at(a) }
32
34
  if test.all?(&:nil?)
33
- @log.add("Style", nil, msg)
35
+ @log.add("IEEE_27", nil, params: [msg])
34
36
  end
35
37
  names
36
38
  end
@@ -79,13 +81,11 @@ module Metanorma
79
81
  while elem&.name == "annex"
80
82
  elem = names.shift
81
83
  if elem.nil?
82
- @log.add("Style", nil, "Document must include (references) "\
83
- "Normative References")
84
+ @log.add("IEEE_28", nil)
84
85
  end
85
86
  end
86
87
  elem&.at("./self::references[@normative = 'true']") ||
87
- @log.add("Style", nil, "Document must include (references) "\
88
- "Normative References")
88
+ @log.add("IEEE_28", nil)
89
89
  end
90
90
 
91
91
  # Style manual 13.1
@@ -100,7 +100,7 @@ module Metanorma
100
100
  def onlychild_clause_validate(root)
101
101
  root.xpath(Standoc::Utils::SUBCLAUSE_XPATH).each do |c|
102
102
  c.xpath("../clause").size == 1 or next
103
- @log.add("Style", c, "subclause is only child")
103
+ @log.add("IEEE_30", c)
104
104
  end
105
105
  end
106
106
 
@@ -113,8 +113,7 @@ module Metanorma
113
113
  valid = prec.empty? || foll.empty?
114
114
  else valid = false
115
115
  end
116
- valid or @log.add("Style", bib, "Bibliography must be either the first "\
117
- "or the last document annex")
116
+ valid or @log.add("IEEE_31", bib)
118
117
  end
119
118
  end
120
119
  end
@@ -30,7 +30,7 @@ module Metanorma
30
30
 
31
31
  w = msg
32
32
  w += ": #{text}" if text
33
- @log.add("Style", node, w)
33
+ @log.add("STANDOC_48", node, params: [w])
34
34
  end
35
35
 
36
36
  def style(node, text)
@@ -91,9 +91,7 @@ module Metanorma
91
91
 
92
92
  col.each do |x|
93
93
  /^[0-9. ]+$/.match?(x) && /\d{4}/.match?(x) and
94
- @log.add("Style", table,
95
- "#{x} is a 4-digit number in a table column with " \
96
- "numbers broken up in threes")
94
+ @log.add("IEEE_2", table, params: [x])
97
95
  end
98
96
  end
99
97
  end
@@ -122,8 +120,7 @@ module Metanorma
122
120
  target += trial ? "Trial-Use " : ""
123
121
  target += @doctype ? "#{strict_capitalize_phrase(@doctype)} " : ""
124
122
  /^#{target}/.match?(title.text) or
125
- @log.add("Style", title,
126
- "Expected title to start as: #{target}")
123
+ @log.add("IEEE_3", title, params: [target])
127
124
  end
128
125
 
129
126
  def strict_capitalize_phrase(str)
@@ -144,8 +141,7 @@ module Metanorma
144
141
  /^[[:upper:]]/.match?(w) or preposition?(w) or
145
142
  found = true
146
143
  end
147
- found and @log.add("Style", title,
148
- "Title contains uncapitalised word other than preposition")
144
+ found and @log.add("IEEE_4", title)
149
145
  end
150
146
 
151
147
  def preposition?(word)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ieee
3
- VERSION = "1.5.6".freeze
3
+ VERSION = "1.6.0".freeze
4
4
  end
5
5
  end
@@ -16,17 +16,17 @@ extenttemplate:
16
16
  misc: "{{ volume }}, {{issue}}, {{ page }}, {{ duration }}"
17
17
  template:
18
18
  # skip authoritative_identifier, it is inserted in front of formattedref within metanorma
19
- standard: "{{ title }}{% if home_standard %}{%else%}, {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: ', ' }}{% endif %}{% endif %}{% endif %}."
20
- article: "{{creatornames}}, “{{title}},” <em>{{ series }}</em>, {{ extent }}, {{ date }}, {{ labels['viewed'] }}_{{date_accessed}}, {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: ', ' }}{% endif %}{% endif %} ."
21
- book: "{{creatornames}}, <em>{{title}}</em>, {{ edition }}, {{place}}: {{publisher}}, {{date}}, {{ labels['viewed'] }}_{{date_accessed}}, {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: ', ' }}{% endif %}{% endif %} ."
19
+ standard: "{{ title }}{% if home_standard %}{%else%}$$$ {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: '$$$ ' }}{% endif %}{% endif %}{% endif %}$$$"
20
+ article: "{{creatornames}}$$$ “{{title}}$$$|” <em>{{ series }}</em>$$$ {{ extent }}$$$ {{ date }}$$$ {{ labels['viewed'] }}_{{date_accessed}}$$$ {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: '$$$ ' }}{% endif %}{% endif %} $$$"
21
+ book: "{{creatornames}}$$$ <em>{{title}}</em>$$$ {{ edition }}$$$ {{place}}: {{publisher}}$$$ {{date}}$$$ {{ labels['viewed'] }}_{{date_accessed}}$$$ {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: '$$$ ' }}{% endif %}{% endif %} $$$"
22
22
  techreport: book
23
23
  booklet: book
24
24
  manual: book
25
25
  proceedings: book
26
- inproceedings: "{{ creatornames }}, “{{ title }},” <em>{{host_title}}</em>, {{place}}, {{extent}}, {{date}}, {{ labels['viewed'] }}_{{date_accessed}}, {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: ', ' }}{% endif %}{% endif %} ."
27
- inbook: "{{ creatornames }}, “{{ title }},” {{ labels['in'] }} {{ host_creatornames}} ({{ host_role}}) : <em>{{host_title}}</em>, {{place}}: {{publisher}}, {{date}}, {{extent}}, {{ labels['viewed'] }}_{{date_accessed}}, {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: ', ' }}{% endif %}{% endif %} ."
26
+ inproceedings: "{{ creatornames }}$$$ “{{ title }}$$$|” <em>{{host_title}}</em>$$$ {{place}}$$$ {{extent}}$$$ {{date}}$$$ {{ labels['viewed'] }}_{{date_accessed}}$$$ {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: '$$$ ' }}{% endif %}{% endif %} $$$"
27
+ inbook: "{{ creatornames }}$$$ “{{ title }}$$$|” {{ labels['in'] }} {{ host_creatornames}} ({{ host_role}}) : <em>{{host_title}}</em>$$$ {{place}}: {{publisher}}$$$ {{date}}$$$ {{extent}}$$$ {{ labels['viewed'] }}_{{date_accessed}}$$$ {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: '$$$ ' }}{% endif %}{% endif %} $$$"
28
28
  incollection: inbook
29
- thesis: "{{ creatornames }} , “{{ title }},” {{ medium | capitalize }}, {{ publisher }}, {{ date }}, {{ labels['viewed'] }}_{{date_accessed}}, {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: ', ' }}{% endif %}{% endif %} ."
29
+ thesis: "{{ creatornames }} $$$ “{{ title }}$$$|” {{ medium | capitalize }}$$$ {{ publisher }}$$$ {{ date }}$$$ {{ labels['viewed'] }}_{{date_accessed}}$$$ {% if uri %}{{ uri }}{% else %}{% if doi %}DOI: {{ doi | join: '$$$ ' }}{% endif %}{% endif %} $$$"
30
30
  unpublished: thesis
31
31
  misc: thesis
32
32
  website: thesis
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
27
27
 
28
- spec.add_dependency "metanorma-standoc", "~> 3.1.0"
28
+ spec.add_dependency "metanorma-standoc", "~> 3.2.0"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
30
  spec.add_dependency "pubid"
31
31
 
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
34
34
  spec.add_development_dependency "guard", "~> 2.14"
35
35
  spec.add_development_dependency "guard-rspec", "~> 4.7"
36
+ spec.add_development_dependency "openssl"
36
37
  spec.add_development_dependency "rake", "~> 13.0"
37
38
  spec.add_development_dependency "rspec", "~> 3.6"
38
39
  spec.add_development_dependency "rubocop", "~> 1"
@@ -41,5 +42,5 @@ spec.add_development_dependency "rubocop-performance"
41
42
  spec.add_development_dependency "simplecov", "~> 0.15"
42
43
  spec.add_development_dependency "timecop", "~> 0.9"
43
44
  spec.add_development_dependency "webmock"
44
- spec.add_development_dependency "canon"
45
+ spec.add_development_dependency "canon", "= 0.1.3"
45
46
  end