asciidoctor-dita-map 0.9.11 → 0.9.13

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: 6057b52f639b72c6cd979278396d3694aabcd1d77263c6bc5992c4629c4e7cdd
4
- data.tar.gz: b4cf056a674cc2dd1ecbee69a663ca5f09e284d19a12be14ad8ccf8159d53d42
3
+ metadata.gz: 98bea8d9cbc76880ed050644d87dba51910d7e7ac722fdf04449d4b53743e7fd
4
+ data.tar.gz: e96e393535d5212e2f786b77baa6a182eb81874bc64e11d3e9c8d63ac823fdfe
5
5
  SHA512:
6
- metadata.gz: 3da991606dec33d2cd30ce6135a52630e6873d04aac93590b450ac167699c1a3448e7bef509666280400f7f2286c0167abb6aed0c44298fa63bb3762fdd6c913
7
- data.tar.gz: 26f707cbd3095e2170055a757fc37b03933e768604121ea87d64ff079346897b49278b713e87e3b5e8e32d51cc51ce187b2cbb62a5027e0ed1014b66a2a91df4
6
+ metadata.gz: 217aa01cb9a704bc51e7bef39f6e36b263d9f0a7e7d7678f084feabebb2e2c8db84af43b1e0d97009fe4c9944da9d939fc9b35f6aa49a4a3c777b0bbb6f63cb7
7
+ data.tar.gz: 9646161ae41f05054b8ff31474128464299d5c948150927a5b550223593302bf8163571dc8323c46e51424de37c61fa5010be54f3ef97437a94b2e51038523b2
@@ -97,16 +97,21 @@ module AsciidoctorDitaMap
97
97
  end
98
98
 
99
99
  if map.title and @opts[:title]
100
- xml_title = xml_root.add_element('title')
100
+ xml_title = xml_root.add_element('title')
101
101
  xml_title.add REXML::Text.new(map.title, false, nil, true)
102
102
  end
103
103
 
104
104
  if @opts[:self] and file
105
- xml_self = xml_root.add_element('topicref')
106
- compose_topicref_attributes(xml_self, { :target => file }, map.title, map.type)
107
- stack = [{ :offset => 0, :element => xml_self }]
105
+ xml_self = xml_root.add_element('topicref')
106
+ file_info = { :target => file }
107
+ file_info[:chunk] = 'to-content' if map.chunk
108
+ file_info[:navtitle] = map.navtitle
109
+
110
+ compose_topicref_attributes(xml_self, file_info, map.title, map.type)
111
+
112
+ stack = [{ :offset => 0, :element => xml_self }]
108
113
  else
109
- stack = [{ :offset => 0, :element => xml_root }]
114
+ stack = [{ :offset => 0, :element => xml_root }]
110
115
  end
111
116
 
112
117
  map.includes.each do |file_info|
data/lib/dita-map/map.rb CHANGED
@@ -27,14 +27,16 @@ require_relative 'topic'
27
27
 
28
28
  module AsciidoctorDitaMap
29
29
  class Map < Topic
30
- attr_accessor :id, :includes
30
+ attr_accessor :chunk, :id, :includes, :navtitle
31
31
 
32
32
  def initialize input, base_dir, attributes = []
33
33
  if input.empty?
34
34
  @id = nil
35
35
  @title = nil
36
+ @navtitle = nil
36
37
  @type = nil
37
38
  @includes = []
39
+ @chunk = false
38
40
  else
39
41
  Asciidoctor::Extensions.register do
40
42
  include_processor CatalogIncludeDirectives
@@ -45,7 +47,9 @@ module AsciidoctorDitaMap
45
47
  @includes = doc.catalog[:include_files] ? doc.catalog[:include_files] : []
46
48
  @id = doc.id ? doc.id.gsub(/["']/, '') : nil
47
49
  @title = doc.title ? doc.title.gsub(/<[^>]*>/, '') : nil
50
+ @navtitle = (doc.attributes.key? 'navtitle') ? doc.attributes['navtitle'] : nil
48
51
  @type = get_content_type doc.attributes
52
+ @chunk = doc.attributes.key? 'chunk-to-content'
49
53
  end
50
54
  end
51
55
  end
@@ -25,5 +25,5 @@
25
25
 
26
26
  module AsciidoctorDitaMap
27
27
  NAME = 'dita-map'
28
- VERSION = '0.9.11'
28
+ VERSION = '0.9.13'
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.11
4
+ version: 0.9.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaromir Hradilek
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 4.0.15
147
+ rubygems_version: 4.0.18
148
148
  specification_version: 4
149
149
  summary: Convert an AsciiDoc file to a DITA map
150
150
  test_files: []