asciidoctor-dita-topic 1.1.2 → 1.1.3
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/dita-topic.rb +21 -19
- 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: 26ce0f384369b685c43454ec161ac81cdd99c630c85bef52d16e0cff55423166
|
4
|
+
data.tar.gz: ba0257aa9f21b1f958e07103ecc9c7bd5476bf02038c0110feeb8c8c0fc36731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf9814f61b806557250d29b32cf5ae640cf4345a9e5657a856ce4173de9cbdbc1a2a89a4295a528a82d073f4ccae11a3b321e00902531ed9c18256f8dd6472f9
|
7
|
+
data.tar.gz: c0693f56fccd42fdc39813a676ca5475670bd7aa5e4a3a5ecb71d45e140d2bfb8861bc093fa6334af3bb4c1f20fafc143237f03557fda52f816a9b055b0b4459
|
data/lib/dita-topic.rb
CHANGED
@@ -142,42 +142,36 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
142
142
|
# Reset the counter:
|
143
143
|
number = 0
|
144
144
|
|
145
|
-
# Open the
|
146
|
-
result = ['<
|
147
|
-
result << %(<tgroup cols="2">)
|
148
|
-
result << %(<colspec colwidth="15*" />)
|
149
|
-
result << %(<colspec colwidth="85*" />)
|
150
|
-
result << %(<tbody>)
|
145
|
+
# Open the definition list:
|
146
|
+
result = ['<dl outputclass="callout-list">']
|
151
147
|
|
152
148
|
# Process individual list items:
|
153
149
|
node.items.each do |item|
|
154
150
|
# Increment the counter:
|
155
151
|
number += 1
|
156
152
|
|
157
|
-
# Open the
|
158
|
-
result << %(<
|
153
|
+
# Open the definition entry:
|
154
|
+
result << %(<dlentry>)
|
159
155
|
|
160
156
|
# Compose the callout number:
|
161
|
-
result << %(<
|
157
|
+
result << %(<dt>#{compose_circled_number number}</dt>)
|
162
158
|
|
163
159
|
# Check if description contains multiple block elements:
|
164
160
|
if item.blocks
|
165
|
-
result << %(<
|
166
|
-
result <<
|
161
|
+
result << %(<dd>)
|
162
|
+
result << item.text
|
167
163
|
result << item.content
|
168
|
-
result << %(</
|
164
|
+
result << %(</dd>)
|
169
165
|
else
|
170
166
|
result << %(<entry>#{item.text}</entry>)
|
171
167
|
end
|
172
168
|
|
173
|
-
# Close the
|
174
|
-
result << %(</
|
169
|
+
# Close the definition entry:
|
170
|
+
result << %(</dlentry>)
|
175
171
|
end
|
176
172
|
|
177
|
-
# Close the
|
178
|
-
result << %(</
|
179
|
-
result << %(</tgroup>)
|
180
|
-
result << %(</table>)
|
173
|
+
# Close the definition list:
|
174
|
+
result << %(</dl>)
|
181
175
|
|
182
176
|
# Return the XML output:
|
183
177
|
result.join LF
|
@@ -248,12 +242,16 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
248
242
|
%(<p outputclass="title sect#{node.level}"><b>#{node.title}</b></p>)
|
249
243
|
end
|
250
244
|
|
251
|
-
def convert_image
|
245
|
+
def convert_image node
|
252
246
|
# Check if additional attributes are specified:
|
253
247
|
width = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : ''
|
254
248
|
height = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : ''
|
255
249
|
scale = (node.attr? 'scale') ? %( scale="#{(node.attr 'scale').tr('%', '')}") : ''
|
256
250
|
|
251
|
+
# Exclude width and height attributes with percentage values:
|
252
|
+
width = '' if width.include? '%'
|
253
|
+
height = '' if height.include? '%'
|
254
|
+
|
257
255
|
# Check if the image has a title specified:
|
258
256
|
if node.title?
|
259
257
|
<<~EOF.chomp
|
@@ -365,6 +363,10 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
365
363
|
width = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : ''
|
366
364
|
height = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : ''
|
367
365
|
|
366
|
+
# Exclude width and height attributes with percentage values:
|
367
|
+
width = '' if width.include? '%'
|
368
|
+
height = '' if height.include? '%'
|
369
|
+
|
368
370
|
# Return the XML output:
|
369
371
|
%(<image href="#{node.image_uri node.target}"#{width}#{height} placement="inline"><alt>#{node.alt}</alt></image>)
|
370
372
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-dita-topic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaromir Hradilek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|