Class: TTY::Markdown::Converter Private
- Inherits:
-
Kramdown::Converter::Base
- Object
- Kramdown::Converter::Base
- TTY::Markdown::Converter
- Defined in:
- lib/tty/markdown/converter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Responsible for converting a Markdown document into terminal output
Instance Method Summary collapse
-
#convert(element, options = {indent: 0}) ⇒ String
Convert an element.
-
#initialize(root, options = {}) ⇒ Converter
constructor
Create a Converter instance.
Constructor Details
#initialize(root, options = {}) ⇒ Converter
Create a TTY::Markdown::Converter instance
115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/tty/markdown/converter.rb', line 115 def initialize(root, = {}) super pastel = Pastel.new(enabled: [:enabled]) @decorator = Decorator.new(pastel, [:theme]) @highlighter = Highlighter.new(@decorator, mode: [:mode]) @current_indent = 0 @footnote_number = 1 @footnotes = {} @indent = [:indent] @symbols = [:symbols] @width = [:width] end |
Instance Method Details
#convert(element, options = {indent: 0}) ⇒ String
Convert an element
141 142 143 |
# File 'lib/tty/markdown/converter.rb', line 141 def convert(element, = {indent: 0}) send(:"convert_#{element.type}", element, ) end |