Method: Gitlab::Client::Wikis#create_wiki

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

#create_wiki(project, title, content, options = {}) ⇒ Gitlab::ObjectifiedHash

Creates a new wiki page for the given repository with the given title, slug, and content.

Examples:

Gitlab.create_wiki(3, 'Some Title', 'Some Content')
Gitlab.create_wiki(3, 'Some Title', 'Some Content', { format: 'rdoc' })

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • content (String)

    The content of the wiki page.

  • title (String)

    The title of the wiki page.

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

    A customizable set of options.

Options Hash (options):

  • format (String) — default: optional

    The format of the wiki page. Available formats are: markdown (default), rdoc, and asciidoc.

Returns:


45
46
47
48
# File 'lib/gitlab/client/wikis.rb', line 45

def create_wiki(project, title, content, options = {})
  body = { content: content, title: title }.merge(options)
  post("/projects/#{url_encode project}/wikis", body: body)
end