Module: Octokit::Client::Markdown

Included in:
Octokit::Client
Defined in:
lib/octokit/client/markdown.rb

Instance Method Summary collapse

Instance Method Details

#markdown(text, options = {}) ⇒ String

Receive the default Readme for a repository

Examples:

Render some GFM

Octokit.markdown('Fixed in #111', :mode => "gfm", :context => "pengwynn/octokit")

Parameters:

  • text (String)

    Markdown source

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

    a customizable set of options

Options Hash (options):

  • (optional) (String)

    :mode (‘markdown` or `gfm`)

  • (optional) (String)

    :context Repo context

Returns:

  • (String)

    HTML renderization

See Also:



14
15
16
17
18
# File 'lib/octokit/client/markdown.rb', line 14

def markdown(text, options={})
  options[:text] = text
  options[:repo] = Repository.new(options[:repo]) if options[:repo]
  post("markdown", options, 3, true, true).body
end