Class: AsciidoctorDitaMap::Map
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#includes ⇒ Object
Returns the value of attribute includes.
Attributes inherited from Topic
Instance Method Summary collapse
-
#initialize(input, base_dir, attributes = []) ⇒ Map
constructor
A new instance of Map.
Constructor Details
#initialize(input, base_dir, attributes = []) ⇒ Map
Returns a new instance of Map.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/dita-map/map.rb', line 32 def initialize input, base_dir, attributes = [] if input.empty? @id = nil @title = nil @type = nil @includes = [] else Asciidoctor::Extensions.register do include_processor CatalogIncludeDirectives end doc = Asciidoctor.load input, safe: :safe, catalog_assets: true, attributes: attributes, base_dir: base_dir @includes = doc.catalog[:include_files] ? doc.catalog[:include_files] : [] @id = doc.id ? doc.id.gsub(/["']/, '') : nil @title = doc.title ? doc.title.gsub(/<[^>]*>/, '') : nil @type = get_content_type doc.attributes end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
30 31 32 |
# File 'lib/dita-map/map.rb', line 30 def id @id end |
#includes ⇒ Object
Returns the value of attribute includes.
30 31 32 |
# File 'lib/dita-map/map.rb', line 30 def includes @includes end |