metanorma-ieee 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.1".freeze
3
+ VERSION = "0.1.3".freeze
4
4
  end
5
5
  end
@@ -7,9 +7,9 @@ extenttemplate:
7
7
  template:
8
8
  # skip authoritative_identifier, it is inserted in front of formattedref within metanorma
9
9
  standard: "{{ title }}."
10
- techreport: standard
11
10
  article: "{{creatornames}}, “{{title}},” <em>{{ series }}</em>, {{ extent }}, {{ date }}, {{ labels['viewed'] }}_{{date_accessed}}, {{ uri }} ."
12
11
  book: "{{creatornames}}, <em>{{title}}</em>, {{ edition }}, {{place}}: {{publisher}}, {{date}}, {{ labels['viewed'] }}_{{date_accessed}}, {{ uri }} ."
12
+ techreport: book
13
13
  booklet: book
14
14
  manual: book
15
15
  proceedings: book
@@ -17,12 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.license = "BSD-2-Clause"
18
18
 
19
19
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
- f.match(%r{^(test|spec|features)/})
20
+ f.match(%r{^(test|spec|features|bin|.github)/}) \
21
+ || f.match(%r{Rakefile|bin/rspec})
21
22
  end
22
23
  spec.bindir = "exe"
23
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
25
  spec.require_paths = ["lib"]
25
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
26
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
26
27
 
27
28
  spec.add_dependency "metanorma-standoc", "~> 2.2.4"
28
29
  spec.add_dependency "mnconvert", "~> 1.20"
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.1
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-10-24 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
@@ -215,19 +215,12 @@ executables: []
215
215
  extensions: []
216
216
  extra_rdoc_files: []
217
217
  files:
218
- - ".github/workflows/automerge.yml"
219
- - ".github/workflows/rake.yml"
220
- - ".github/workflows/release.yml"
221
218
  - ".hound.yml"
222
219
  - ".rubocop.yml"
223
220
  - CODE_OF_CONDUCT.md
224
221
  - Gemfile
225
222
  - LICENSE
226
223
  - README.adoc
227
- - Rakefile
228
- - bin/console
229
- - bin/rspec
230
- - bin/setup
231
224
  - lib/html2doc/ieee.rb
232
225
  - lib/html2doc/ieee/lists.rb
233
226
  - lib/html2doc/ieee/notes.rb
@@ -299,14 +292,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
299
292
  requirements:
300
293
  - - ">="
301
294
  - !ruby/object:Gem::Version
302
- version: 2.5.0
295
+ version: 2.7.0
303
296
  required_rubygems_version: !ruby/object:Gem::Requirement
304
297
  requirements:
305
298
  - - ">="
306
299
  - !ruby/object:Gem::Version
307
300
  version: '0'
308
301
  requirements: []
309
- rubygems_version: 3.1.6
302
+ rubygems_version: 3.3.7
310
303
  signing_key:
311
304
  specification_version: 4
312
305
  summary: Metanorma for the IEEE
@@ -1,31 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- # source: https://github.com/marketplace/actions/merge-pull-requests#usage
4
- name: automerge
5
- on:
6
- pull_request:
7
- types:
8
- - labeled
9
- - unlabeled
10
- - synchronize
11
- - opened
12
- - edited
13
- - ready_for_review
14
- - reopened
15
- - unlocked
16
- pull_request_review:
17
- types:
18
- - submitted
19
- check_suite:
20
- types:
21
- - completed
22
- status: {}
23
- jobs:
24
- automerge:
25
- runs-on: ubuntu-latest
26
- steps:
27
- - id: automerge
28
- name: automerge
29
- uses: "pascalgn/automerge-action@v0.15.3"
30
- env:
31
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
@@ -1,15 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: rake
4
-
5
- on:
6
- push:
7
- branches: [ master, main ]
8
- tags: [ v* ]
9
- pull_request:
10
-
11
- jobs:
12
- notify:
13
- uses: metanorma/ci/.github/workflows/mn-processor-rake.yml@main
14
- secrets:
15
- pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -1,24 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: release
4
-
5
- on:
6
- workflow_dispatch:
7
- inputs:
8
- next_version:
9
- description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
- required: true
12
- default: 'skip'
13
- push:
14
- tags: [ v* ]
15
-
16
- jobs:
17
- release:
18
- uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
19
- with:
20
- next_version: ${{ github.event.inputs.next_version }}
21
- secrets:
22
- rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
23
- pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
24
-
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require "isodoc/gem_tasks"
4
-
5
- IsoDoc::GemTasks.install
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "metanorma/itu"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/rspec DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rspec' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require "pathname"
10
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
11
- "../../Gemfile", Pathname.new(__FILE__).realpath
12
- )
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("rspec-core", "rspec")
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here