class Github::Markdown
def render(*args)
"context": "github/gollum"
"mode": "gfm",
"text": "Hello world github/linguist#1 **cool**, and #1!",
github.markdown.render
github = Github.new
= Examples
into account when rendering as gfm
:context - Optional string - The repository context, only taken
linked accordingly.
always taken into account, and issue and user mentions are
comments or issues are rendered. In GFM mode, hard line breaks are
* gfm to render a document as user-content, e.g. like user
like README files are rendered.
* markdown to render a document as plain Markdown, just
:mode - Optional string - The rendering mode
:text - Required string - The Markdown text to render
= Parameters
Render an arbritrary Markdown document
def render(*args) arguments(args) do assert_required ['text'] end post_request("markdown", arguments.params, :raw => true) end
def render_raw(*args)
"mime": "text/plain",
github.markdown.render_raw "Hello github/linguist#1 **cool**, and #1!",
github = Github.new
= Examples
rendered – this is the simplest way to preview a readme online)
Markdown without a repository context (just like a README.md file is
text/plain or text/x-markdown and renders it as plain
The raw API it not JSON-based. It takes a Markdown document as plaintext
= Input
Render a Markdown document in raw mode
def render_raw(*args) params = arguments(args).params mime_type, params['data'] = params['mime'], args.shift post_request("markdown/raw", params, :raw => true, :headers => {'Content-Type' => mime_type || 'text/plain'}) end