aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/xml_docbook5.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-15 19:02:12 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-15 19:02:12 -0400
commit4ef1c3099119cedff245acfe1ef26e5829e5bf62 (patch)
tree889a72066aaf70267f4209fd22dcf3aa6c8bbaa6 /lib/sisu/v6/xml_docbook5.rb
parentv5 v6: base images & css, continue (diff)
v5 v6: document images (more to clean up)sisu_5.5.1
Diffstat (limited to 'lib/sisu/v6/xml_docbook5.rb')
-rw-r--r--lib/sisu/v6/xml_docbook5.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb
index 3baa21d9..f105eab9 100644
--- a/lib/sisu/v6/xml_docbook5.rb
+++ b/lib/sisu/v6/xml_docbook5.rb
@@ -128,8 +128,30 @@ module SiSU_XML_Docbook_Book
#extract_endnotes
data=markup_text(data)
structure_build_collapsed(data)
+ document_images if @md.ec[:image] and @md.ec[:image].length > 0
#tail
end
+ def document_images
+ img_pth={
+ src: @md.opt.image_src_path,
+ dest: @md.env.path.webserv + '/_sisu/image',
+ }
+ unless FileTest.directory?(img_pth[:dest])
+ #mkdir?
+ end
+ if FileTest.directory?(img_pth[:dest])
+ @md.ec[:image].each do |x|
+ img={
+ src: "#{img_pth[:src]}/#{x}",
+ dest: "#{img_pth[:dest]}/#{x}",
+ }
+ if FileTest.file?(img[:src])
+ FileUtils::cp(img[:src],img[:dest])
+ else p "Not Found: #{img[:src]}/#{x}"
+ end
+ end
+ end
+ end
def spaces
Ax[:spaces]
end