stepmod-utils 0.6.10.pre.alpha.1 → 0.6.11

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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +6 -0
  3. data/.rubocop.yml +1 -1
  4. data/README.adoc +67 -0
  5. data/exe/stepmod-convert-bibliography +97 -0
  6. data/lib/stepmod/utils/bibliography_converter.rb +294 -0
  7. data/lib/stepmod/utils/ceradoc_compat.rb +95 -0
  8. data/lib/stepmod/utils/change.rb +3 -109
  9. data/lib/stepmod/utils/change_collection.rb +3 -3
  10. data/lib/stepmod/utils/change_file.rb +117 -0
  11. data/lib/stepmod/utils/cleaner.rb +25 -5
  12. data/lib/stepmod/utils/converters/a.rb +15 -1
  13. data/lib/stepmod/utils/converters/arm.rb +1 -1
  14. data/lib/stepmod/utils/converters/base.rb +3 -3
  15. data/lib/stepmod/utils/converters/clause_ref.rb +1 -1
  16. data/lib/stepmod/utils/converters/comment.rb +1 -1
  17. data/lib/stepmod/utils/converters/dd.rb +1 -1
  18. data/lib/stepmod/utils/converters/def.rb +2 -2
  19. data/lib/stepmod/utils/converters/definition.rb +1 -1
  20. data/lib/stepmod/utils/converters/description.rb +1 -1
  21. data/lib/stepmod/utils/converters/dl.rb +1 -1
  22. data/lib/stepmod/utils/converters/dt.rb +1 -1
  23. data/lib/stepmod/utils/converters/em.rb +2 -2
  24. data/lib/stepmod/utils/converters/em_express_description.rb +30 -1
  25. data/lib/stepmod/utils/converters/eqn.rb +2 -2
  26. data/lib/stepmod/utils/converters/example.rb +1 -1
  27. data/lib/stepmod/utils/converters/express_figure.rb +1 -1
  28. data/lib/stepmod/utils/converters/express_g.rb +1 -1
  29. data/lib/stepmod/utils/converters/express_note.rb +1 -1
  30. data/lib/stepmod/utils/converters/express_ref.rb +1 -1
  31. data/lib/stepmod/utils/converters/express_ref_express_description.rb +1 -1
  32. data/lib/stepmod/utils/converters/ext_description.rb +1 -1
  33. data/lib/stepmod/utils/converters/ext_descriptions.rb +1 -1
  34. data/lib/stepmod/utils/converters/figure.rb +6 -5
  35. data/lib/stepmod/utils/converters/fund_cons.rb +1 -1
  36. data/lib/stepmod/utils/converters/introduction.rb +1 -1
  37. data/lib/stepmod/utils/converters/li.rb +3 -3
  38. data/lib/stepmod/utils/converters/module_ref.rb +1 -1
  39. data/lib/stepmod/utils/converters/module_ref_express_description.rb +1 -1
  40. data/lib/stepmod/utils/converters/note.rb +1 -1
  41. data/lib/stepmod/utils/converters/ol.rb +3 -3
  42. data/lib/stepmod/utils/converters/resource.rb +1 -1
  43. data/lib/stepmod/utils/converters/schema.rb +1 -1
  44. data/lib/stepmod/utils/converters/schema_diag.rb +1 -1
  45. data/lib/stepmod/utils/converters/stepmod_ext_description.rb +1 -1
  46. data/lib/stepmod/utils/converters/strong.rb +31 -9
  47. data/lib/stepmod/utils/converters/sub.rb +2 -2
  48. data/lib/stepmod/utils/converters/sup.rb +2 -2
  49. data/lib/stepmod/utils/converters/synonym.rb +1 -1
  50. data/lib/stepmod/utils/converters/table.rb +2 -2
  51. data/lib/stepmod/utils/converters/term.rb +1 -1
  52. data/lib/stepmod/utils/converters/text.rb +2 -2
  53. data/lib/stepmod/utils/converters/tr.rb +3 -3
  54. data/lib/stepmod/utils/equation_logger.rb +1 -0
  55. data/lib/stepmod/utils/express_bibdata.rb +3 -1
  56. data/lib/stepmod/utils/mapping_change.rb +17 -0
  57. data/lib/stepmod/utils/schema_change.rb +19 -0
  58. data/lib/stepmod/utils/smrl_description_converter.rb +2 -2
  59. data/lib/stepmod/utils/smrl_resource_converter.rb +9 -9
  60. data/lib/stepmod/utils/stepmod_definition_converter.rb +18 -18
  61. data/lib/stepmod/utils/stepmod_file_annotator.rb +15 -13
  62. data/lib/stepmod/utils/terms_extractor.rb +3 -3
  63. data/lib/stepmod/utils/version.rb +1 -1
  64. data/stepmod-utils.gemspec +14 -3
  65. metadata +75 -9
@@ -9,7 +9,7 @@ module Stepmod
9
9
  end
10
10
  end
11
11
 
12
- Coradoc::Input::Html::Converters.register :introduction, Introduction.new
12
+ Ceradoc::Html::Converters.register :introduction, Introduction.new
13
13
  end
14
14
  end
15
15
  end
@@ -3,18 +3,18 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Li < Coradoc::Input::Html::Converters::Li
6
+ class Li < Ceradoc::Html::Converters::Li
7
7
  def to_coradoc(node, state = {})
8
8
  li = super
9
9
  li.content = li.content.map do |content|
10
- parsed_content = Coradoc::Generator.gen_adoc(content)
10
+ parsed_content = Stepmod::Utils::CeradocCompat.gen_adoc(content)
11
11
  parsed_content[0] == " " ? parsed_content : parsed_content.lstrip
12
12
  end
13
13
  li
14
14
  end
15
15
  end
16
16
 
17
- Coradoc::Input::Html::Converters.register :li, Li.new
17
+ Ceradoc::Html::Converters.register :li, Li.new
18
18
  end
19
19
  end
20
20
  end
@@ -86,7 +86,7 @@ module Stepmod
86
86
  /.*?\s*\(?\d+\)?/.match(text)
87
87
  end
88
88
  end
89
- Coradoc::Input::Html::Converters.register :module_ref, ModuleRef.new
89
+ Ceradoc::Html::Converters.register :module_ref, ModuleRef.new
90
90
  end
91
91
  end
92
92
  end
@@ -45,7 +45,7 @@ module Stepmod
45
45
  # puts "[module_ref] #{result}"
46
46
  end
47
47
  end
48
- Coradoc::Input::Html::Converters.register :module_ref,
48
+ Ceradoc::Html::Converters.register :module_ref,
49
49
  ModuleRefExpressDescription.new
50
50
  end
51
51
  end
@@ -19,7 +19,7 @@ module Stepmod
19
19
  TEMPLATE
20
20
  end
21
21
  end
22
- Coradoc::Input::Html::Converters.register :note, Note.new
22
+ Ceradoc::Html::Converters.register :note, Note.new
23
23
  end
24
24
  end
25
25
  end
@@ -3,19 +3,19 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Ol < Coradoc::Input::Html::Converters::Ol
6
+ class Ol < Ceradoc::Html::Converters::Ol
7
7
  LIST_TAGS = ["ol", "ul", "dir"].freeze
8
8
 
9
9
  def to_coradoc(node, state = {})
10
10
  content = super(node, state)
11
11
 
12
12
  # Dont make early parse on nested lists
13
- LIST_TAGS.include?(node.parent.name) ? content : Coradoc::Generator.gen_adoc(content) + "\n"
13
+ LIST_TAGS.include?(node.parent.name) ? content : Stepmod::Utils::CeradocCompat.gen_adoc(content) + "\n"
14
14
  end
15
15
  end
16
16
 
17
17
  Ol::LIST_TAGS.each do |tag|
18
- Coradoc::Input::Html::Converters.register tag.to_sym, Ol.new
18
+ Ceradoc::Html::Converters.register tag.to_sym, Ol.new
19
19
  end
20
20
  end
21
21
  end
@@ -8,7 +8,7 @@ module Stepmod
8
8
  treat_children(node, state)
9
9
  end
10
10
  end
11
- Coradoc::Input::Html::Converters.register :resource, Resource.new
11
+ Ceradoc::Html::Converters.register :resource, Resource.new
12
12
  end
13
13
  end
14
14
  end
@@ -13,7 +13,7 @@ module Stepmod
13
13
  TEMPLATE
14
14
  end
15
15
  end
16
- Coradoc::Input::Html::Converters.register :schema, Schema.new
16
+ Ceradoc::Html::Converters.register :schema, Schema.new
17
17
  end
18
18
  end
19
19
  end
@@ -8,7 +8,7 @@ module Stepmod
8
8
  treat_children(node, state).strip
9
9
  end
10
10
  end
11
- Coradoc::Input::Html::Converters.register :schema_diag, SchemaDiag.new
11
+ Ceradoc::Html::Converters.register :schema_diag, SchemaDiag.new
12
12
  end
13
13
  end
14
14
  end
@@ -57,7 +57,7 @@ module Stepmod
57
57
  TEMPLATE
58
58
  end
59
59
  end
60
- Coradoc::Input::Html::Converters.register :ext_description,
60
+ Ceradoc::Html::Converters.register :ext_description,
61
61
  StepmodExtDescription.new
62
62
  end
63
63
  end
@@ -10,8 +10,36 @@ module Stepmod
10
10
  bold_converted(node, state)
11
11
  end
12
12
 
13
+ # Wraps already converted +content+ in AsciiDoc bold markup, as
14
+ # +node+ (a <b>, or an element standing in for one) would.
15
+ def mark_up(node, content, state)
16
+ return content if content.strip.empty? || state[:already_strong] ||
17
+ state[:equation]
18
+
19
+ strong_tag = unconstrained?(node, content, state) ? "**" : "*"
20
+ leading = content[0, content.length - content.lstrip.length]
21
+ trailing = content[content.rstrip.length..]
22
+ handle_express_escape_seq(
23
+ node,
24
+ "#{leading}#{strong_tag}#{content.strip}#{strong_tag}#{trailing}",
25
+ )
26
+ end
27
+
13
28
  private
14
29
 
30
+ # Constrained bold (`*x*`) is not recognised inside a word, so
31
+ # unconstrained markup is needed whenever a word character touches it.
32
+ def unconstrained?(node, content, state)
33
+ return true if state[:non_flanking_whitesapce]
34
+
35
+ (content.match?(/\A\S/) && word_sibling?(node.previous, /\w\z/)) ||
36
+ (content.match?(/\S\z/) && word_sibling?(node.next, /\A\w/))
37
+ end
38
+
39
+ def word_sibling?(sibling, pattern)
40
+ sibling&.text? && sibling.text.match?(pattern)
41
+ end
42
+
15
43
  def bold_converted(node, state)
16
44
  cloned_node = node.clone
17
45
  equations = extract_equations(cloned_node)
@@ -23,14 +51,8 @@ module Stepmod
23
51
 
24
52
  content = if state[:equation] && state[:convert_bold_and_italics]
25
53
  "bb(#{content.strip})"
26
- elsif content.strip.empty? || state[:already_strong] || state[:equation]
27
- content
28
54
  else
29
- strong_tag = state[:non_flanking_whitesapce] ? "**" : "*"
30
- handle_express_escape_seq(
31
- node,
32
- "#{content[/^\s*/]}#{strong_tag}#{content.strip}#{strong_tag}#{content[/\s*$/]}",
33
- )
55
+ mark_up(node, content, state)
34
56
  end
35
57
 
36
58
  [content, equation_content].compact.join("")
@@ -66,8 +88,8 @@ module Stepmod
66
88
  end
67
89
  end
68
90
 
69
- Coradoc::Input::Html::Converters.register :strong, Strong.new
70
- Coradoc::Input::Html::Converters.register :b, Strong.new
91
+ Ceradoc::Html::Converters.register :strong, Strong.new
92
+ Ceradoc::Html::Converters.register :b, Strong.new
71
93
  end
72
94
  end
73
95
  end
@@ -3,7 +3,7 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Sub < Coradoc::Input::Html::Converters::Sub
6
+ class Sub < Ceradoc::Html::Converters::Sub
7
7
  def to_coradoc(node, state = {})
8
8
  if state[:equation]
9
9
  stem_notation(treat_children(node,
@@ -20,7 +20,7 @@ module Stepmod
20
20
  end
21
21
  end
22
22
 
23
- Coradoc::Input::Html::Converters.register :sub, Sub.new
23
+ Ceradoc::Html::Converters.register :sub, Sub.new
24
24
  end
25
25
  end
26
26
  end
@@ -3,7 +3,7 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Sup < Coradoc::Input::Html::Converters::Sup
6
+ class Sup < Ceradoc::Html::Converters::Sup
7
7
  def to_coradoc(node, state = {})
8
8
  if state[:equation]
9
9
  stem_notation(treat_children(node,
@@ -18,7 +18,7 @@ module Stepmod
18
18
  end
19
19
  end
20
20
 
21
- Coradoc::Input::Html::Converters.register :sup, Sup.new
21
+ Ceradoc::Html::Converters.register :sup, Sup.new
22
22
  end
23
23
  end
24
24
  end
@@ -9,7 +9,7 @@ module Stepmod
9
9
  end
10
10
  end
11
11
 
12
- Coradoc::Input::Html::Converters.register :synonym, Synonym.new
12
+ Ceradoc::Html::Converters.register :synonym, Synonym.new
13
13
  end
14
14
  end
15
15
  end
@@ -3,7 +3,7 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Table < Coradoc::Input::Html::Converters::Table
6
+ class Table < Ceradoc::Html::Converters::Table
7
7
  def self.pattern(state, id)
8
8
  if state[:schema_and_entity].nil?
9
9
  raise StandardError.new("[table]: no state given, #{id}")
@@ -72,7 +72,7 @@ module Stepmod
72
72
  end
73
73
  end
74
74
 
75
- Coradoc::Input::Html::Converters.register :table, Table.new
75
+ Ceradoc::Html::Converters.register :table, Table.new
76
76
  end
77
77
  end
78
78
  end
@@ -40,7 +40,7 @@ module Stepmod
40
40
  end
41
41
  end
42
42
 
43
- Coradoc::Input::Html::Converters.register :term, Term.new
43
+ Ceradoc::Html::Converters.register :term, Term.new
44
44
  end
45
45
  end
46
46
  end
@@ -3,7 +3,7 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Text < Coradoc::Input::Html::Converters::Text
6
+ class Text < Ceradoc::Html::Converters::Text
7
7
  def to_coradoc(node, state = {})
8
8
  if node.text.strip.empty?
9
9
  treat_empty(node, state)
@@ -64,7 +64,7 @@ module Stepmod
64
64
  end
65
65
  end
66
66
 
67
- Coradoc::Input::Html::Converters.register :text, Text.new
67
+ Ceradoc::Html::Converters.register :text, Text.new
68
68
  end
69
69
  end
70
70
  end
@@ -3,15 +3,15 @@
3
3
  module Stepmod
4
4
  module Utils
5
5
  module Converters
6
- class Tr < Coradoc::Input::Html::Converters::Tr
6
+ class Tr < Ceradoc::Html::Converters::Tr
7
7
  def to_coradoc(node, state = {})
8
8
  content = super(node, state)
9
9
  line_break = content.header ? "\n\n" : "\n"
10
- Coradoc::Generator.gen_adoc(content).rstrip + line_break
10
+ Stepmod::Utils::CeradocCompat.gen_adoc(content).rstrip + line_break
11
11
  end
12
12
  end
13
13
 
14
- Coradoc::Input::Html::Converters.register :tr, Tr.new
14
+ Ceradoc::Html::Converters.register :tr, Tr.new
15
15
  end
16
16
  end
17
17
  end
@@ -1,3 +1,4 @@
1
+ require "logger"
1
2
  require "plurimath"
2
3
  require "stepmod/utils"
3
4
 
@@ -1,3 +1,5 @@
1
+ require "pubid"
2
+
1
3
  module Stepmod
2
4
  module Utils
3
5
  class ExpressBibdata
@@ -22,7 +24,7 @@ module Stepmod
22
24
  @pubid = Pubid::Iso::Identifier.parse(published_info)
23
25
 
24
26
  @part = pubid.part&.to_i
25
- @version = pubid.edition&.to_i
27
+ @version = pubid.edition&.number&.to_i
26
28
  @pub_year = pubid.year&.to_i
27
29
  elsif !schema.version.nil?
28
30
  @part = schema.version.items.find { |i| i.name == "part" }.value&.to_i
@@ -0,0 +1,17 @@
1
+ require "stepmod/utils/change"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ class MappingChange < Change
6
+ ATTRIBUTES = %i[change description].freeze
7
+
8
+ attr_accessor(*ATTRIBUTES)
9
+
10
+ def initialize(change: nil, description: nil)
11
+ super()
12
+ @change = change
13
+ @description = description
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ require "stepmod/utils/change"
2
+
3
+ module Stepmod
4
+ module Utils
5
+ class SchemaChange < Change
6
+ ATTRIBUTES = %i[type name description interfaced_items].freeze
7
+
8
+ attr_accessor(*ATTRIBUTES)
9
+
10
+ def initialize(type:, name:, description: nil, interfaced_items: nil)
11
+ super()
12
+ @type = type
13
+ @name = name
14
+ @description = description
15
+ @interfaced_items = interfaced_items
16
+ end
17
+ end
18
+ end
19
+ end
@@ -34,8 +34,8 @@ module Stepmod
34
34
 
35
35
  root || (return "")
36
36
 
37
- Coradoc::Input::Html.config.with(options) do
38
- result = Coradoc::Input::Html::Converters.lookup(root.name).convert(root,
37
+ Ceradoc::Html.input_config.with(options) do
38
+ result = Ceradoc::Html::Converters.lookup(root.name).convert(root,
39
39
  options)
40
40
  Stepmod::Utils::Cleaner.new.tidy(result)
41
41
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "stepmod/utils/converters/base"
4
- require "coradoc/input/html/converters/bypass"
5
- require "coradoc/input/html/converters/pass_through"
4
+ require "ceradoc/html/converters/bypass"
5
+ require "ceradoc/html/converters/pass_through"
6
6
  require "stepmod/utils/converters/a"
7
7
  require "stepmod/utils/converters/comment"
8
8
  require "stepmod/utils/converters/dd"
@@ -30,11 +30,11 @@ require "stepmod/utils/converters/tr"
30
30
  require "stepmod/utils/converters/li"
31
31
  require "stepmod/utils/cleaner"
32
32
 
33
- require "coradoc/input/html/converters/img"
34
- require "coradoc/input/html/converters/li"
35
- require "coradoc/input/html/converters/tr"
36
- require "coradoc/input/html/converters/td"
37
- require "coradoc/input/html/converters/th"
33
+ require "ceradoc/html/converters/img"
34
+ require "ceradoc/html/converters/li"
35
+ require "ceradoc/html/converters/tr"
36
+ require "ceradoc/html/converters/td"
37
+ require "ceradoc/html/converters/td" # ceradoc registers :th on the same Td converter
38
38
 
39
39
  module Stepmod
40
40
  module Utils
@@ -51,8 +51,8 @@ module Stepmod
51
51
 
52
52
  root || (return "")
53
53
 
54
- Coradoc::Input::Html.config.with(options) do
55
- result = Coradoc::Input::Html::Converters.lookup(root.name).convert(root,
54
+ Ceradoc::Html.input_config.with(options) do
55
+ result = Ceradoc::Html::Converters.lookup(root.name).convert(root,
56
56
  options)
57
57
 
58
58
  Stepmod::Utils::Cleaner.new.tidy(result)
@@ -18,22 +18,22 @@ require "stepmod/utils/converters/figure"
18
18
  require "stepmod/utils/converters/table"
19
19
  require "stepmod/utils/cleaner"
20
20
 
21
- require "coradoc/input/html/converters/a"
22
- require "coradoc/input/html/converters/blockquote"
23
- require "coradoc/input/html/converters/bypass"
24
- require "coradoc/input/html/converters/br"
25
- require "coradoc/input/html/converters/code"
26
- require "coradoc/input/html/converters/drop"
27
- require "coradoc/input/html/converters/head"
28
- require "coradoc/input/html/converters/hr"
29
- require "coradoc/input/html/converters/ignore"
30
- require "coradoc/input/html/converters/li"
31
- require "coradoc/input/html/converters/pass_through"
32
- require "coradoc/input/html/converters/q"
33
- require "coradoc/input/html/converters/strong"
34
- require "coradoc/input/html/converters/sup"
35
- require "coradoc/input/html/converters/sub"
36
- require "coradoc/input/html/converters/text"
21
+ require "ceradoc/html/converters/a"
22
+ require "ceradoc/html/converters/blockquote"
23
+ require "ceradoc/html/converters/bypass"
24
+ require "ceradoc/html/converters/br"
25
+ require "ceradoc/html/converters/code"
26
+ require "ceradoc/html/converters/drop"
27
+ require "ceradoc/html/converters/head"
28
+ require "ceradoc/html/converters/hr"
29
+ require "ceradoc/html/converters/drop" # old coradoc Ignore (colgroup/col) is the ceradoc Skip registry
30
+ require "ceradoc/html/converters/li"
31
+ require "ceradoc/html/converters/pass_through"
32
+ require "ceradoc/html/converters/q"
33
+ require "ceradoc/html/converters/strong"
34
+ require "ceradoc/html/converters/sup"
35
+ require "ceradoc/html/converters/sub"
36
+ require "ceradoc/html/converters/text"
37
37
 
38
38
  module Stepmod
39
39
  module Utils
@@ -50,8 +50,8 @@ module Stepmod
50
50
 
51
51
  return "" unless root
52
52
 
53
- Coradoc::Input::Html.config.with(options) do
54
- result = Coradoc::Input::Html::Converters.lookup(root.name).convert(root,
53
+ Ceradoc::Html.input_config.with(options) do
54
+ result = Ceradoc::Html::Converters.lookup(root.name).convert(root,
55
55
  options)
56
56
  return "" unless result
57
57
 
@@ -87,7 +87,7 @@ module Stepmod
87
87
  # TODO there are schemas with only arm, mim, mim_lf:
88
88
  # schemas/modules/limited_length_or_area_indicator_assignment/mim_lf.exp
89
89
  part = @identifier.part
90
- edition = @identifier.edition
90
+ edition = @identifier.edition&.number
91
91
  schema_or_object = (schema_type == :module) ? "schema" : "object"
92
92
 
93
93
  "\nSCHEMA #{@schema_name} '{ " \
@@ -246,6 +246,11 @@ processed_images_cache)
246
246
  examples = description.xpath("example")
247
247
  figures = description.xpath("figure")
248
248
  tables = description.xpath("table")
249
+ state = {
250
+ schema_and_entity: description["linkend"],
251
+ descriptions_file: descriptions_file,
252
+ figure_ids: figures.map { |f| f["id"] || f["number"] },
253
+ }
249
254
 
250
255
  converted_description = <<~DESCRIPTION
251
256
 
@@ -253,6 +258,7 @@ processed_images_cache)
253
258
  wrapper,
254
259
  no_notes_examples: true,
255
260
  descriptions_file: descriptions_file,
261
+ figure_ids: state[:figure_ids],
256
262
  )}
257
263
  DESCRIPTION
258
264
 
@@ -263,7 +269,7 @@ processed_images_cache)
263
269
  converted_figures = figures.map do |figure|
264
270
  Stepmod::Utils::Converters::ExpressFigure
265
271
  .new
266
- .convert(figure, schema_and_entity: description["linkend"], descriptions_file: descriptions_file)
272
+ .convert(figure, state)
267
273
  end.join
268
274
 
269
275
  converted_tables = tables.map do |table|
@@ -275,13 +281,13 @@ processed_images_cache)
275
281
  converted_notes = notes.map do |note|
276
282
  Stepmod::Utils::Converters::ExpressNote
277
283
  .new
278
- .convert(note, schema_and_entity: description["linkend"], descriptions_file: descriptions_file)
284
+ .convert(note, state)
279
285
  end.join
280
286
 
281
287
  converted_examples = examples.map do |example|
282
288
  Stepmod::Utils::Converters::ExpressExample
283
289
  .new
284
- .convert(example, schema_and_entity: description["linkend"], descriptions_file: descriptions_file)
290
+ .convert(example, state)
285
291
  end.join
286
292
 
287
293
  [
@@ -402,16 +408,12 @@ processed_images_cache)
402
408
  year = "" if year == "tbd"
403
409
  edition = bib.attributes["version"].value
404
410
 
405
- pubid = Pubid::Iso::Identifier.create(
406
- publisher: "ISO",
407
- number: 10303,
408
- )
409
-
410
- pubid.part = part if part && !part.empty?
411
- pubid.year = year.split("-").first if year && !year.empty?
412
- pubid.edition = edition if edition && !edition.empty?
411
+ attrs = { number: 10303 }
412
+ attrs[:part] = part if part && !part.empty?
413
+ attrs[:date] = { year: year.split("-").first } if year && !year.empty?
414
+ attrs[:edition] = { number: edition } if edition && !edition.empty?
413
415
 
414
- pubid
416
+ Pubid::Iso::Identifier.new(**attrs)
415
417
  end
416
418
 
417
419
  def resource_bib_data(bib, schema_and_entity)
@@ -8,7 +8,7 @@ require "expressir/express/parser"
8
8
  require "indefinite_article"
9
9
  require "pubid"
10
10
 
11
- Coradoc::Input::Html.config.unknown_tags = :bypass
11
+ Ceradoc::Html.input_config.unknown_tags = :bypass
12
12
 
13
13
  module Stepmod
14
14
  module Utils
@@ -541,12 +541,12 @@ document:)
541
541
  raise Error.new("[stepmod-utils] encountered unsupported schema_type")
542
542
  end
543
543
 
544
- if entity.subtype_of.empty?
544
+ if entity.subtype_of.to_a.empty?
545
545
  "#{entity_type} " \
546
546
  "that represents the " \
547
547
  "#{entity_name_to_text(entity.id)} {{entity}}"
548
548
  else
549
- entity_subtypes = entity.subtype_of.map do |e|
549
+ entity_subtypes = entity.subtype_of.to_a.map do |e|
550
550
  "{{#{e.id}}}"
551
551
  end
552
552
 
@@ -1,5 +1,5 @@
1
1
  module Stepmod
2
2
  module Utils
3
- VERSION = "0.6.10.pre.alpha.1".freeze
3
+ VERSION = "0.6.11".freeze
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
  spec.files = `git ls-files`.split("\n")
20
20
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
21
- spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
21
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -32,17 +32,28 @@ Gem::Specification.new do |spec|
32
32
  spec.require_paths = ["lib"]
33
33
 
34
34
  spec.add_dependency "concurrent-ruby"
35
- spec.add_dependency "coradoc", "~> 1.1.7"
35
+ # HTML→AsciiDoc conversion runs through the ceradoc monorepo (renamed
36
+ # coradoc → coridoc → ceradoc, 2026-11-25): ceradoc-html carries the
37
+ # html input converters (the old coradoc 1.x coradoc/input/html API),
38
+ # ceradoc-adoc the AsciiDoc writer. The string-mode converter chain
39
+ # bridges onto the CoreModel engine in lib/stepmod/utils/ceradoc_compat.rb.
40
+ spec.add_dependency "ceradoc", "~> 3.0"
41
+ spec.add_dependency "ceradoc-html", "~> 1.1"
42
+ spec.add_dependency "ceradoc-adoc", "~> 2.0"
36
43
  spec.add_dependency "down"
37
44
  spec.add_dependency "expressir"
38
45
  spec.add_dependency "glossarist", "~> 2.0"
39
46
  spec.add_dependency "indefinite_article"
47
+ # stepmod parses source HTML with Nokogiri directly (converter state
48
+ # walk + specs); the old coradoc 1.1 line used to carry it in.
49
+ spec.add_dependency "nokogiri"
40
50
  spec.add_dependency "octokit"
41
51
  spec.add_dependency "plurimath"
42
52
  spec.add_dependency "ptools"
43
53
  # The pubid monogem ships Pubid::Iso itself; the separate pubid-iso
44
54
  # gem is superseded and its lib/pubid/iso.rb shadows the monogem's.
45
- spec.add_dependency "pubid", "~> 2.0.0.pre.alpha"
55
+ spec.add_dependency "pubid", "~> 2.0"
56
+ spec.add_dependency "relaton", "~> 3.0"
46
57
  spec.add_dependency "shale"
47
58
  spec.add_dependency "thor", ">= 0.20"
48
59
  spec.add_dependency "unitsml"