asciidoctor-dita-topic 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b150bed25c8b6413a69a4caa81af642427d3c799fc70ec32ca090b4df36622ab
4
- data.tar.gz: b49b48b67ebc6a056121ed223c3af0af321c3284372fb1238c3b19f8752c8e2b
3
+ metadata.gz: 9ac51fea23e9f82cc4dddc459c42eb9877f054b22d474d9d020cb0b7876cbfad
4
+ data.tar.gz: 50287798b45a0571cd0538639a0da114e101bfa2297c4a17e24451ceff634fa2
5
5
  SHA512:
6
- metadata.gz: 9c30598e80430b66ee90928f3b6222486bc3f187a024b685ee09da7063e4b2d42666c014a70ca5c9892eca85487fa45831e630bc11ba8e22775c372cafaff9fb
7
- data.tar.gz: a278c11c09eb8290c2fa1347a81cab381059a0083efc2f53477135e1ca222aa0482fdee5b62a12897cf981914ce52453227162c2f24025e7da0f5af06a0a367f
6
+ metadata.gz: 31c8095b9943ad5dde42deb002fff7d0be3975a5bd40a3657612309d38ae6ec39851c170edffd74e38da01d2eef11c8434637c48193cb96cb71e2a79e991f2bd
7
+ data.tar.gz: 8ad53b93870a78a6ec2b0896ce5c620b07a696eee55cc9bd366be8d2ce98962285f6d118533b8684c8254299ce9df3a2f3258657c6dabe5b58ab08f42e7d570a
data/README.adoc CHANGED
@@ -312,19 +312,23 @@ DITA provides four metadata attributes that can be used for conditional processi
312
312
  | DITA Attribute
313
313
  | Description
314
314
 
315
- | `platform:__value__`
315
+ | `platform:__value__` +
316
+ `pl:__value__`
316
317
  | `platform="_value_"`
317
318
  | Operating system or hardware architecture.
318
319
 
319
- | `product:__value__`
320
+ | `product:__value__` +
321
+ `pr:__value__`
320
322
  | `product="_value_"`
321
323
  | Product name.
322
324
 
323
- | `audience:__value__`
325
+ | `audience:__value__` +
326
+ `au:__value__`
324
327
  | `audience="_value_"`
325
328
  | Target audience.
326
329
 
327
- | `otherprops:__value__`
330
+ | `otherprops:__value__` +
331
+ `op:__value__`
328
332
  | `otherprops="_value_"`
329
333
  | Additional properties.
330
334
  |===
@@ -333,7 +337,7 @@ For example, to indicate that a particular paragraph is relevant for Linux and m
333
337
 
334
338
  [source,asciidoc]
335
339
  ----
336
- [role="platform:linux platform:mac audience:beginner"]
340
+ [role="pl:linux pl:mac au:beginner"]
337
341
  For more information, see the *bash*(1) manual page.
338
342
  ----
339
343
 
@@ -24,5 +24,5 @@
24
24
  # frozen_string_literal: true
25
25
 
26
26
  module AsciidoctorDitaTopic
27
- VERSION = '1.5.0'
27
+ VERSION = '1.5.1'
28
28
  end
data/lib/dita-topic.rb CHANGED
@@ -1050,7 +1050,12 @@ class DitaTopic < Asciidoctor::Converter::Base
1050
1050
  result = {}
1051
1051
 
1052
1052
  # Define supported metadata attributes:
1053
- valid = ['platform', 'product', 'audience', 'otherprops']
1053
+ valid = {
1054
+ 'pl' => 'platform',
1055
+ 'pr' => 'product',
1056
+ 'au' => 'audience',
1057
+ 'op' => 'otherprops'
1058
+ }
1054
1059
 
1055
1060
  # Process each role:
1056
1061
  roles.split.each do |role|
@@ -1060,8 +1065,11 @@ class DitaTopic < Asciidoctor::Converter::Base
1060
1065
  # Separate the attribute name from its value:
1061
1066
  attribute, value = role.split ':'
1062
1067
 
1068
+ # Expand the short attribute variant:
1069
+ attribute = valid[attribute] if valid.key? attribute
1070
+
1063
1071
  # Ignore unsupported attribute names:
1064
- next unless valid.include? attribute
1072
+ next unless valid.value? attribute
1065
1073
 
1066
1074
  # Append the value to the attribute:
1067
1075
  if result.key? attribute
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.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaromir Hradilek