class TDiary::Style::EtCHtmlFactory

Public Class Methods

new( opt, idx = 1 ) click to toggle source
# File lib/tdiary/style/etdiary.rb, line 221
def initialize( opt, idx = 1 )
        @opt = opt
        @idx = idx
end

Public Instance Methods

block_title?( fragment ) click to toggle source
# File lib/tdiary/style/etdiary.rb, line 251
def block_title?( fragment )
        case fragment.anchor_type
        when :H3
                true
        else
                false
        end
end
p_end() click to toggle source
# File lib/tdiary/style/etdiary.rb, line 262
def p_end
        "</P>"
end
p_start() click to toggle source
# File lib/tdiary/style/etdiary.rb, line 259
def p_start
        "<P>"
end
pre_end() click to toggle source
# File lib/tdiary/style/etdiary.rb, line 268
def pre_end
        "</PRE>"
end
pre_start() click to toggle source
# File lib/tdiary/style/etdiary.rb, line 265
def pre_start
        "<PRE>"
end
section_end( date ) click to toggle source
# File lib/tdiary/style/etdiary.rb, line 248
def section_end( date )
        "<%=section_leave_proc( Time::at( #{date.to_i} ) )%>\n"
end
section_start( date ) click to toggle source
# File lib/tdiary/style/etdiary.rb, line 245
def section_start( date )
        "<%=section_enter_proc( Time::at( #{date.to_i} ) )%>\n"
end
title( date, fragment ) click to toggle source
# File lib/tdiary/style/etdiary.rb, line 225
def title( date, fragment )
        return nil if nil == fragment.anchor_type
        name = 'p%02d' % @idx
        return "<A NAME=\"#{name}\"></A>" if :A == fragment.anchor_type
        r = ""
        if fragment.subtitle
                r << %Q[<%= subtitle_proc( Time::at( #{date.to_i} ), #{fragment.subtitle.dump.gsub( /%/, '\\\\045' )} ) %>]
        else
                r << %Q[<%= subtitle_proc( Time::at( #{date.to_i} ), nil ) %>]
        end
        @idx += 1
        case fragment.anchor_type
        when :P
                r
        when :H4
                r + ": "
        when :H3
                "<H3>" + r + "</H3>\n"
        end
end