class DaimonMarkdown::Plugin::TableOfContents::Header
Attributes
level[R]
text[R]
unique_id[R]
Public Class Methods
new(node)
click to toggle source
# File lib/daimon_markdown/plugin/toc.rb, line 55 def initialize(node) @node = node @level = node.name.tr("h", "").to_i @text = node.text @unique_id = "" end
Public Instance Methods
content?()
click to toggle source
# File lib/daimon_markdown/plugin/toc.rb, line 67 def content? @node.children.first end
link()
click to toggle source
# File lib/daimon_markdown/plugin/toc.rb, line 71 def link %Q(<a href="##{unique_id}">#{text}</a>) end
to_s()
click to toggle source
# File lib/daimon_markdown/plugin/toc.rb, line 75 def to_s @node.to_s end
unique_id=(id)
click to toggle source
# File lib/daimon_markdown/plugin/toc.rb, line 62 def unique_id=(id) @node["id"] = id @unique_id = id end