class Dyndoc::TemplateContentOnly
Attributes
cfg[RW]
content[RW]
tmpl_cfg[RW]
Public Class Methods
new(cfg={})
click to toggle source
# File lib/dyndoc/content_only.rb, line 22 def initialize(cfg={}) @content="" @cfg=cfg @tmpl_cfg=@@cfg.dup @tmplMngr=Dyndoc.tmpl_mngr end
Public Instance Methods
init_tmpl()
click to toggle source
# File lib/dyndoc/content_only.rb, line 29 def init_tmpl @tmplMngr.init_doc(@tmpl_cfg) @tmplMngr.init_model(@content) #no model since @cfg[:model_doc] is nil! But, default libraries are loaded! @tmplMngr.parse(File.read(Dyndoc.doc_filename("Dyn/Minimum"))+"\n",@tmplMngr.filterGlobal) end
Also aliased as: init_doc
make_content(content=nil)
click to toggle source
# File lib/dyndoc/content_only.rb, line 48 def make_content(content=nil) @content=content if content ##@tmplMngr.cfg[:debug]=true if @tmplMngr.cfg[:debug] ##puts "@content";p @content return prepare_content else begin return prepare_content # rescue # print "WARNING: fail to eval content #{@content} !!\n" # return "" end end end
prepare_content()
click to toggle source
# File lib/dyndoc/content_only.rb, line 42 def prepare_content #Dyndoc.warn "prepare_content",@content out=@tmplMngr.parse(@content) return out end
require_dyndoc_libs(libs)
click to toggle source
# File lib/dyndoc/content_only.rb, line 37 def require_dyndoc_libs(libs) libs="{#require]\n"+libs.split("\n").map{|lib| lib.split(",")}.flatten.uniq.join("\n")+"\n[#}\n" @tmplMngr.parse(libs,@tmplMngr.filterGlobal) end