asciidoctor-dita-map 0.9.6 → 0.9.8

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: ecc37275d95dbc4dc7be898a49ea706ae9b44e479544e9c29d0c1108d1f8b13e
4
- data.tar.gz: a3d26bff03b1660a599f3386099fd53232da8787309f12a6590c023b58e3c028
3
+ metadata.gz: ac58b2d84b3b473e585e54b765b2a1c1591c003f61a4f188e302ba34b4917f0f
4
+ data.tar.gz: f06f028b3916d95e3be9bab9c74a7387b6a84e6c76c1b7c763d5b1ca31f46c05
5
5
  SHA512:
6
- metadata.gz: 70f3c196109ddeb6cab52f5c96fb222a8336e521e43a7b3660bd9e65a703e1b7820a1e96f0e44d6d59c85666aacafb1640c1bf2028891698ce1f47140a206d62
7
- data.tar.gz: 663059f4079fd1342808861209779e99656f011d5dbaf7764c698b7518903490193e67e6ffe56024ca240969adb39307f595c05da52a436580d6aa9aac5f25dd
6
+ metadata.gz: e6530d77eedae5de3630258c36be601395956339f8e432098b1d0124b62a717c922ad4634961e44aca284fe5df096534de4ef06c87de7146c19bb7597200db9e
7
+ data.tar.gz: ad74cbb5c2bde3ebccb5e559c025ec3000a812b24fed35aa95bb291ebf22868ec082b216b243247a200691f2da545e1374f4d695a3bf6aae4a55a211be489549
data/lib/dita-map/cli.rb CHANGED
@@ -63,6 +63,10 @@ module AsciidoctorDitaMap
63
63
 
64
64
  opt.separator ''
65
65
 
66
+ opt.on('-A', '--no-assembly', 'do not treat assemblies as maps') do
67
+ @converter.opts[:assembly] = false
68
+ end
69
+
66
70
  opt.on('-I', '--no-id', 'do not generate the map id attribute') do
67
71
  @converter.opts[:id] = false
68
72
  end
@@ -71,10 +75,6 @@ module AsciidoctorDitaMap
71
75
  @converter.opts[:title] = false
72
76
  end
73
77
 
74
- opt.on('-A', '--no-assembly', 'do treat assemblies as maps') do
75
- @converter.opts[:assembly] = false
76
- end
77
-
78
78
  opt.on('-C', '--no-chunk', 'do not generate the chunk attribute') do
79
79
  @converter.opts[:chunk] = false
80
80
  end
@@ -47,12 +47,18 @@ module AsciidoctorDitaMap
47
47
  @prep = ''
48
48
  end
49
49
 
50
- def compose_mapref_attributes element, file_info, type
50
+ def compose_mapref_attributes element, file_info
51
51
  target_file = file_info[:target].sub(/\.adoc$/, '.ditamap')
52
52
 
53
53
  element.add_attribute 'href', target_file
54
+
55
+ if file_info[:navtitle]
56
+ element.add_attribute REXML::Attribute.new('navtitle', file_info[:navtitle]) if @opts[:navtitle]
57
+ end
58
+
59
+ element.add_attribute 'locktitle', 'yes' if @opts[:locktitle] and element['navtitle']
54
60
  element.add_attribute 'format', 'ditamap'
55
- element.add_attribute 'type', type if @opts[:type]
61
+ element.add_attribute 'type', 'map' if @opts[:type]
56
62
  element.add_attribute 'chunk', file_info[:chunk] if @opts[:chunk] and file_info[:chunk]
57
63
  element.add_attribute 'toc', file_info[:toc] if @opts[:toc] and file_info[:toc]
58
64
  end
@@ -139,11 +145,15 @@ module AsciidoctorDitaMap
139
145
 
140
146
  xml_parent = stack.last[:element]
141
147
 
148
+ if xml_parent.name == 'mapref'
149
+ warn "#{NAME}: warning: invalid mapref child element: #{target}"
150
+ end
151
+
142
152
  topic.type.sub!(/^assembly$/, 'concept') if not @opts[:assembly]
143
153
 
144
154
  if topic.type == 'map' or topic.type == 'assembly'
145
155
  xml_element = xml_parent.add_element('mapref')
146
- compose_mapref_attributes xml_element, file_info, 'map'
156
+ compose_mapref_attributes xml_element, file_info
147
157
  else
148
158
  xml_element = xml_parent.add_element('topicref')
149
159
  compose_topicref_attributes xml_element, file_info, topic.title, topic.type
@@ -25,5 +25,5 @@
25
25
 
26
26
  module AsciidoctorDitaMap
27
27
  NAME = 'dita-map'
28
- VERSION = '0.9.6'
28
+ VERSION = '0.9.8'
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-dita-map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaromir Hradilek
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 4.0.6
145
+ rubygems_version: 4.0.10
146
146
  specification_version: 4
147
147
  summary: Convert an AsciiDoc file to a DITA map
148
148
  test_files: []