Class: Psd2Html
- Inherits:
-
Object
- Object
- Psd2Html
- Defined in:
- lib/psd2html.rb
Constant Summary collapse
- CONVERTING_MAP =
{ "text" => ::Psd2html::PsConvertor::Text, "text-link" => ::Psd2html::PsConvertor::TextLink, "block" => ::Psd2html::PsConvertor::Block, "block-link" => ::Psd2html::PsConvertor::BlockLink, "img" => ::Psd2html::PsConvertor::Img, "img-link" => ::Psd2html::PsConvertor::ImgLink, "img-bg" => ::Psd2html::PsConvertor::ImgBackground, "root" => ::Psd2html::PsConvertor::Root }
Instance Method Summary collapse
-
#initialize(psdPath, dstHtmlPath) ⇒ Psd2Html
constructor
A new instance of Psd2Html.
- #render ⇒ Object
- #render_css ⇒ Object
- #render_html ⇒ Object
Constructor Details
#initialize(psdPath, dstHtmlPath) ⇒ Psd2Html
Returns a new instance of Psd2Html.
19 20 21 22 23 24 25 26 27 |
# File 'lib/psd2html.rb', line 19 def initialize(psdPath,dstHtmlPath) @dstHtmlPath = dstHtmlPath psd = PSD.new(psdPath) psd.parse! blockRoot = psd.tree rootConvertor = get_convertor(blockRoot,1) @treeRoot = format_tree(rootConvertor) Until.log("start generate psd tree....") end |
Instance Method Details
#render ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/psd2html.rb', line 38 def render return <<-STR <meta charset="utf-8" /> <style type="text/css"> #{@treeRoot.render_css} </style> #{@treeRoot.render_html} STR end |