Commit 7f0a9c2c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '19688-allow-org-mode-in-wiki' into 'master'

Add Org to list of supported markups for wiki

See merge request gitlab-org/gitlab!22898
parents 7a0e51ca 1e9579d3
......@@ -7,7 +7,8 @@ class ProjectWiki
MARKUPS = {
'Markdown' => :markdown,
'RDoc' => :rdoc,
'AsciiDoc' => :asciidoc
'AsciiDoc' => :asciidoc,
'Org' => :org
}.freeze unless defined?(MARKUPS)
CouldNotCreateWikiError = Class.new(StandardError)
......
---
title: Add Org to the list of available markups for project wikis
merge_request: 22898
author: Alexander Oleynikov
type: added
......@@ -86,7 +86,7 @@ POST /projects/:id/wikis
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
| `content` | string | yes | The content of the wiki page |
| `title` | string | yes | The title of the wiki page |
| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, and `asciidoc` |
| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` |
```bash
curl --data "format=rdoc&title=Hello&content=Hello world" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis"
......@@ -116,7 +116,7 @@ PUT /projects/:id/wikis/:slug
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
| `content` | string | yes if `title` is not provided | The content of the wiki page |
| `title` | string | yes if `content` is not provided | The title of the wiki page |
| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, and `asciidoc` |
| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` |
| `slug` | string | yes | The slug (a unique string) of the wiki page |
```bash
......
......@@ -38,7 +38,7 @@ automatically. For example, a title of `docs/my-page` will create a wiki
page with a path `/wikis/docs/my-page`.
Once you enter the page name, it's time to fill in its content. GitLab wikis
support Markdown, RDoc and AsciiDoc. For Markdown based pages, all the
support Markdown, RDoc, AsciiDoc and Org. For Markdown based pages, all the
[Markdown features](../../markdown.md) are supported and for links there is
some [wiki specific](../../markdown.md#wiki-specific-markdown) behavior.
......
......@@ -26,7 +26,7 @@ module API
type: String,
values: ProjectWiki::MARKUPS.values.map(&:to_s),
default: 'markdown',
desc: 'Format of a wiki page. Available formats are markdown, rdoc, and asciidoc'
desc: 'Format of a wiki page. Available formats are markdown, rdoc, asciidoc and org'
end
end
......
......@@ -145,6 +145,24 @@ describe "User creates wiki page" do
end
end
it 'creates a wiki page with Org markup', :aggregate_failures do
org_content = <<~ORG
* Heading
** Subheading
[[home][Link to Home]]
ORG
page.within('.wiki-form') do
find('#wiki_format option[value=org]').select_option
fill_in(:wiki_content, with: org_content)
click_button('Create page')
end
expect(page).to have_selector('h1', text: 'Heading')
expect(page).to have_selector('h2', text: 'Subheading')
expect(page).to have_link('Link to Home', href: "/#{project.full_path}/-/wikis/home")
end
it_behaves_like 'wiki file attachments', :quarantine
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment