2016-10-14 04:57:32 -04:00
|
|
|
# Wiki
|
|
|
|
|
2017-05-02 14:07:07 -04:00
|
|
|
A separate system for documentation called Wiki, is built right into each
|
|
|
|
GitLab project. It is enabled by default on all new projects and you can find
|
|
|
|
it under **Wiki** in your project.
|
2016-10-14 04:57:32 -04:00
|
|
|
|
2017-08-30 21:04:55 -04:00
|
|
|
Wikis are very convenient if you don't want to keep your documentation in your
|
2017-05-02 14:07:07 -04:00
|
|
|
repository, but you do want to keep it in the same project where your code
|
|
|
|
resides.
|
2016-10-14 04:57:32 -04:00
|
|
|
|
2017-05-02 14:07:07 -04:00
|
|
|
You can create Wiki pages in the web interface or
|
|
|
|
[locally using Git](#adding-and-editing-wiki-pages-locally) since every Wiki is
|
|
|
|
a separate Git repository.
|
|
|
|
|
|
|
|
## First time creating the Home page
|
|
|
|
|
|
|
|
The first time you visit a Wiki, you will be directed to create the Home page.
|
|
|
|
The Home page is necessary to be created since it serves as the landing page
|
|
|
|
when viewing a Wiki. You only have to fill in the **Content** section and click
|
|
|
|
**Create page**. You can always edit it later, so go ahead and write a welcome
|
|
|
|
message.
|
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
![New home page](img/wiki_create_home_page.png)
|
2017-05-02 14:07:07 -04:00
|
|
|
|
|
|
|
## Creating a new wiki page
|
2016-10-14 04:57:32 -04:00
|
|
|
|
2018-11-14 03:44:16 -05:00
|
|
|
NOTE: **Note:**
|
2019-03-26 13:05:34 -04:00
|
|
|
Requires Developer [permissions](../../permissions.md).
|
2018-11-14 03:44:16 -05:00
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
Create a new page by clicking the **New page** button that can be found
|
|
|
|
in all wiki pages. You will be asked to fill in the page name from which GitLab
|
|
|
|
will create the path to the page. You can specify a full path for the new file
|
|
|
|
and any missing directories will be created automatically.
|
|
|
|
|
|
|
|
![New page modal](img/wiki_create_new_page_modal.png)
|
|
|
|
|
|
|
|
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
|
|
|
|
[Markdown features](../../markdown.md) are supported and for links there is
|
|
|
|
some [wiki specific](../../markdown.md#wiki-specific-markdown) behavior.
|
|
|
|
|
2016-10-14 04:57:32 -04:00
|
|
|
In the web interface the commit message is optional, but the GitLab Wiki is
|
|
|
|
based on Git and needs a commit message, so one will be created for you if you
|
|
|
|
do not enter one.
|
2017-05-02 14:07:07 -04:00
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
When you're ready, click the **Create page** and the new page will be created.
|
|
|
|
|
|
|
|
![New page](img/wiki_create_new_page.png)
|
|
|
|
|
2018-09-20 13:02:29 -04:00
|
|
|
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/33475) in GitLab 11.3.
|
|
|
|
|
|
|
|
Starting with GitLab 11.3, any file that is uploaded to the wiki via GitLab's
|
|
|
|
interface will be stored in the wiki Git repository, and it will be available
|
|
|
|
if you clone the wiki repository locally. All uploaded files prior to GitLab
|
|
|
|
11.3 are stored in GitLab itself. If you want them to be part of the wiki's Git
|
|
|
|
repository, you will have to upload them again.
|
|
|
|
|
2017-05-02 14:07:07 -04:00
|
|
|
## Editing a wiki page
|
|
|
|
|
2018-11-14 03:44:16 -05:00
|
|
|
NOTE: **Note:**
|
2019-03-26 13:05:34 -04:00
|
|
|
Requires Developer [permissions](../../permissions.md).
|
2018-11-14 03:44:16 -05:00
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
To edit a page, simply click on the **Edit** button. From there on, you can
|
|
|
|
change its content. When done, click **Save changes** for the changes to take
|
|
|
|
effect.
|
|
|
|
|
2017-05-02 14:07:07 -04:00
|
|
|
## Deleting a wiki page
|
|
|
|
|
2018-11-14 03:44:16 -05:00
|
|
|
NOTE: **Note:**
|
2019-03-26 13:05:34 -04:00
|
|
|
Requires Maintainer [permissions](../../permissions.md).
|
2018-11-14 03:44:16 -05:00
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
You can find the **Delete** button only when editing a page. Click on it and
|
|
|
|
confirm you want the page to be deleted.
|
|
|
|
|
2018-02-05 12:17:21 -05:00
|
|
|
## Moving a wiki page
|
|
|
|
|
|
|
|
You can move a wiki page from one directory to another by specifying the full
|
|
|
|
path in the wiki page title in the [edit](#editing-a-wiki-page) form.
|
|
|
|
|
|
|
|
![Moving a page](img/wiki_move_page_1.png)
|
|
|
|
|
|
|
|
![After moving a page](img/wiki_move_page_2.png)
|
|
|
|
|
|
|
|
In order to move a wiki page to the root directory, the wiki page title must
|
|
|
|
be preceded by the slash (`/`) character.
|
|
|
|
|
2017-05-02 14:07:07 -04:00
|
|
|
## Viewing a list of all created wiki pages
|
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
Every wiki has a sidebar from which a short list of the created pages can be
|
|
|
|
found. The list is ordered alphabetically.
|
|
|
|
|
|
|
|
![Wiki sidebar](img/wiki_sidebar.png)
|
|
|
|
|
|
|
|
If you have many pages, not all will be listed in the sidebar. Click on
|
|
|
|
**More pages** to see all of them.
|
|
|
|
|
2017-05-02 14:07:07 -04:00
|
|
|
## Viewing the history of a wiki page
|
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
The changes of a wiki page over time are recorded in the wiki's Git repository,
|
|
|
|
and you can view them by clicking the **Page history** button.
|
|
|
|
|
|
|
|
From the history page you can see the revision of the page (Git commit SHA), its
|
|
|
|
author, the commit message, when it was last updated and the page markup format.
|
|
|
|
To see how a previous version of the page looked like, click on a revision
|
|
|
|
number.
|
|
|
|
|
|
|
|
![Wiki page history](img/wiki_page_history.png)
|
2017-05-02 14:07:07 -04:00
|
|
|
|
|
|
|
## Adding and editing wiki pages locally
|
|
|
|
|
2017-05-02 17:49:27 -04:00
|
|
|
Since wikis are based on Git repositories, you can clone them locally and edit
|
|
|
|
them like you would do with every other Git repository.
|
|
|
|
|
|
|
|
On the right sidebar, click on **Clone repository** and follow the on-screen
|
|
|
|
instructions.
|
2017-05-02 14:07:07 -04:00
|
|
|
|
2018-03-26 04:56:12 -04:00
|
|
|
## Customizing sidebar
|
|
|
|
|
2018-08-02 16:51:04 -04:00
|
|
|
On the project's Wiki page, there is a right side navigation that renders the full Wiki pages list by default, with hierarchy.
|
|
|
|
|
|
|
|
If the Wiki repository contains a `_sidebar` page, the file of this page replaces the default side navigation.
|
|
|
|
This custom file serves to render it's custom content, fully replacing the standard sidebar.
|
|
|
|
|
|
|
|
Support for displaying a generated TOC with a custom side navigation is planned.
|