asciidoctor-dita-topic 1.4.8 → 1.4.9
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 +18 -4
- data/lib/dita-topic/cli.rb +4 -0
- data/lib/dita-topic/version.rb +2 -2
- data/lib/dita-topic.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54897b731c29e283e7a3f6813b8399e583435343d5c480cb2f802e392ad07dfc
|
|
4
|
+
data.tar.gz: bb7ebe60820497be880333fa56b0e56b85c0713073314bef65f1fd33237fb0ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87eb3816ce0a31a524c758abefdc15bec4c364654928d974b79baf8cbb88d9ef4bfe2975fb77fec8e7f9564045269ba8d8482796c7507af2d9958544608e8256
|
|
7
|
+
data.tar.gz: fbe4b750cba7a0745c45165b337b1ad466874371c3a13d211348e58b12430a035f88f188120c025bf5d4f4f1f10dc06fd037303c6728a44d20b70ef8a0891949
|
data/README.adoc
CHANGED
|
@@ -133,7 +133,7 @@ To enable processing of author lines as metadata, run the `dita-topic` command w
|
|
|
133
133
|
$ **dita-topic -l _your_file_.adoc**
|
|
134
134
|
....
|
|
135
135
|
|
|
136
|
-
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-authors` to `on`:
|
|
136
|
+
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-authors` attribute to `on`:
|
|
137
137
|
|
|
138
138
|
[literal,subs="+quotes"]
|
|
139
139
|
....
|
|
@@ -157,7 +157,7 @@ To disable this behavior, run the `dita-topic` command with the `-T` option:
|
|
|
157
157
|
$ **dita-topic -T _your_file_.adoc**
|
|
158
158
|
....
|
|
159
159
|
|
|
160
|
-
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-titles` to `off`:
|
|
160
|
+
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-titles` attribute to `off`:
|
|
161
161
|
|
|
162
162
|
[literal,subs="+quotes"]
|
|
163
163
|
....
|
|
@@ -176,7 +176,7 @@ To disable this behavior, run the `dita-topic` command with the `-C` option:
|
|
|
176
176
|
$ **dita-topic -C _your_file_.adoc**
|
|
177
177
|
....
|
|
178
178
|
|
|
179
|
-
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-callouts` to `off`:
|
|
179
|
+
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-callouts` attribute to `off`:
|
|
180
180
|
|
|
181
181
|
[literal,subs="+quotes"]
|
|
182
182
|
....
|
|
@@ -261,6 +261,20 @@ Read the [filename]`/etc/passwd` file to see the complete list of
|
|
|
261
261
|
available user accounts.
|
|
262
262
|
----
|
|
263
263
|
|
|
264
|
+
To disable this behavior, for example when the source files do not annotate semantic markup consistently, run the `dita-topic` command with the `-M` option:
|
|
265
|
+
|
|
266
|
+
[literal,subs="+quotes"]
|
|
267
|
+
....
|
|
268
|
+
$ **dita-topic -M _your_file_.adoc**
|
|
269
|
+
....
|
|
270
|
+
|
|
271
|
+
If you prefer to use Asciidoctor directly, set the value of the `dita-topic-semantic` attribute to `off`:
|
|
272
|
+
|
|
273
|
+
[literal,subs="+quotes"]
|
|
274
|
+
....
|
|
275
|
+
$ **asciidoctor -r dita-topic -b dita-topic -a dita-topic-semantic=off _your_file_.adoc**
|
|
276
|
+
....
|
|
277
|
+
|
|
264
278
|
[#metadata]
|
|
265
279
|
=== Adding metadata
|
|
266
280
|
|
|
@@ -341,6 +355,6 @@ Thematic breaks not supported in DITA:: Asciidoc allows you to use `'''`, `---`,
|
|
|
341
355
|
[#copyright]
|
|
342
356
|
== Copyright
|
|
343
357
|
|
|
344
|
-
Copyright (C) 2024
|
|
358
|
+
Copyright (C) 2024–2026 Jaromir Hradilek
|
|
345
359
|
|
|
346
360
|
This program is free software, released under the terms of the link:LICENSE[MIT license]. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
data/lib/dita-topic/cli.rb
CHANGED
|
@@ -85,6 +85,10 @@ module AsciidoctorDitaTopic
|
|
|
85
85
|
@attr.append 'dita-topic-callouts=off'
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
+
opt.on('-M', '--no-semantic-markup', 'disable processing of semantic markup') do
|
|
89
|
+
@attr.append 'dita-topic-semantic=off'
|
|
90
|
+
end
|
|
91
|
+
|
|
88
92
|
opt.on('-S', '--no-sidebars', 'disable processing of sidebars') do
|
|
89
93
|
@attr.append 'dita-topic-sidebars=off'
|
|
90
94
|
end
|
data/lib/dita-topic/version.rb
CHANGED
data/lib/dita-topic.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# A custom AsciiDoc converter that generates individual DITA topics
|
|
2
|
-
# Copyright (C) 2024
|
|
2
|
+
# Copyright (C) 2024-2026 Jaromir Hradilek
|
|
3
3
|
|
|
4
4
|
# MIT License
|
|
5
5
|
#
|
|
@@ -38,6 +38,9 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
|
38
38
|
# Disable the author line by default:
|
|
39
39
|
@authors_allowed = false
|
|
40
40
|
|
|
41
|
+
# Enable processing of semantic markup by default:
|
|
42
|
+
@semantic_allowed = true
|
|
43
|
+
|
|
41
44
|
# Enable callouts by default:
|
|
42
45
|
@callouts_allowed = true
|
|
43
46
|
|
|
@@ -55,6 +58,9 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
|
55
58
|
# Check if the author line is enabled:
|
|
56
59
|
@authors_allowed = true if (node.attr 'dita-topic-authors') == 'on'
|
|
57
60
|
|
|
61
|
+
# Check if semantic markup is enabled:
|
|
62
|
+
@semantic_allowed = false if (node.attr 'dita-topic-semantic') == 'off'
|
|
63
|
+
|
|
58
64
|
# Check if callouts are enabled:
|
|
59
65
|
@callouts_allowed = false if (node.attr 'dita-topic-callouts') == 'off'
|
|
60
66
|
|
|
@@ -463,8 +469,8 @@ class DitaTopic < Asciidoctor::Converter::Base
|
|
|
463
469
|
# Set the default element value:
|
|
464
470
|
element = 'codeph'
|
|
465
471
|
|
|
466
|
-
# Check if the role is provided:
|
|
467
|
-
if node.role
|
|
472
|
+
# Check if semantic markup is enabled and the role is provided:
|
|
473
|
+
if @semantic_allowed and node.role
|
|
468
474
|
# Define supported roles:
|
|
469
475
|
semantic_markup = {
|
|
470
476
|
'command' => 'cmdname',
|