# module Kramdown::Converter::SyntaxHighlighter::Minted

Uses `Minted` to highlight code blocks and code spans.

### Public Class Methods

call(converter, text, lang, type, _opts) click to toggle source

       # File lib/kramdown/converter/syntax_highlighter/minted.rb
    14 def self.call(converter, text, lang, type, _opts)
    15   opts = converter.options[:syntax_highlighter_opts]
    16
    17   # Fallback to default language
    18   lang ||= opts[:default_lang]
    19
    20   options = []
    21   options << "breaklines" if opts[:wrap]
    22   options << "linenos" if opts[:line_numbers]
    23   options << "frame=#{opts[:frame]}" if opts[:frame]
    24
    25   if lang && type == :block
    26     "\\begin{minted}[#{options.join(',')}]{#{lang}}\n#{text}\n\\end{minted}"
    27   elsif lang && type == :span
    28     "\\mintinline{#{lang}}{#{text}}"
    29   else
    30     nil
    31   end
    32 end