\{\{([<>]?)toc\}\}<\/p>/i unless const_defined?(:TOC_RE) # Renders the TOC with given headings def replace_toc(text, headings) text.gsub!(TOC_RE) do if headings.empty? '' else div_class = 'toc' div_class << ' right' if $1 == '>' div_class << ' left' if $1 == '<' out = "
' end end end # # displays the current url plus an optional anchor # def full_url(anchor_name = '') return "##{anchor_name}" if current_request.nil? current = request.original_fullpath return current if anchor_name.blank? "#{current}##{anchor_name}" end def current_request request rescue nil end end end