Sha256: 6f7168d47a7bb94f407455a02ebc9d7df2865859cf01247d8a2cdba9e8a6a723
Contents?: true
Size: 505 Bytes
Versions: 14
Compression:
Stored size: 505 Bytes
Contents
module Gollum class Macro class GlobalTOC < Gollum::Macro def render(title = "Global Table of Contents") if @wiki.pages.size > 0 prepath = @wiki.base_path.sub(/\/$/, '') result = '<ul>' + @wiki.pages.map { |p| "<li><a href=\"#{CGI::escapeHTML(prepath + "/" + p.escaped_url_path)}\">#{CGI::escapeHTML(p.url_path)}</a></li>" }.join + '</ul>' end "<div class=\"toc\"><div class=\"toc-title\">#{title}</div>#{result}</div>" end end end end
Version data entries
14 entries across 14 versions & 1 rubygems