asciidoctor-dita-topic 1.1.9 → 1.2.0
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/README.adoc +0 -4
- data/lib/dita-topic.rb +45 -6
- 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: 51a2caa5d7a9ffe86c7953d7ac7b7be5b75e805e2cc26f1d5b41cfcbc82c876d
|
4
|
+
data.tar.gz: 37951e25ad0227c52b0d1aeb1c37c8195bcc316a7f2073e1fc3c22d7b4bb5592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23a3d3efe86dc34fcf92014fa9e2f3c08c8a9ac76150f22e0dea7951239170cbbcd18d0477797c0acad7464dc401ae849010c4409271d1df4d4b38deb5a04c63
|
7
|
+
data.tar.gz: 2bf8a48fcd886f3674f21ce2676c1de1e9e7b3564a87803500d6d4994dec573b24608e50e5caadaccc9b98e1d6baefec3c26a0690590fd384b4814faa4513fe8
|
data/README.adoc
CHANGED
@@ -222,8 +222,6 @@ This possible warning messages are as follows:
|
|
222
222
|
[horizontal]
|
223
223
|
Admonition titles not supported in DITA:: AsciiDoc allows you to add a custom title to any admonition by including `._Admonition title_` on the line above it. Unlike AsciiDoc, DITA does not allow titles for admonitions. `dita-topic` issues this warning whenever an admonition has a title defined in the converted AsciiDoc file.
|
224
224
|
|
225
|
-
Audio macro not supported:: AsciiDoc allows you to embed audio content in your documents by using the `audio::__audio_file__[]` macro. `dita-topic` does not implement this feature and issues this warning whenever the `audio` macro is present in the converted AsciiDoc file.
|
226
|
-
|
227
225
|
Author lines not enabled for topics:: AsciiDoc interprets the first line that directly follows the document title as an author line. Because topics are not expected to have author lines, `dita-topic` issues this warning when an author line is present in the converted AsciiDoc file.
|
228
226
|
|
229
227
|
Block titles not supported in DITA:: AsciiDoc allows you to include `._Block title_` on the line above most of the block elements to assign a custom title to them. Unlike AsciiDoc, DITA only allows titles to be assigned to a limited number of elements. `dita-topic` issues this warning when the `-a dita-topic-titles=off` option is specified and a block title is present in the converted AsciiDoc file.
|
@@ -250,8 +248,6 @@ Table footers not supported in DITA:: AsciiDoc allows you to set the `footer` op
|
|
250
248
|
|
251
249
|
Thematic breaks not supported in DITA:: Asciidoc allows you to use `'''`, `---`, or `\***` (the last two with possible optional spaces in between the characters) to insert a thematic break in between two blocks, most commonly represented by a horizontal line. Unlike AsciiDoc, DITA does not support thematic breaks. `dita-topic` issues this warning whenever a thematic break is present in the converted AsciiDoc file.
|
252
250
|
|
253
|
-
Video macro not supported:: AsciiDoc allows you to embed video content in your documents by using the `video::__video_file__[]` macro. `dita-topic` does not implement this feature and issues this warning whenever the `video` macro is present in the converted AsciiDoc file.
|
254
|
-
|
255
251
|
[#copyright]
|
256
252
|
== Copyright
|
257
253
|
|
data/lib/dita-topic.rb
CHANGED
@@ -129,9 +129,16 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def convert_audio node
|
132
|
-
#
|
133
|
-
|
134
|
-
|
132
|
+
# Check if the audio macro has a title specified:
|
133
|
+
if node.title?
|
134
|
+
<<~EOF.chomp
|
135
|
+
<object data="#{node.media_uri(node.attr 'target')}">
|
136
|
+
<desc>#{node.title}</desc>
|
137
|
+
</object>
|
138
|
+
EOF
|
139
|
+
else
|
140
|
+
%(<object data="#{node.media_uri(node.attr 'target')}" />)
|
141
|
+
end
|
135
142
|
end
|
136
143
|
|
137
144
|
def convert_colist node
|
@@ -795,9 +802,41 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
795
802
|
end
|
796
803
|
|
797
804
|
def convert_video node
|
798
|
-
#
|
799
|
-
|
800
|
-
|
805
|
+
# Check if additional attributes are specified:
|
806
|
+
width = (node.attr? 'width') ? %( width="#{node.attr 'width'}") : ''
|
807
|
+
height = (node.attr? 'height') ? %( height="#{node.attr 'height'}") : ''
|
808
|
+
|
809
|
+
# Check if the video is a Vimeo or YouTube video:
|
810
|
+
if (provider = (node.attr 'poster')) == 'youtube'
|
811
|
+
# Separate a playlist from the target:
|
812
|
+
target, list = (node.attr 'target').split '/', 2
|
813
|
+
|
814
|
+
# Check if the playlist is provided as an attribute:
|
815
|
+
if node.attr 'list' and not list
|
816
|
+
list = node.attr 'list'
|
817
|
+
end
|
818
|
+
|
819
|
+
# Compose the playlist URL fragment:
|
820
|
+
list = list ? %(?list=#{list}) : ''
|
821
|
+
|
822
|
+
# Compose the target URL:
|
823
|
+
target_url = %(https://www.youtube.com/embed/#{target}#{list})
|
824
|
+
elsif provider == 'vimeo'
|
825
|
+
target_url = %(https://player.vimeo.com/video/#{node.attr 'target'})
|
826
|
+
else
|
827
|
+
target_url = node.media_uri(node.attr 'target')
|
828
|
+
end
|
829
|
+
|
830
|
+
# Check if the audio macro has a title specified:
|
831
|
+
if node.title?
|
832
|
+
<<~EOF.chomp
|
833
|
+
<object data="#{target_url}"#{width}#{height}>
|
834
|
+
<desc>#{node.title}</desc>
|
835
|
+
</object>
|
836
|
+
EOF
|
837
|
+
else
|
838
|
+
%(<object data="#{target_url}"#{width}#{height} />)
|
839
|
+
end
|
801
840
|
end
|
802
841
|
|
803
842
|
def compose_qanda_dlist node
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-dita-topic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaromir Hradilek
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-06-
|
10
|
+
date: 2025-06-23 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: asciidoctor
|