Add builder pattern for paragraph, lists, tables
This commit is contained in:
@@ -22,9 +22,21 @@ module Ezdoc
|
||||
class DocumentRelationships
|
||||
NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships"
|
||||
|
||||
def initialize(has_numbering: false)
|
||||
@has_numbering = has_numbering
|
||||
end
|
||||
|
||||
def to_xml
|
||||
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
|
||||
xml.Relationships(xmlns: NAMESPACE)
|
||||
xml.Relationships(xmlns: NAMESPACE) do
|
||||
if @has_numbering
|
||||
xml.Relationship(
|
||||
Id: "rId1",
|
||||
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",
|
||||
Target: "numbering.xml"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
builder.to_xml
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user