Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1e9579d3
Commit
1e9579d3
authored
Jan 16, 2020
by
Alexander Oleynikov
Committed by
Douglas Barbosa Alexandre
Jan 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Org to list of supported markups for wiki
parent
7a0e51ca
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
5 deletions
+29
-5
app/models/project_wiki.rb
app/models/project_wiki.rb
+2
-1
changelogs/unreleased/19688-allow-org-mode-in-wiki.yml
changelogs/unreleased/19688-allow-org-mode-in-wiki.yml
+5
-0
doc/api/wikis.md
doc/api/wikis.md
+2
-2
doc/user/project/wiki/index.md
doc/user/project/wiki/index.md
+1
-1
lib/api/wikis.rb
lib/api/wikis.rb
+1
-1
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+18
-0
No files found.
app/models/project_wiki.rb
View file @
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
)
...
...
changelogs/unreleased/19688-allow-org-mode-in-wiki.yml
0 → 100644
View file @
1e9579d3
---
title
:
Add Org to the list of available markups for project wikis
merge_request
:
22898
author
:
Alexander Oleynikov
type
:
added
doc/api/wikis.md
View file @
1e9579d3
...
...
@@ -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
...
...
doc/user/project/wiki/index.md
View file @
1e9579d3
...
...
@@ -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.
...
...
lib/api/wikis.rb
View file @
1e9579d3
...
...
@@ -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, a
nd asciidoc
'
desc:
'Format of a wiki page. Available formats are markdown, rdoc, a
sciidoc and org
'
end
end
...
...
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
1e9579d3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment