Module: GFM

Defined in:
lib/gfm.rb,
lib/gfm/version.rb,
lib/gfm/converter.rb

Defined Under Namespace

Classes: Converter

Constant Summary collapse

HELP_TEXT =
<<HELP
Usage: gfm INPUT_FILE.md [OUTPUT_FILE] [options]

  INPUT_FILE.md   The markdown file to be parsed with GitHub Flavored Markdown.

  OUTPUT_FILE     Name of the output file to be generated. If no name is given,
                  INPUT_FILE.html is used.

  --help, -h      Display this help message.

  --version, -v   Display the version number.
HELP
VERSION =
'0.2.1'

Class Method Summary collapse

Class Method Details

.pipelineObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/gfm.rb', line 22

def self.pipeline
  HTML::Pipeline.new [
    HTML::Pipeline::MarkdownFilter,
    HTML::Pipeline::TableOfContentsFilter,
    HTML::Pipeline::SanitizationFilter,
    HTML::Pipeline::ImageMaxWidthFilter,
    HTML::Pipeline::HttpsFilter,
    HTML::Pipeline::MentionFilter,
    HTML::Pipeline::SyntaxHighlightFilter,
    HTML::Pipeline::EmojiFilter
  ],
  http_url: 'http://github.com',
  asset_root: 'https://assets-cdn.github.com/images/icons'

end

.stylesheet_tagsObject



38
39
40
41
42
# File 'lib/gfm.rb', line 38

def self.stylesheet_tags
  HTTPClient.new.get("https://github.com").body.split("\n").select do |line|
    line =~ /https:.*github.*\.css/
  end.join
end