metanorma-ieee 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1152,7 +1152,7 @@
1152
1152
  <data type="boolean"/>
1153
1153
  </attribute>
1154
1154
  </optional>
1155
- <ref name="BibliographicItem"/>
1155
+ <ref name="ReducedBibliographicItem"/>
1156
1156
  </element>
1157
1157
  </define>
1158
1158
  <define name="image" combine="choice">
@@ -3,8 +3,9 @@ module Metanorma
3
3
  class TermLookupCleanup < Metanorma::Standoc::TermLookupCleanup
4
4
  def remove_missing_ref_term(node, _target)
5
5
  node.at("../xrefrender")&.remove
6
- node.replace("<preferred><expression><name>#{node.children.to_xml}"\
7
- "</name></expression></preferred>")
6
+ #node.replace("<preferred><expression><name>#{node.children.to_xml}"\
7
+ # "</name></expression></preferred>")
8
+ node.replace("<refterm>#{node.children.to_xml}</refterm>")
8
9
  end
9
10
  end
10
11
  end
@@ -131,7 +131,7 @@ module Metanorma
131
131
  klass = IsoDoc::IEEE::HtmlConvert.new(language: @lang, script: @script)
132
132
  xrefs = IsoDoc::IEEE::Xref
133
133
  .new(@lang, @script, klass, IsoDoc::IEEE::I18n.new(@lang, @script),
134
- { hierarchical_assets: @hierarchical_assets })
134
+ { hierarchicalassets: @hierarchical_assets })
135
135
  xrefs.parse(Nokogiri::XML(xmldoc.to_xml))
136
136
  xrefs
137
137
  end
@@ -2,9 +2,9 @@ module Metanorma
2
2
  module IEEE
3
3
  class Converter < Standoc::Converter
4
4
  ASSETS_TO_STYLE =
5
- "//termsource | //formula | //termnote | "\
6
- "//p[not(ancestor::boilerplate)] | //li[not(p)] | //dt | "\
7
- "//dd[not(p)] | //td[not(p)][not(ancestor::boilerplate)] | "\
5
+ "//termsource | //formula | //termnote | " \
6
+ "//p[not(ancestor::boilerplate)] | //li[not(p)] | //dt | " \
7
+ "//dd[not(p)] | //td[not(p)][not(ancestor::boilerplate)] | " \
8
8
  "//th[not(p)][not(ancestor::boilerplate)] | //example".freeze
9
9
 
10
10
  def extract_text(node)
@@ -56,8 +56,8 @@ module Metanorma
56
56
  end
57
57
 
58
58
  # leaving out as problematic: N J K C S T H h d B o E
59
- SI_UNIT = "(m|cm|mm|km|μm|nm|g|kg|mgmol|cd|rad|sr|Hz|Hz|MHz|Pa|hPa|kJ|"\
60
- "V|kV|W|MW|kW|F|μF|Ω|Wb|°C|lm|lx|Bq|Gy|Sv|kat|l|t|eV|u|Np|Bd|"\
59
+ SI_UNIT = "(m|cm|mm|km|μm|nm|g|kg|mgmol|cd|rad|sr|Hz|Hz|MHz|Pa|hPa|kJ|" \
60
+ "V|kV|W|MW|kW|F|μF|Ω|Wb|°C|lm|lx|Bq|Gy|Sv|kat|l|t|eV|u|Np|Bd|" \
61
61
  "bit|kB|MB|Hart|nat|Sh|var)".freeze
62
62
 
63
63
  # Style manual 14.2
@@ -84,15 +84,15 @@ module Metanorma
84
84
  # deliberately doing naive, ignoring rowspan
85
85
  def table_style_columns(table)
86
86
  table_extract_columns(table).each do |col|
87
- next unless col.any? do |x|
87
+ col.any? do |x|
88
88
  /^[0-9. ]+$/.match?(x) &&
89
89
  (/\d{3} \d/.match?(x) || /\d \d{3}/.match?(x))
90
- end
90
+ end or next
91
91
 
92
92
  col.each do |x|
93
93
  /^[0-9. ]+$/.match?(x) && /\d{4}/.match?(x) and
94
94
  @log.add("Style", table,
95
- "#{x} is a 4-digit number in a table column with "\
95
+ "#{x} is a 4-digit number in a table column with " \
96
96
  "numbers broken up in threes")
97
97
  end
98
98
  end
@@ -108,7 +108,7 @@ module Metanorma
108
108
  ret.map { |x| x.is_a?(Array) ? x : [] }
109
109
  end
110
110
 
111
- def title_validate(xml)
111
+ def title_validate(xml)
112
112
  title_validate_type(xml)
113
113
  title_validate_capitalisation(xml)
114
114
  end
@@ -118,8 +118,6 @@ module Metanorma
118
118
  title = xml.at("//bibdata/title") or return
119
119
  draft = xml.at("//bibdata//draft")
120
120
  type = xml.at("//bibdata/ext/doctype")
121
- subtype = xml.at("//bibdata/ext/subdoctype")
122
- subtype = "" if subtype == "document"
123
121
  trial = xml.at("//bibdata/ext/trial-use[text() = 'true']")
124
122
  target = draft ? "Draft " : ""
125
123
  target += trial ? "Trial-Use " : ""
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IEEE
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-07 00:00:00.000000000 Z
11
+ date: 2022-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc