asciidoctor-dita-map 0.9.12 → 0.9.14

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: 5c6a12e6aed6332bab0729841ef59f95889de1a2b29835b61e4262a41160a193
4
- data.tar.gz: 595b111f04f4ce44b4d49ecd1e7f02facb44c2c9446501af403f48679335bf94
3
+ metadata.gz: e88ed0e53a52ea190b7e6c9a019f6beec53e56b4c2cbe697e8ccbdb30ec8a054
4
+ data.tar.gz: 6472d8d180c56526fbc53baef936e0f67c38b918a1bf01b7eec6eb272a0eba9a
5
5
  SHA512:
6
- metadata.gz: 6c27e7c8d5350b9231cbfbe0ee68a133de45f5287b6a5a61772ff8ecbcd5c05a3cbc2d1d6851913900be0c2b04cb9b029d7b2a2671c0ee5e89dc0de24aa317c4
7
- data.tar.gz: 38450ab30ec18a34a0019134b2e1585fc8d28390596ef9d922caadc7f2cb1c14a1ba5f3a9699a9cf62b186eaec64a7f82de30c6216d2990e9cef42c073cf8bf5
6
+ metadata.gz: 55e181b3063be81b310dfa4d3cf80eb65ee4ca257c660244f184fed9db58c69cc37b45b4fef38e3b18db29afbbd6d17687a1654397ab66962c38d717954665be
7
+ data.tar.gz: 2e8578bc05678448fa76ca9feaaa514d0c7bf54bcaa69659c61c31c799b1385e62e707c5a821bd03f1d49d884e586ba2a461510775eb7aef34cbecb2eaf9bc87
data/bin/dita-type CHANGED
@@ -73,11 +73,6 @@ class Cli
73
73
  topic = AsciidoctorDitaMap::Topic.new File.read(@file)
74
74
  end
75
75
 
76
- if not topic.type
77
- puts 'undef'
78
- abort
79
- end
80
-
81
76
  puts topic.type
82
77
  end
83
78
  end
@@ -102,13 +102,16 @@ module AsciidoctorDitaMap
102
102
  end
103
103
 
104
104
  if @opts[:self] and file
105
- file_info = map.chunk ? { :target => file, :chunk => 'to-content' } : { :target => file }
106
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
+
107
110
  compose_topicref_attributes(xml_self, file_info, map.title, map.type)
108
111
 
109
- stack = [{ :offset => 0, :element => xml_self }]
112
+ stack = [{ :offset => 0, :element => xml_self }]
110
113
  else
111
- stack = [{ :offset => 0, :element => xml_root }]
114
+ stack = [{ :offset => 0, :element => xml_root }]
112
115
  end
113
116
 
114
117
  map.includes.each do |file_info|
data/lib/dita-map/map.rb CHANGED
@@ -27,12 +27,13 @@ require_relative 'topic'
27
27
 
28
28
  module AsciidoctorDitaMap
29
29
  class Map < Topic
30
- attr_accessor :chunk, :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 = []
38
39
  @chunk = false
@@ -46,6 +47,7 @@ module AsciidoctorDitaMap
46
47
  @includes = doc.catalog[:include_files] ? doc.catalog[:include_files] : []
47
48
  @id = doc.id ? doc.id.gsub(/["']/, '') : nil
48
49
  @title = doc.title ? doc.title.gsub(/<[^>]*>/, '') : nil
50
+ @navtitle = (doc.attributes.key? 'navtitle') ? doc.attributes['navtitle'] : nil
49
51
  @type = get_content_type doc.attributes
50
52
  @chunk = doc.attributes.key? 'chunk-to-content'
51
53
  end
@@ -30,7 +30,7 @@ module AsciidoctorDitaMap
30
30
  def initialize input, attributes = []
31
31
  if input.empty?
32
32
  @title = nil
33
- @type = nil
33
+ @type = 'undef'
34
34
  else
35
35
  doc = Asciidoctor.load input, safe: :secure, logger: false, attributes: attributes
36
36
 
@@ -46,12 +46,14 @@ module AsciidoctorDitaMap
46
46
  type = attributes['_content-type'] ? attributes['_content-type'].downcase : nil unless type
47
47
  type = attributes['_module-type'] ? attributes['_module-type'].downcase : nil unless type
48
48
 
49
- if type
50
- type.sub!(/^procedure$/, 'task')
49
+ if not type
50
+ return 'undef'
51
51
  end
52
52
 
53
+ type.sub!(/^procedure$/, 'task')
54
+
53
55
  unless ['assembly', 'concept', 'reference', 'task', 'map', 'attributes', 'snippet', 'ignore'].include? type
54
- return nil
56
+ return 'invalid'
55
57
  end
56
58
 
57
59
  return type
@@ -25,5 +25,5 @@
25
25
 
26
26
  module AsciidoctorDitaMap
27
27
  NAME = 'dita-map'
28
- VERSION = '0.9.12'
28
+ VERSION = '0.9.14'
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.12
4
+ version: 0.9.14
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.18
147
+ rubygems_version: 4.0.19
148
148
  specification_version: 4
149
149
  summary: Convert an AsciiDoc file to a DITA map
150
150
  test_files: []