Add builder pattern for paragraph, lists, tables

This commit is contained in:
2025-12-02 10:57:54 +01:00
parent 50c9c20eca
commit b602b2a2ff
25 changed files with 1248 additions and 47 deletions

View File

@@ -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