Sha256: 4d1747a85e671ed11eb1b787d4295f02eeb71d33c4e1e3c47f867e64a1694a1a

Contents?: true

Size: 1012 Bytes

Versions: 21

Compression:

Stored size: 1012 Bytes

Contents

# frozen_string_literal: true

class Gitlab::Client
  # Defines methods related to markdown.
  # @see https://docs.gitlab.com/ce/api/markdown.html
  module Markdown
    # Render an arbitrary Markdown document
    #
    # @example
    #   Gitlab.markdown('Hello world! :tada:')
    #   Gitlab.markdown('Hello world! :tada:', gfm: true, project: 'group_example/project_example')
    #
    # @param  [String] text The markdown text to render.
    # @param  [Hash] options A customizable set of options.
    # @option options [Boolean] :gfm(optional) Render text using GitLab Flavored Markdown. Default is false.
    # @option options [String] :project(optional) Use project as a context when creating references using GitLab Flavored Markdown. Authentication is required if a project is not public.
    # @return <Gitlab::ObjectifiedHash> Returns the rendered markdown as response
    def markdown(text, options = {})
      body = { text: text }.merge(options)
      post('/markdown', body: body)
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
gitlab-5.1.0 lib/gitlab/client/markdown.rb
gitlab-5.0.0 lib/gitlab/client/markdown.rb
gitlab-4.20.1 lib/gitlab/client/markdown.rb
gitlab-4.20.0 lib/gitlab/client/markdown.rb
fs-gitlab-4.19.3 lib/gitlab/client/markdown.rb
fs-gitlab-4.19.2 lib/gitlab/client/markdown.rb
fs-gitlab-4.19.1 lib/gitlab/client/markdown.rb
gitlab-4.19.0 lib/gitlab/client/markdown.rb
fs-gitlab-4.18.2 lib/gitlab/client/markdown.rb
fs-gitlab-4.18.1 lib/gitlab/client/markdown.rb
gitlab-4.18.0 lib/gitlab/client/markdown.rb
gitlab-4.17.0 lib/gitlab/client/markdown.rb
gitlab-4.16.1 lib/gitlab/client/markdown.rb
gitlab-4.16.0 lib/gitlab/client/markdown.rb
gitlab-4.15.0 lib/gitlab/client/markdown.rb
gitlab-4.14.1 lib/gitlab/client/markdown.rb
gitlab-4.14.0 lib/gitlab/client/markdown.rb
gitlab-4.13.1 lib/gitlab/client/markdown.rb
gitlab-4.13.0 lib/gitlab/client/markdown.rb
gitlab-4.12.0 lib/gitlab/client/markdown.rb