isodoc 3.7.14 → 3.7.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26304ea4ca6dbe6643bae0629a7fd656957cabe55c141061724d30458c7164af
4
- data.tar.gz: 0b4983fa5133a0f4adc3eaa6fa6c3f5542fda815bca1073db449472235b59521
3
+ metadata.gz: b3701ef0c0696c15bc2dd4ca2e53ebd2ac8d6537ae1c42753aa70b7ccb393b5b
4
+ data.tar.gz: 5247ea712405f4e65a076ed7895e942a0ca358862cac8b6287df3be86750c5e2
5
5
  SHA512:
6
- metadata.gz: cd0777a76a09bb838217f3df671d40b6827b4167b5bf4c689d542e4327c98a8930e61cce7ba810ac5cbf6065a9b038c27724e676b019d4165efcd8054140b966
7
- data.tar.gz: 16568ed7a5ff13793ba98729f711387f8a284d5308a96f53c39b15250caac066c9e8efe7591d1250f303d0d811c7d2e1a090097272f5b4bc700cedf203517d92
6
+ metadata.gz: ec06723c5b0546f8ab2addd40595875ace2b48dcded48de5844828f48dcb50752369739093a916cf37057da485c6b32c93a038dbd67da12ed375fa56bf756bbe
7
+ data.tar.gz: fca0121441106e42448442384648e1e8362c91518ebddc5b0454ef0886ff1661a3c631f2ee9e8f0d03065b88a5dfdb4430546397a479234f69068c39268198e5
@@ -29,6 +29,20 @@
29
29
  @include blockTitle();
30
30
  text-align: left;
31
31
  }
32
+
33
+ // Bulletless lists: ul/ol type="nobullet"|"no-bullet"|"none" carry
34
+ // class="nobullet" in HTML output. Suppress both the native list
35
+ // markers and the ::before marker glyphs some flavors hang off
36
+ // list items (e.g. the em-dash bullet).
37
+ ul.nobullet > li,
38
+ ol.nobullet > li {
39
+ list-style: none;
40
+ }
41
+
42
+ ul.nobullet > li > p:first-child::before,
43
+ ol.nobullet > li::before {
44
+ content: none !important;
45
+ }
32
46
  }
33
47
 
34
48
  @mixin figureBlock() {
@@ -1,6 +1,10 @@
1
1
  module IsoDoc
2
2
  module Function
3
3
  module Lists
4
+ # semantic list types which suppress list markers in rendering:
5
+ # nobullet (metanorma), no-bullet / none (asciidoctor-derived)
6
+ NO_BULLET_TYPES = %w(nobullet no-bullet none).freeze
7
+
4
8
  def list_title_parse(node, out)
5
9
  name = node.at(ns("./fmt-name")) or return
6
10
  out.p class: "ListTitle" do |p|
@@ -8,8 +12,17 @@ module IsoDoc
8
12
  end
9
13
  end
10
14
 
15
+ # Bulletless lists carry a class, which the stylesheets use to
16
+ # suppress the list markers (HTML) and which flags the Word
17
+ # conversion to render the items as plain paragraphs.
18
+ def list_base_class(node)
19
+ NO_BULLET_TYPES.include?(node["type"]) and return "nobullet"
20
+ nil
21
+ end
22
+
11
23
  def ul_attrs(node)
12
- { id: node["id"], class: node["class"], style: keep_style(node) }
24
+ { id: node["id"], class: merge_html_class(list_base_class(node), node),
25
+ style: keep_style(node) }
13
26
  end
14
27
 
15
28
  def ul_parse(node, out)
@@ -46,7 +59,9 @@ module IsoDoc
46
59
  { # type: node["type"] ? ol_style(node["type"].to_sym) : ol_depth(node),
47
60
  type: ol_style(node["type"]&.to_sym),
48
61
  start: node["start"],
49
- id: node["id"], class: node["class"], style: keep_style(node)
62
+ id: node["id"],
63
+ class: merge_html_class(list_base_class(node), node),
64
+ style: keep_style(node)
50
65
  }
51
66
  end
52
67
 
@@ -2,10 +2,43 @@
2
2
 
3
3
  require "sassc-embedded"
4
4
 
5
+ # Resolves and reads stylesheet imports on the Ruby side, carrying the
6
+ # contents inline in the Import. The sass helper process then never touches
7
+ # the filesystem for an import — which is what lets the render run against
8
+ # stylesheets that live inside a read-only packaged image (tebako payloads):
9
+ # the helper's own filesystem view does not include the image's paths, so a
10
+ # path-only Import dies helper-side as "Can't find stylesheet to import"
11
+ # (tebako#1056). Reads here go through Ruby's File, which the packaged
12
+ # runtime's IO shims answer from the image on every platform.
5
13
  class SasscImporter < SassC::Importer
6
- def imports(path, _parent_path)
14
+ def initialize(options)
15
+ super
16
+ @load_paths = Array(options[:load_paths])
17
+ end
18
+
19
+ def imports(path, parent_path)
7
20
  unless path.match?(/(css|scss)$/)
21
+ resolved = resolve(path, parent_path)
22
+ return Import.new(resolved, source: File.read(resolved)) if resolved
23
+
24
+ # A path Ruby cannot see (a helper-owned or built-in spelling) keeps
25
+ # the historic shape: the name, path-only, resolved by the helper.
8
26
  Import.new("#{path}.scss")
9
27
  end
10
28
  end
29
+
30
+ private
31
+
32
+ # dart-sass's resolution order for the forms isodoc's stylesheets use:
33
+ # the importing file's own directory first, then the load paths; the
34
+ # partial (_-prefixed) spelling beside the plain one.
35
+ def resolve(path, parent_path)
36
+ dirs = [parent_path && File.dirname(parent_path), *@load_paths].compact.uniq
37
+ dirs.each do |dir|
38
+ [File.join(dir, "_#{path}.scss"), File.join(dir, "#{path}.scss")].each do |candidate|
39
+ return candidate if File.file?(candidate)
40
+ end
41
+ end
42
+ nil
43
+ end
11
44
  end
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "3.7.14".freeze
2
+ VERSION = "3.7.16".freeze
3
3
  end
@@ -113,6 +113,26 @@ module IsoDoc
113
113
  else ""
114
114
  end
115
115
  end
116
+
117
+ # Bulletless lists (ul/ol class="nobullet", from list
118
+ # type="nobullet"|"no-bullet"|"none") become plain paragraphs: the
119
+ # list markup is dropped before Html2Doc converts HTML lists to
120
+ # Word list paragraphs, so no bullet or number marker is generated.
121
+ # Nested lists keep their own markers. The list wrapper is kept as
122
+ # a div to preserve the list anchor.
123
+ def word_nobullet_lists(docxml)
124
+ docxml.xpath("//ul[@class = 'nobullet'] | //ol[@class = 'nobullet']")
125
+ .each do |list|
126
+ list.xpath("./li").each do |li|
127
+ li.name = "p"
128
+ li.delete("class")
129
+ li.first_element_child&.name == "p" and
130
+ li.first_element_child.replace(li.first_element_child.children)
131
+ end
132
+ list.name = "div"
133
+ list.delete("class")
134
+ end
135
+ end
116
136
  end
117
137
  end
118
138
  end
@@ -58,6 +58,7 @@ module IsoDoc
58
58
  word_table_pagebreak(docxml)
59
59
  word_table_separator(docxml)
60
60
  word_admonition_images(docxml)
61
+ word_nobullet_lists(docxml)
61
62
  word_list_continuations(docxml)
62
63
  word_example_cleanup(docxml)
63
64
  word_pseudocode_cleanup(docxml)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.14
4
+ version: 3.7.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-12 00:00:00.000000000 Z
11
+ date: 2026-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64