Sha256: 3b7372321e646b02144c1689ad5b54e5566a6c4e362a690a9d82d24c5de8147a

Contents?: true

Size: 1.87 KB

Versions: 14

Compression:

Stored size: 1.87 KB

Contents

# -*- coding: utf-8 -*-
#
#--
# Copyright (C) 2009-2015 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#

module Kramdown
  module Converter

    # == Container for Syntax Highlighters
    #
    # This module serves as container for the syntax highlighters that can be used together with
    # kramdown.
    #
    # A syntax highlighter should not store any data itself but should use the provided converter
    # object to do so (See Kramdown::Converter::Base#data).
    #
    # == Implementing a Syntax Highlighter
    #
    # Implementing a new syntax highlighter is easy because it is just an object that needs to
    # respond to #call.
    #
    # The method #call needs to take the following arguments:
    #
    # converter:: This argument contains the converter object that calls the syntax highlighter. It
    #             can be used, for example, to store data in Kramdown::Converter::Base#data for one
    #             conversion run.
    #
    # text:: The raw text that should be highlighted.
    #
    # lang:: The language that the text should be highlighted for (e.g. ruby, python, ...).
    #
    # type:: The type of text, either :span for span-level code or :block for a codeblock.
    #
    # opts:: A Hash with options that may be passed from the converter.
    #
    # The return value of the method should be the highlighted text, suitable for the given
    # converter (e.g. HTML for the HTML converter).
    #
    # == Special Implementation Details
    #
    # HTML converter:: If the syntax highlighter is used with a HTML converter, it should return
    #                  :block type text correctly wrapped (i.e. normally inside a pre-tag, but may
    #                  also be a table-tag or just a div-tag) but :span type text *without* a
    #                  code-tag!
    module SyntaxHighlighter
    end

  end
end

Version data entries

14 entries across 13 versions & 5 rubygems

Version Path
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/kramdown-1.8.0/lib/kramdown/converter/syntax_highlighter.rb
kramdown-1.10.0 lib/kramdown/converter/syntax_highlighter.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/kramdown-1.8.0/lib/kramdown/converter/syntax_highlighter.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/kramdown-1.8.0/lib/kramdown/converter/syntax_highlighter.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/kramdown-1.8.0/lib/kramdown/converter/syntax_highlighter.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/kramdown-1.9.0/lib/kramdown/converter/syntax_highlighter.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/kramdown-1.9.0/lib/kramdown/converter/syntax_highlighter.rb
logstash-codec-json-2.0.3 vendor/gems/kramdown-1.9.0/lib/kramdown/converter/syntax_highlighter.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/kramdown-1.9.0/lib/kramdown/converter/syntax_highlighter.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/kramdown-1.9.0/lib/kramdown/converter/syntax_highlighter.rb
kramdown-1.9.0 lib/kramdown/converter/syntax_highlighter.rb
kramdown-1.8.0 lib/kramdown/converter/syntax_highlighter.rb
kramdown-1.7.0 lib/kramdown/converter/syntax_highlighter.rb
kramdown-1.6.0 lib/kramdown/converter/syntax_highlighter.rb