Method: Github::Markdown#render
- Defined in:
- lib/github_api/markdown.rb
#render(*args) ⇒ Object
Render an arbritrary Markdown document
Parameters
<tt>:text</tt> - Required string - The Markdown text to render
<tt>:mode<tt> - Optional string - The rendering mode
* <tt>markdown</tt> to render a document as plain Markdown, just
like README files are rendered.
* <tt>gfm</tt> to render a document as user-content, e.g. like user
comments or issues are rendered. In GFM mode, hard line breaks are
always taken into account, and issue and user mentions are
linked accordingly.
<tt>:context<tt> - Optional string - The repository context, only taken
into account when rendering as <tt>gfm</tt>
Examples
github = Github.new
github.markdown.render
"text": "Hello world github/linguist#1 **cool**, and #1!",
"mode": "gfm",
"context": "github/gollum"
27 28 29 30 31 32 33 34 35 |
# File 'lib/github_api/markdown.rb', line 27 def render(*args) arguments(args) do assert_required ['text'] end params = arguments.params params['raw'] = true post_request("markdown", arguments.params) end |