Class: ODDB::View::Chapter

Inherits:
HtmlGrid::Value
  • Object
show all
Includes:
ChapterMethods
Defined in:
src/view/chapter.rb

Direct Known Subclasses

Drugs::MiniFiChapter, PrintChapter

Constant Summary

Constants included from ChapterMethods

PAR_STYLE, PRE_STYLE, SUB_STYLE, TABLE_STYLE, TD_STYLE

Instance Method Summary (collapse)

Methods included from ChapterMethods

#formats, #heading, #paragraphs, #sections, #table

Instance Method Details

- (Object) to_html(context)



110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'src/view/chapter.rb', line 110

def to_html(context)
  html = ''
  if @value
    unless(@value.heading.empty?)
      html << heading(context)
    end
    html << sections(context, @value.sections)
    if(hl = @session.user_input(:highlight))
      html.gsub!(hl, "<span class='highlight'>%s</span>" % hl)
    end
  end
  html
end