Module: Kramdown::Converter::SyntaxHighlighter::Minted

### Home Classes Methods

### In Files

- lib/kramdown/converter/syntax_highlighter/minted.rb

### Methods

- ::call

### Class/Module Index

Quicksearch

- Kramdown
- Kramdown::Converter
- Kramdown::Converter::Base
- Kramdown::Converter::Html
- Kramdown::Converter::Kramdown
- Kramdown::Converter::Latex
- Kramdown::Converter::MathEngine
- Kramdown::Converter::MathEngine::Itex2MML
- Kramdown::Converter::MathEngine::Mathjax
- Kramdown::Converter::MathEngine::MathjaxNode
- Kramdown::Converter::MathEngine::Ritex
- Kramdown::Converter::RemoveHtmlTags
- Kramdown::Converter::SyntaxHighlighter
- Kramdown::Converter::SyntaxHighlighter::Coderay
- Kramdown::Converter::SyntaxHighlighter::Minted
- Kramdown::Converter::SyntaxHighlighter::Rouge
- Kramdown::Converter::Toc
- Kramdown::Document
- Kramdown::Element
- Kramdown::Error
- Kramdown::Options
- Kramdown::Options::Boolean
- Kramdown::Parser
- Kramdown::Parser::Base
- Kramdown::Parser::GFM
- Kramdown::Parser::Html
- Kramdown::Parser::Html::Constants
- Kramdown::Parser::Html::ElementConverter
- Kramdown::Parser::Html::Parser
- Kramdown::Parser::Kramdown
- Kramdown::Parser::Markdown
- Kramdown::Utils
- Kramdown::Utils::Configurable
- Kramdown::Utils::Entities
- Kramdown::Utils::Entities::Entity
- Kramdown::Utils::Html
- Kramdown::Utils::OrderedHash
- Kramdown::Utils::StringScanner
- Kramdown::Utils::Unidecoder

No matching classes.

# 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, line 14
    def self.call(converter, text, lang, type, _opts)
      opts = converter.options[:syntax_highlighter_opts]

      # Fallback to default language
      lang ||= opts[:default_lang]

      options = []
      options << "breaklines" if opts[:wrap]
      options << "linenos" if opts[:line_numbers]
      options << "frame=#{opts[:frame]}" if opts[:frame]

      if lang && type == :block
        "\\begin{minted}[#{options.join(',')}]{#{lang}}\n#{text}\n\\end{minted}"
      elsif lang && type == :span
        "\\mintinline{#{lang}}{#{text}}"
      else
        nil
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.