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

Version Path
gollum-lib-6.0-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-6.0 lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.4-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.4 lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.3-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.3 lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.2-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.2 lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.1-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2.1 lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.2 lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.1.3-java lib/gollum-lib/macro/global_toc.rb
gollum-lib-5.1.3 lib/gollum-lib/macro/global_toc.rb