Module: GitHub::Client::Markdown

Included in:
GitHub::Client
Defined in:
lib/github_api_v3/client/markdown.rb

Overview

Contains methods for the Markdown API.

Instance Method Summary collapse

Instance Method Details

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

Render a markdown document.

Examples:

GitHub.markdown('# Hello World! ## H2 **yeah**!')
GitHub.markdown('# GitHub', mode: 'gfm', context: 'caseyscarborough/github')

Parameters:

  • text (String)

    The Markdown text to render.

  • options (Hash) (defaults to: {mode: 'markdown'})

    The optional options.

Options Hash (options):

  • :mode (String)

    The rendering mode.

  • :context (String)

    The repository context, only used when in ‘gfm’ mode.

Returns:

  • (String)

    The rendered text.

See Also:



21
22
23
24
# File 'lib/github_api_v3/client/markdown.rb', line 21

def markdown(text, options={mode: 'markdown'})
  options.merge!(text: text)
  post "/markdown", body: options
end