asciidoctor-dita-map 0.9.14 → 0.9.15

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: e88ed0e53a52ea190b7e6c9a019f6beec53e56b4c2cbe697e8ccbdb30ec8a054
4
- data.tar.gz: 6472d8d180c56526fbc53baef936e0f67c38b918a1bf01b7eec6eb272a0eba9a
3
+ metadata.gz: e10278e445c7ebb802fd7b59b0f2d59833ef3cf15daac9f5401a21ffa5004cf5
4
+ data.tar.gz: db2bfadc8deb15cddac4f2edc10c2e84edaae52532eb85539046376f310f6736
5
5
  SHA512:
6
- metadata.gz: 55e181b3063be81b310dfa4d3cf80eb65ee4ca257c660244f184fed9db58c69cc37b45b4fef38e3b18db29afbbd6d17687a1654397ab66962c38d717954665be
7
- data.tar.gz: 2e8578bc05678448fa76ca9feaaa514d0c7bf54bcaa69659c61c31c799b1385e62e707c5a821bd03f1d49d884e586ba2a461510775eb7aef34cbecb2eaf9bc87
6
+ metadata.gz: 8e6b6ab31781f9cba233fbc62194a738e3db56746c8dcb134d4ce4288119ead15cf13af4f985812688caa7195dcbd76204290e0c03a39b880c0ccb4f22626267
7
+ data.tar.gz: 7274e2d7e1f79bbefae1500e1530ad7ed167e6a814d58ed6aa977914ebb12ebd455668bd72cabb7fb07bb807dfc778ad474ebb5e457e6b15d644cd1b15625bae
data/lib/dita-map/cli.rb CHANGED
@@ -72,22 +72,26 @@ module AsciidoctorDitaMap
72
72
  @converter.opts[:assembly] = false
73
73
  end
74
74
 
75
- opt.on('-I', '--no-id', 'do not generate the map id attribute') do
76
- @converter.opts[:id] = false
75
+ opt.on('-C', '--no-chunk', 'do not generate the chunk attribute') do
76
+ @converter.opts[:chunk] = false
77
77
  end
78
78
 
79
- opt.on('-M', '--no-maptitle', 'do not generate the map title') do
80
- @converter.opts[:title] = false
79
+ opt.on('-H', '--no-topichead', 'do not generate the topichead element') do
80
+ @converter.opts[:topichead] = false
81
81
  end
82
82
 
83
- opt.on('-C', '--no-chunk', 'do not generate the chunk attribute') do
84
- @converter.opts[:chunk] = false
83
+ opt.on('-I', '--no-id', 'do not generate the map id attribute') do
84
+ @converter.opts[:id] = false
85
85
  end
86
86
 
87
87
  opt.on('-L', '--no-locktitle', 'do not generate the locktitle attribute') do
88
88
  @converter.opts[:locktitle] = false
89
89
  end
90
90
 
91
+ opt.on('-M', '--no-maptitle', 'do not generate the map title') do
92
+ @converter.opts[:title] = false
93
+ end
94
+
91
95
  opt.on('-N', '--no-navtitle', 'do not generate the navtitle attribute') do
92
96
  @converter.opts[:navtitle] = false
93
97
  end
@@ -39,6 +39,7 @@ module AsciidoctorDitaMap
39
39
  :navtitle => true,
40
40
  :title => true,
41
41
  :toc => true,
42
+ :topichead => true,
42
43
  :type => true,
43
44
  :self => false,
44
45
  :verbose => false,
@@ -101,6 +102,10 @@ module AsciidoctorDitaMap
101
102
  xml_title.add REXML::Text.new(map.title, false, nil, true)
102
103
  end
103
104
 
105
+ if map.topichead and @opts[:topichead]
106
+ xml_root = xml_root.add_element('topichead', { 'navtitle' => map.topichead })
107
+ end
108
+
104
109
  if @opts[:self] and file
105
110
  xml_self = xml_root.add_element('topicref')
106
111
  file_info = { :target => file }
data/lib/dita-map/map.rb CHANGED
@@ -27,16 +27,17 @@ require_relative 'topic'
27
27
 
28
28
  module AsciidoctorDitaMap
29
29
  class Map < Topic
30
- attr_accessor :chunk, :id, :includes, :navtitle
30
+ attr_accessor :chunk, :id, :includes, :navtitle, :topichead
31
31
 
32
32
  def initialize input, base_dir, attributes = []
33
33
  if input.empty?
34
- @id = nil
35
- @title = nil
36
- @navtitle = nil
37
- @type = nil
38
- @includes = []
39
- @chunk = false
34
+ @id = nil
35
+ @title = nil
36
+ @navtitle = nil
37
+ @type = nil
38
+ @topichead = nil
39
+ @includes = []
40
+ @chunk = false
40
41
  else
41
42
  Asciidoctor::Extensions.register do
42
43
  include_processor CatalogIncludeDirectives
@@ -44,12 +45,13 @@ module AsciidoctorDitaMap
44
45
 
45
46
  doc = Asciidoctor.load input, safe: :safe, logger: false, catalog_assets: true, attributes: attributes, base_dir: base_dir
46
47
 
47
- @includes = doc.catalog[:include_files] ? doc.catalog[:include_files] : []
48
- @id = doc.id ? doc.id.gsub(/["']/, '') : nil
49
- @title = doc.title ? doc.title.gsub(/<[^>]*>/, '') : nil
50
- @navtitle = (doc.attributes.key? 'navtitle') ? doc.attributes['navtitle'] : nil
51
- @type = get_content_type doc.attributes
52
- @chunk = doc.attributes.key? 'chunk-to-content'
48
+ @includes = doc.catalog[:include_files] ? doc.catalog[:include_files] : []
49
+ @id = doc.id ? doc.id.gsub(/["']/, '') : nil
50
+ @title = doc.title ? doc.title.gsub(/<[^>]*>/, '') : nil
51
+ @navtitle = (doc.attributes.key? 'navtitle') ? doc.attributes['navtitle'] : nil
52
+ @type = get_content_type doc.attributes
53
+ @topichead = (doc.attributes.key? 'topichead') ? doc.attributes['topichead'] : nil
54
+ @chunk = doc.attributes.key? 'chunk-to-content'
53
55
  end
54
56
  end
55
57
  end
@@ -25,5 +25,5 @@
25
25
 
26
26
  module AsciidoctorDitaMap
27
27
  NAME = 'dita-map'
28
- VERSION = '0.9.14'
28
+ VERSION = '0.9.15'
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.14
4
+ version: 0.9.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaromir Hradilek