isodoc 3.7.13 → 3.7.15
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/lib/isodoc/base_style/blocks.scss +14 -0
- data/lib/isodoc/function/lists.rb +17 -2
- data/lib/isodoc/presentation_function/footnotes.rb +4 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/lists.rb +20 -0
- data/lib/isodoc/word_function/postprocess.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4afaff3e617e583fd9708d437b214c5c4c2440ff94c8798e8e520243af566d26
|
|
4
|
+
data.tar.gz: d5fd9feb601fe761c21f68eeb40fd0d75c5713c32b17f0b6cf8274a82c3247cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45e9943aaf1c7a7b134162600849879a8fdf18149df8b60168e1f3710b3a064cc20cb80f0668341ab1740af722525b9ec64704597561629660e7383a3b93992f
|
|
7
|
+
data.tar.gz: 1d2df807685ebc2a5fc578ce6f951faaabe12d35da120ccb4dfc740d0351d106912a288e4d522519f7d945db0cf12575e45463029050274a74eeb7152e10d015
|
|
@@ -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
|
|
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"],
|
|
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
|
|
|
@@ -39,7 +39,10 @@ module IsoDoc
|
|
|
39
39
|
|
|
40
40
|
def insert_fn_body_ref(fnote, body)
|
|
41
41
|
ins = body.at(ns(".//p")) ||
|
|
42
|
-
body.at(ns("./semx"))
|
|
42
|
+
body.at(ns("./semx"))&.children&.first&.before("<p> </p>")&.previous
|
|
43
|
+
# no footnote body content to attach the label to,
|
|
44
|
+
# e.g. empty <fn/> element
|
|
45
|
+
ins or return
|
|
43
46
|
lbl = fn_body_label(fnote)
|
|
44
47
|
fnote = <<~FNOTE.strip
|
|
45
48
|
<fmt-fn-label><span class='fmt-caption-label'>#{lbl}</span><span class="fmt-caption-delim"><tab/></fmt-fn-label>
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -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
|
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.
|
|
4
|
+
version: 3.7.15
|
|
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-
|
|
11
|
+
date: 2026-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|