Sha256: 3e62a451e5a79662d4705e98ac67e9af1dd06351aaab0a3ba0ecb8137ef3d081

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

module Rouge
  module Lexers
    class LiterateCoffeescript < RegexLexer
      tag 'literate_coffeescript'
      desc 'Literate coffeescript'
      aliases 'litcoffee'
      filenames '*.litcoffee'

      def markdown
        @markdown ||= Markdown.new(options)
      end

      def coffee
        @coffee ||= Coffeescript.new(options)
      end

      start { markdown.reset!; coffee.reset! }

      state :root do
        rule /^(    .*?\n)+/m do
          delegate coffee
        end

        rule /^([ ]{0,3}(\S.*?|)\n)*/m do
          delegate markdown
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rouge-1.5.0 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.4.0 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.3.4 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.3.3 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.3.2 lib/rouge/lexers/literate_coffeescript.rb
rouge-1.3.1 lib/rouge/lexers/literate_coffeescript.rb