Class: ApplicationMarkdown
- Inherits:
-
MarkdownRails::Renderer::Rails
- Object
- Redcarpet::Render::HTML
- MarkdownRails::Renderer::Base
- MarkdownRails::Renderer::Rails
- ApplicationMarkdown
- Includes:
- Redcarpet::Render::SmartyPants
- Defined in:
- lib/generators/markdown_rails/install/templates/app/markdown/application_markdown.rb
Overview
You should read the docs at github.com/vmg/redcarpet and probably delete a bunch of stuff below if you don’t need it.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from MarkdownRails::Renderer::Rails
Instance Method Summary collapse
-
#enable ⇒ Object
These flags control features in the Redcarpet renderer, which you can read about at github.com/vmg/redcarpet#and-its-like-really-simple-to-use Make sure you know what you’re doing if you’re using this to render user inputs.
-
#image(link, title, alt) ⇒ Object
Example of how you might override the images to show embeds, like a YouTube video.
Methods inherited from MarkdownRails::Renderer::Rails
default_view_context, #initialize, #renderer
Methods inherited from MarkdownRails::Renderer::Base
Constructor Details
This class inherits a constructor from MarkdownRails::Renderer::Rails
Instance Method Details
#enable ⇒ Object
These flags control features in the Redcarpet renderer, which you can read about at github.com/vmg/redcarpet#and-its-like-really-simple-to-use Make sure you know what you’re doing if you’re using this to render user inputs.
28 29 30 |
# File 'lib/generators/markdown_rails/install/templates/app/markdown/application_markdown.rb', line 28 def enable [:fenced_code_blocks] end |
#image(link, title, alt) ⇒ Object
Example of how you might override the images to show embeds, like a YouTube video.
33 34 35 36 37 38 39 40 41 |
# File 'lib/generators/markdown_rails/install/templates/app/markdown/application_markdown.rb', line 33 def image(link, title, alt) url = URI(link) case url.host when "www.youtube.com" youtube_tag url, alt else super end end |