123456789_123456789_123456789_123456789_123456789_

Module: Octokit::Client::Markdown

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/octokit/client/markdown.rb

Overview

Methods for the Markdown API

Instance Method Summary

Instance Method Details

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

Render an arbitrary Markdown document

Examples:

Render some GFM

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

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:

[ GitHub ]

  
# File 'lib/octokit/client/markdown.rb', line 18

def markdown(text, options = {})
  options[:text] = text
  options[:repo] = Repository.new(options[:repo]) if options[:repo]
  options[:accept] = 'application/vnd.github.raw'

  post 'markdown', options
end