Implement many more nodes
All checks were successful
CI Pipeline / build (pull_request) Successful in 12s
All checks were successful
CI Pipeline / build (pull_request) Successful in 12s
Adds these new styling and formatting nodes * strike * highlight * linebreaks * pagebreaks * Hyperlinks
This commit is contained in:
@@ -24,10 +24,12 @@ module Notare
|
||||
STYLES_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
|
||||
NUMBERING_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"
|
||||
IMAGE_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
|
||||
HYPERLINK_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
|
||||
|
||||
def initialize(has_numbering: false, images: [], has_styles: false)
|
||||
def initialize(has_numbering: false, images: [], hyperlinks: [], has_styles: false)
|
||||
@has_numbering = has_numbering
|
||||
@images = images
|
||||
@hyperlinks = hyperlinks
|
||||
@has_styles = has_styles
|
||||
end
|
||||
|
||||
@@ -60,6 +62,16 @@ module Notare
|
||||
Target: "media/#{image.filename}"
|
||||
)
|
||||
end
|
||||
|
||||
# Hyperlinks come after images
|
||||
@hyperlinks.each do |hyperlink|
|
||||
xml.Relationship(
|
||||
Id: hyperlink.rid,
|
||||
Type: HYPERLINK_TYPE,
|
||||
Target: hyperlink.url,
|
||||
TargetMode: "External"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
builder.to_xml
|
||||
|
||||
Reference in New Issue
Block a user