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.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +6 -0
- data/.rubocop.yml +1 -1
- data/README.adoc +67 -0
- data/exe/stepmod-convert-bibliography +97 -0
- data/lib/stepmod/utils/bibliography_converter.rb +294 -0
- data/lib/stepmod/utils/ceradoc_compat.rb +95 -0
- data/lib/stepmod/utils/change.rb +3 -109
- data/lib/stepmod/utils/change_collection.rb +3 -3
- data/lib/stepmod/utils/change_file.rb +117 -0
- data/lib/stepmod/utils/cleaner.rb +25 -5
- data/lib/stepmod/utils/converters/a.rb +15 -1
- data/lib/stepmod/utils/converters/arm.rb +1 -1
- data/lib/stepmod/utils/converters/base.rb +3 -3
- data/lib/stepmod/utils/converters/clause_ref.rb +1 -1
- data/lib/stepmod/utils/converters/comment.rb +1 -1
- data/lib/stepmod/utils/converters/dd.rb +1 -1
- data/lib/stepmod/utils/converters/def.rb +2 -2
- data/lib/stepmod/utils/converters/definition.rb +1 -1
- data/lib/stepmod/utils/converters/description.rb +1 -1
- data/lib/stepmod/utils/converters/dl.rb +1 -1
- data/lib/stepmod/utils/converters/dt.rb +1 -1
- data/lib/stepmod/utils/converters/em.rb +2 -2
- data/lib/stepmod/utils/converters/em_express_description.rb +30 -1
- data/lib/stepmod/utils/converters/eqn.rb +2 -2
- data/lib/stepmod/utils/converters/example.rb +1 -1
- data/lib/stepmod/utils/converters/express_figure.rb +1 -1
- data/lib/stepmod/utils/converters/express_g.rb +1 -1
- data/lib/stepmod/utils/converters/express_note.rb +1 -1
- data/lib/stepmod/utils/converters/express_ref.rb +1 -1
- data/lib/stepmod/utils/converters/express_ref_express_description.rb +1 -1
- data/lib/stepmod/utils/converters/ext_description.rb +1 -1
- data/lib/stepmod/utils/converters/ext_descriptions.rb +1 -1
- data/lib/stepmod/utils/converters/figure.rb +6 -5
- data/lib/stepmod/utils/converters/fund_cons.rb +1 -1
- data/lib/stepmod/utils/converters/introduction.rb +1 -1
- data/lib/stepmod/utils/converters/li.rb +3 -3
- data/lib/stepmod/utils/converters/module_ref.rb +1 -1
- data/lib/stepmod/utils/converters/module_ref_express_description.rb +1 -1
- data/lib/stepmod/utils/converters/note.rb +1 -1
- data/lib/stepmod/utils/converters/ol.rb +3 -3
- data/lib/stepmod/utils/converters/resource.rb +1 -1
- data/lib/stepmod/utils/converters/schema.rb +1 -1
- data/lib/stepmod/utils/converters/schema_diag.rb +1 -1
- data/lib/stepmod/utils/converters/stepmod_ext_description.rb +1 -1
- data/lib/stepmod/utils/converters/strong.rb +31 -9
- data/lib/stepmod/utils/converters/sub.rb +2 -2
- data/lib/stepmod/utils/converters/sup.rb +2 -2
- data/lib/stepmod/utils/converters/synonym.rb +1 -1
- data/lib/stepmod/utils/converters/table.rb +2 -2
- data/lib/stepmod/utils/converters/term.rb +1 -1
- data/lib/stepmod/utils/converters/text.rb +2 -2
- data/lib/stepmod/utils/converters/tr.rb +3 -3
- data/lib/stepmod/utils/equation_logger.rb +1 -0
- data/lib/stepmod/utils/express_bibdata.rb +3 -1
- data/lib/stepmod/utils/mapping_change.rb +17 -0
- data/lib/stepmod/utils/schema_change.rb +19 -0
- data/lib/stepmod/utils/smrl_description_converter.rb +2 -2
- data/lib/stepmod/utils/smrl_resource_converter.rb +9 -9
- data/lib/stepmod/utils/stepmod_definition_converter.rb +18 -18
- data/lib/stepmod/utils/stepmod_file_annotator.rb +15 -13
- data/lib/stepmod/utils/terms_extractor.rb +3 -3
- data/lib/stepmod/utils/version.rb +1 -1
- data/stepmod-utils.gemspec +14 -3
- metadata +75 -9
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
module Stepmod
|
|
4
4
|
module Utils
|
|
5
5
|
module Converters
|
|
6
|
-
class 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 =
|
|
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
|
-
|
|
17
|
+
Ceradoc::Html::Converters.register :li, Li.new
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
module Stepmod
|
|
4
4
|
module Utils
|
|
5
5
|
module Converters
|
|
6
|
-
class 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 :
|
|
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
|
-
|
|
18
|
+
Ceradoc::Html::Converters.register tag.to_sym, Ol.new
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
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
|
-
|
|
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
|
-
|
|
70
|
-
|
|
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 <
|
|
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
|
-
|
|
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 <
|
|
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
|
-
|
|
21
|
+
Ceradoc::Html::Converters.register :sup, Sup.new
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Stepmod
|
|
4
4
|
module Utils
|
|
5
5
|
module Converters
|
|
6
|
-
class 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
|
-
|
|
75
|
+
Ceradoc::Html::Converters.register :table, Table.new
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
78
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Stepmod
|
|
4
4
|
module Utils
|
|
5
5
|
module Converters
|
|
6
|
-
class 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
|
-
|
|
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 <
|
|
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
|
-
|
|
10
|
+
Stepmod::Utils::CeradocCompat.gen_adoc(content).rstrip + line_break
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Ceradoc::Html::Converters.register :tr, Tr.new
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -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
|
-
|
|
38
|
-
result =
|
|
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 "
|
|
5
|
-
require "
|
|
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 "
|
|
34
|
-
require "
|
|
35
|
-
require "
|
|
36
|
-
require "
|
|
37
|
-
require "
|
|
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
|
-
|
|
55
|
-
result =
|
|
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 "
|
|
22
|
-
require "
|
|
23
|
-
require "
|
|
24
|
-
require "
|
|
25
|
-
require "
|
|
26
|
-
require "
|
|
27
|
-
require "
|
|
28
|
-
require "
|
|
29
|
-
require "
|
|
30
|
-
require "
|
|
31
|
-
require "
|
|
32
|
-
require "
|
|
33
|
-
require "
|
|
34
|
-
require "
|
|
35
|
-
require "
|
|
36
|
-
require "
|
|
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
|
-
|
|
54
|
-
result =
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
data/stepmod-utils.gemspec
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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
|
|
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"
|