Class: Commonmarker::Merge::Backend::Language

Inherits:
TreeHaver::Base::Language
  • Object
show all
Defined in:
lib/commonmarker/merge/backend.rb

Overview

Commonmarker language wrapper

Commonmarker only parses Markdown. This class exists for API compatibility.

Examples:

language = Commonmarker::Merge::Backend::Language.markdown
parser.language = language

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :markdown, options: {}) ⇒ Language

Create a new Commonmarker language instance

Parameters:

  • name (Symbol) (defaults to: :markdown)

    Language name (should be :markdown)

  • options (Hash) (defaults to: {})

    Commonmarker parse options



39
40
41
# File 'lib/commonmarker/merge/backend.rb', line 39

def initialize(name = :markdown, options: {})
  super(name, backend: :commonmarker, options: options)
end

Class Method Details

.markdown(options: {}) ⇒ Language

Create a Markdown language instance

Parameters:

  • options (Hash) (defaults to: {})

    Commonmarker parse options

Returns:



48
49
50
# File 'lib/commonmarker/merge/backend.rb', line 48

def markdown(options: {})
  new(:markdown, options: options)
end