all repos — markup @ f6f0e0b580edd0bdefc1232775be59ffaa2e3f8d

The code we use to render README.your_favorite_markup

lib/github/markup/implementation.rb (view raw)

 1module GitHub
 2  module Markup
 3    class Implementation
 4      attr_reader :regexp
 5
 6      def initialize(regexp)
 7        @regexp = regexp
 8      end
 9
10      def load
11        # no-op by default
12      end
13
14      def render(content)
15        raise NotImplementedError, "subclasses of GitHub::Markup::Implementation must define #render"
16      end
17
18      def match?(filename)
19        Regexp.compile("\\.(#{regexp})$") =~ filename
20      end
21    end
22  end
23end