module TTY::Markdown
def parse(source,
- Api: - public
Returns:
-
(String)
-
Parameters:
-
doc_opts
(Hash
) -- -
width
(Integer
) -- -
theme
(Hash{Symbol => Array, String, Symbol}, nil
) -- -
symbols
(Hash, String, Symbol, nil
) -- -
mode
(Integer
) -- -
indent
(Integer
) -- -
color
(String, Symbol
) -- -
source
(String
) --
def parse(source, color: :auto, indent: 2, mode: TTY::Color.mode, symbols: {}, theme: {}, width: TTY::Screen.width, **doc_opts) converter_options = { enabled: color_enabled(color), indent: indent, input: "KramdownExt", mode: mode, symbols: build_symbols(symbols), theme: build_theme(theme), width: width } doc = Kramdown::Document.new(source, converter_options.merge(doc_opts)) Converter.convert(doc.root, doc.options).join end