Class: Qiita::Markdown::Greenmat::HTMLRenderer
- Inherits:
-
Greenmat::Render::HTML
- Object
- Greenmat::Render::HTML
- Qiita::Markdown::Greenmat::HTMLRenderer
show all
- Includes:
- HeadingRendering
- Defined in:
- lib/qiita/markdown/greenmat/html_renderer.rb
Defined Under Namespace
Classes: Heading, HeadingWithAnchor
Instance Method Summary
collapse
#heading_counter
Constructor Details
#initialize(extensions = {}) ⇒ HTMLRenderer
9
10
11
12
|
# File 'lib/qiita/markdown/greenmat/html_renderer.rb', line 9
def initialize(extensions = {})
super
@with_toc_data = extensions[:with_toc_data]
end
|
Instance Method Details
#autolink(link, link_type) ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/qiita/markdown/greenmat/html_renderer.rb', line 15
def autolink(link, link_type)
if link_type == :email
%(<a href="mailto:#{link}" class="autolink">#{link}</a>)
else
%(<a href="#{link}" class="autolink">#{link}</a>)
end
end
|
23
24
25
26
27
28
|
# File 'lib/qiita/markdown/greenmat/html_renderer.rb', line 23
def (text, level)
heading = heading_class.new(text, level, heading_counter)
heading.to_s.tap do
heading.increment
end
end
|