asciidoctor-dita-topic 1.5.4 → 1.5.6
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/cli.rb +1 -1
- data/lib/dita-topic/filter.rb +8 -2
- data/lib/dita-topic/version.rb +1 -1
- data/lib/dita-topic.rb +23 -5
- 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: c9483eccb7fb179228b0139123e596f83b4839704945e703c501de9aeb424a22
|
|
4
|
+
data.tar.gz: 1d29ee12f77dab2d75e8038c65b37d11d4400d5450c747d9864b6a358921b5e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5cf176f0c0d0d234452d8380240203419fd528f13677fa314756474e28a34138982b0130e880e862a0c3280f9a8dcc8f570b251611fa4c2ba82b131244144b80
|
|
7
|
+
data.tar.gz: 5ce0805a250df4f3b862c2adb8f71be30f6cf580b73bb3672ad8b8be1dbe405004b2ce0bc34b03f88f5bb71ee133ca90104bab60d1d6f20521c31808ae32054e
|
data/lib/dita-topic/cli.rb
CHANGED
|
@@ -73,7 +73,7 @@ module AsciidoctorDitaTopic
|
|
|
73
73
|
@opts[:no_includes] = true
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
opt.on('-A', '--no-modules', 'disable processing of include directives with assemblies and
|
|
76
|
+
opt.on('-A', '--no-modules', 'disable processing of include directives with assemblies, modules, and attributes') do
|
|
77
77
|
@opts[:modules] = false
|
|
78
78
|
end
|
|
79
79
|
|
data/lib/dita-topic/filter.rb
CHANGED
|
@@ -31,7 +31,13 @@ class FilterIncludeDirectives < Asciidoctor::Extensions::IncludeProcessor
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def process doc, reader, target, attributes
|
|
34
|
-
|
|
34
|
+
base_dir = Pathname.new(doc.base_dir)
|
|
35
|
+
|
|
36
|
+
if reader.cursor.file
|
|
37
|
+
file_path = base_dir + Pathname.new(reader.cursor.file).dirname + target
|
|
38
|
+
else
|
|
39
|
+
file_path = base_dir + target
|
|
40
|
+
end
|
|
35
41
|
|
|
36
42
|
begin
|
|
37
43
|
logger = Asciidoctor::LoggerManager.logger
|
|
@@ -55,6 +61,6 @@ class FilterIncludeDirectives < Asciidoctor::Extensions::IncludeProcessor
|
|
|
55
61
|
type = attributes['_content-type'] ? attributes['_content-type'].downcase : nil unless type
|
|
56
62
|
type = attributes['_module-type'] ? attributes['_module-type'].downcase : nil unless type
|
|
57
63
|
|
|
58
|
-
['
|
|
64
|
+
['snippet'].include? type
|
|
59
65
|
end
|
|
60
66
|
end
|
data/lib/dita-topic/version.rb
CHANGED
data/lib/dita-topic.rb
CHANGED
|
@@ -524,11 +524,17 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
|
524
524
|
# Check whether the source language is defined:
|
|
525
525
|
language = (node.attributes.key? 'language') ? %( outputclass="language-#{node.attributes['language']}") : ''
|
|
526
526
|
|
|
527
|
-
#
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
527
|
+
# Check if the listing has a title specified:
|
|
528
|
+
if node.title?
|
|
529
|
+
# Compose the XML output:
|
|
530
|
+
<<~EOF.chomp
|
|
531
|
+
<p#{compose_id node.id}#{compose_metadata node.role}><b>#{node.title}</b></p>
|
|
532
|
+
<codeblock#{language}#{compose_metadata node.role}>#{node.content}</codeblock>
|
|
533
|
+
EOF
|
|
534
|
+
else
|
|
535
|
+
# Compose the XML output:
|
|
536
|
+
%(<codeblock#{language}#{compose_id node.id}#{compose_metadata node.role}>#{node.content}</codeblock>)
|
|
537
|
+
end
|
|
532
538
|
end
|
|
533
539
|
|
|
534
540
|
def convert_literal node
|
|
@@ -537,6 +543,18 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
|
537
543
|
|
|
538
544
|
# Return the XML output:
|
|
539
545
|
add_block_title result, node
|
|
546
|
+
|
|
547
|
+
# Check if the listing has a title specified:
|
|
548
|
+
if node.title?
|
|
549
|
+
# Compose the XML output:
|
|
550
|
+
<<~EOF.chomp
|
|
551
|
+
<p#{compose_id node.id}#{compose_metadata node.role}><b>#{node.title}</b></p>
|
|
552
|
+
<pre#{compose_metadata node.role}>#{node.content}</pre>
|
|
553
|
+
EOF
|
|
554
|
+
else
|
|
555
|
+
# Compose the XML output:
|
|
556
|
+
%(<pre#{compose_id node.id}#{compose_metadata node.role}>#{node.content}</pre>)
|
|
557
|
+
end
|
|
540
558
|
end
|
|
541
559
|
|
|
542
560
|
def convert_olist node
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: asciidoctor-dita-topic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jaromir Hradilek
|
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
141
|
version: '0'
|
|
142
142
|
requirements: []
|
|
143
|
-
rubygems_version: 4.0.
|
|
143
|
+
rubygems_version: 4.0.22
|
|
144
144
|
specification_version: 4
|
|
145
145
|
summary: A custom AsciiDoc converter that generates individual DITA topics
|
|
146
146
|
test_files: []
|