Class: PPTXMarkdown::Slide
- Inherits:
-
Struct
- Object
- Struct
- PPTXMarkdown::Slide
- Defined in:
- lib/pptx_markdown/slide.rb
Instance Attribute Summary collapse
-
#shapes ⇒ Object
Returns the value of attribute shapes.
Instance Method Summary collapse
- #to_markdown ⇒ Object
-
#to_xml(index) ⇒ String
XML ppt/slides/slide0.xml with nested shapes.
Instance Attribute Details
#shapes ⇒ Object
Returns the value of attribute shapes
2 3 4 |
# File 'lib/pptx_markdown/slide.rb', line 2 def shapes @shapes end |
Instance Method Details
#to_markdown ⇒ Object
3 4 5 |
# File 'lib/pptx_markdown/slide.rb', line 3 def to_markdown shapes.map(&:to_markdown).join end |
#to_xml(index) ⇒ String
Returns XML ppt/slides/slide0.xml with nested shapes.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pptx_markdown/slide.rb', line 8 def to_xml(index) node_collection = PPTXMarkdown::ShapeMapper.new Nokogiri::XML::Builder.new do |xml| xml['p'].sld(XML_NAMESPACES) do xml.cSld do xml.spTree do xml.nvGrpSpPr do xml.cNvPr(id: 255 + index + 1, name: nil) xml.cNvGrpSpPr xml.nvPr end xml.grpSpPr do xml['a'].xfrm do xml.off(x: 0, y: 0) xml.ext(cx: 0, cy: 0) xml.chOff(x: 0, y: 0) xml.chExt(cx: 0, cy: 0) end end shapes.each do |shape| xml << shape.to_xml(node_collection.next) end end end xml.clrMapOvr do xml['a'].masterClrMapping end end end.to_xml end |