Method: Gitlab::Client::Markdown#markdown

Defined in:
lib/gitlab/client/markdown.rb

#markdown(text, options = {}) ⇒ Gitlab::ObjectifiedHash

Render an arbitrary Markdown document

Examples:

Gitlab.markdown('Hello world! :tada:')
Gitlab.markdown('Hello world! :tada:', gfm: true, project: 'group_example/project_example')

Options Hash (options):

  • :gfm(optional) (Boolean)

    Render text using GitLab Flavored Markdown. Default is false.

  • :project(optional) (String)

    Use project as a context when creating references using GitLab Flavored Markdown. Authentication is required if a project is not public.

Parameters:

  • The markdown text to render.

  • (defaults to: {})

    A customizable set of options.

Returns:

  • Returns the rendered markdown as response



18
19
20
21
# File 'lib/gitlab/client/markdown.rb', line 18

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