asciidoctor-dita-topic 1.1.5 → 1.1.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/README.adoc +26 -1
- data/lib/dita-topic.rb +24 -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: 4800181685253324c6e93aa8be4011212e700a94ef82e6489b2980f3b6361cf2
|
4
|
+
data.tar.gz: e3f39557c7dc47af05889e99546369448c3ef4b4af53a233c0beb3d8b5d48705
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 691af18c68f264cc32b5a1a01ad3f220a0bbda0258333be153d36f2de15559da8b1bb7184a9046ef1b53c37a366f3e25fa5aecbfcba4882445c9b4238be0238b
|
7
|
+
data.tar.gz: f366e45753bba7d68146839ba1e55b6d480588aab356fff072cba5093b52554b4f56667e347f3497fa12683927c4c2ea6995f94695f30b9ccf46d73a5a4567ed
|
data/README.adoc
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
= dita-topic
|
2
2
|
|
3
|
-
`dita-topic` is a custom converter for Asciidoctor that converts a single AsciiDoc file to a corresponding DITA
|
3
|
+
`dita-topic` is a custom converter for Asciidoctor that converts a single AsciiDoc file to a corresponding DITA 1.3 topic.
|
4
|
+
|
5
|
+
In combination with link:https://github.com/jhradilek/asciidoctor-dita-vale[asciidoctor-dita-vale] and link:https://github.com/jhradilek/dita-custom-xslt#installation[dita-convert], this project can be used to rapidly convert AsciiDoc content to DITA:
|
6
|
+
|
7
|
+
. Identify incompatible markup in the AsciiDoc source file:
|
8
|
+
+
|
9
|
+
[literal,subs="+quotes"]
|
10
|
+
....
|
11
|
+
$ *vale source_file.adoc*
|
12
|
+
....
|
13
|
+
|
14
|
+
. Convert the AsciiDoc file to a generic DITA topic:
|
15
|
+
+
|
16
|
+
[literal,subs="+quotes"]
|
17
|
+
....
|
18
|
+
$ *asciidoctor -r dita-topic -b dita-topic source_file.adoc*
|
19
|
+
....
|
20
|
+
|
21
|
+
. Convert the generic DITA topic to a specialized DITA concept, reference, or task:
|
22
|
+
+
|
23
|
+
[literal,subs="+quotes"]
|
24
|
+
....
|
25
|
+
$ *dita-convert -gt task source_file.dita*
|
26
|
+
....
|
4
27
|
|
5
28
|
[#install]
|
6
29
|
== Installation
|
@@ -178,6 +201,8 @@ Page breaks not supported in DITA:: AsciiDoc allows you to use `<<<` on a separa
|
|
178
201
|
|
179
202
|
Possible invalid reference: _reference_:: AsciiDoc allows you to cross reference by using an ID no matter if this ID is defined within or outside of the converted document. Unlike AsciiDoc, DITA requires both the target ID and the ID of the target topic to be included in the cross reference if the reference leads outside of the current file. As `dita-topic` is meant to be run on individual AsciiDoc files, it does not have access to information from referenced files during conversion. `dita-topic` issues this warning whenever the cross reference target is not present in the converted AsciiDoc file.
|
180
203
|
|
204
|
+
Sidebars not supported in DITA:: AsciiDoc allows you to assign any block the `[sidebar]` block style or enclose it between a pair of `\****` to create a delimited sidebar block. Unlike AsciiDoc, DITA does not support sidebar blocks. `dita-topic` issues this warning when the `-a dita-topic-sidebars=off` option is specified and a sidebar block is present in the converted AsciiDoc file.
|
205
|
+
|
181
206
|
STEM support not implemented:: AsciiDoc provides multiple ways to insert Science, Technology, Engineering and Math (STEM) expressions in the document, including the `\stem:[_formula_]` inline macro and the `[stem]` delimited block. `dita-topic` does not implement this feature and issues this warning whenever such an expression is present in the converted AsciiDoc file.
|
182
207
|
|
183
208
|
Table footers not supported in DITA:: AsciiDoc allows you to set the `footer` option to mark the last table row as a table footer. Unlike AsciiDoc, DITA does not support table footers. `dita-topic` issues this warning whenever a table footer is present in the converted AsciiDoc file.
|
data/lib/dita-topic.rb
CHANGED
@@ -46,6 +46,9 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
46
46
|
|
47
47
|
# Enable floating and block titles by default:
|
48
48
|
@titles_allowed = true
|
49
|
+
|
50
|
+
# Enable sidebars by default:
|
51
|
+
@sidebars_allowed = true
|
49
52
|
end
|
50
53
|
|
51
54
|
def convert_document node
|
@@ -61,6 +64,9 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
61
64
|
# Check if floating and block titles are enabled:
|
62
65
|
@titles_allowed = false if (node.attr 'dita-topic-titles') == 'off'
|
63
66
|
|
67
|
+
# Check if sidebars are enabled:
|
68
|
+
@sidebars_allowed = false if (node.attr 'dita-topic-sidebars') == 'off'
|
69
|
+
|
64
70
|
# Check if the modular documentation content type is specified; both
|
65
71
|
# _module-type and _content-type are deprecated, but still present in
|
66
72
|
# some modules:
|
@@ -447,6 +453,18 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
447
453
|
%(“#{node.text}”)
|
448
454
|
when :single
|
449
455
|
%(‘#{node.text}’)
|
456
|
+
when :asciimath
|
457
|
+
# Issue a warning if a STEM content is present:
|
458
|
+
logger.warn "#{NAME}: STEM support not implemented"
|
459
|
+
|
460
|
+
# Add comments around the STEM content:
|
461
|
+
%(<!-- asciimath start -->#{node.text}<!-- asciimath end -->)
|
462
|
+
when :latexmath
|
463
|
+
# Issue a warning if a STEM content is present:
|
464
|
+
logger.warn "#{NAME}: STEM support not implemented"
|
465
|
+
|
466
|
+
# Add comments around the STEM content:
|
467
|
+
%(<!-- latexmath start -->#{node.text}<!-- latexmath end -->)
|
450
468
|
else
|
451
469
|
node.text
|
452
470
|
end
|
@@ -594,6 +612,12 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
594
612
|
# NOTE: Unlike AsciiDoc, DITA does not provide markup for a sidebar. As
|
595
613
|
# a workaround, I decided to use a div with the outputclass attribute.
|
596
614
|
|
615
|
+
# Issue a warning if sidebars are disabled:
|
616
|
+
unless @sidebars_allowed
|
617
|
+
logger.warn "#{NAME}: Sidebars not supported in DITA"
|
618
|
+
return ''
|
619
|
+
end
|
620
|
+
|
597
621
|
# Check if the content contains multiple block elements:
|
598
622
|
if node.content_model == :compound
|
599
623
|
<<~EOF.chomp
|
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.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaromir Hradilek
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-12 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: asciidoctor
|