Class: PPTXMarkdown::Parsers::Markdown

Inherits:
Struct
  • Object
show all
Defined in:
lib/pptx_markdown/parsers/markdown.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



3
4
5
# File 'lib/pptx_markdown/parsers/markdown.rb', line 3

def path
  @path
end

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pptx_markdown/parsers/markdown.rb', line 4

def call
  presentation = PPTXMarkdown::Presentation.new

  content.each_line do |line|
    if !line.start_with?("\t")
      presentation.slides.push(
        PPTXMarkdown::Slide.new([
          PPTXMarkdown::Shape.new(parse_content(line), 'title')
        ])
      )

      next
    end

    presentation.slides.last.shapes.push(
      PPTXMarkdown::Shape.new(parse_content(line), 'body')
    )
  end

  presentation
end