Module: Gitlab::Client::Markdown

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/markdown.rb

Overview

Defines methods related to markdown.

Instance Method Summary collapse

Instance Method Details

#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')

Parameters:

  • text (String)

    The markdown text to render.

  • options (Hash) (defaults to: {})

    A customizable set of options.

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.

Returns:



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