Sha256: 233f66955c3e514fc1ffd40a6ce8a9ded5c0c92b96964904d077eeb8c976cad1

Contents?: true

Size: 983 Bytes

Versions: 6

Compression:

Stored size: 983 Bytes

Contents

# frozen_string_literal: true

require 'front_matter_parser/syntax_parser/factorizable'
require 'front_matter_parser/syntax_parser/multi_line_comment'
require 'front_matter_parser/syntax_parser/indentation_comment'
require 'front_matter_parser/syntax_parser/single_line_comment'

module FrontMatterParser
  # This module includes parsers for different syntaxes.  They respond to
  # a method `#call`, which takes a string as argument and responds with
  # a hash interface with `:front_matter` and `:content` keys, or `nil` if no
  # front matter is found.
  #
  # :reek:TooManyConstants
  module SyntaxParser
    Coffee = SingleLineComment['#']
    Sass = SingleLineComment['//']
    Scss = SingleLineComment['//']

    Html = MultiLineComment['<!--', '-->']
    Erb = MultiLineComment['<%#', '%>']
    Liquid = MultiLineComment['{% comment %}', '{% endcomment %}']
    Md = MultiLineComment['', '']

    Slim = IndentationComment['/']
    Haml = IndentationComment['-#']
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
front_matter_parser-1.0.1 lib/front_matter_parser/syntax_parser.rb
front_matter_parser-1.0.0 lib/front_matter_parser/syntax_parser.rb
front_matter_parser-0.2.1 lib/front_matter_parser/syntax_parser.rb
front_matter_parser-0.2.0 lib/front_matter_parser/syntax_parser.rb
front_matter_parser-0.1.1 lib/front_matter_parser/syntax_parser.rb
front_matter_parser-0.1.0 lib/front_matter_parser/syntax_parser.rb