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 +4 -4
- data/bin/dita-type +0 -5
- data/lib/dita-map/convert.rb +6 -3
- data/lib/dita-map/map.rb +3 -1
- data/lib/dita-map/topic.rb +6 -4
- data/lib/dita-map/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e88ed0e53a52ea190b7e6c9a019f6beec53e56b4c2cbe697e8ccbdb30ec8a054
|
|
4
|
+
data.tar.gz: 6472d8d180c56526fbc53baef936e0f67c38b918a1bf01b7eec6eb272a0eba9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55e181b3063be81b310dfa4d3cf80eb65ee4ca257c660244f184fed9db58c69cc37b45b4fef38e3b18db29afbbd6d17687a1654397ab66962c38d717954665be
|
|
7
|
+
data.tar.gz: 2e8578bc05678448fa76ca9feaaa514d0c7bf54bcaa69659c61c31c799b1385e62e707c5a821bd03f1d49d884e586ba2a461510775eb7aef34cbecb2eaf9bc87
|
data/bin/dita-type
CHANGED
data/lib/dita-map/convert.rb
CHANGED
|
@@ -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
|
|
112
|
+
stack = [{ :offset => 0, :element => xml_self }]
|
|
110
113
|
else
|
|
111
|
-
stack
|
|
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
|
data/lib/dita-map/topic.rb
CHANGED
|
@@ -30,7 +30,7 @@ module AsciidoctorDitaMap
|
|
|
30
30
|
def initialize input, attributes = []
|
|
31
31
|
if input.empty?
|
|
32
32
|
@title = nil
|
|
33
|
-
@type =
|
|
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
|
-
|
|
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
|
|
56
|
+
return 'invalid'
|
|
55
57
|
end
|
|
56
58
|
|
|
57
59
|
return type
|
data/lib/dita-map/version.rb
CHANGED
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.
|
|
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.
|
|
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: []
|