2020-10-24 23:57:45 +05:30
---
stage: Create
2021-03-11 19:13:27 +05:30
group: Editor
2021-02-22 17:27:13 +05:30
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments"
2020-10-24 23:57:45 +05:30
type: reference, how-to
---
2021-03-11 19:13:27 +05:30
# Wiki **(FREE)**
2017-08-17 22:00:37 +05:30
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.
2018-03-17 18:26:18 +05:30
Wikis are very convenient if you don't want to keep your documentation in your
2017-08-17 22:00:37 +05:30
repository, but you do want to keep it in the same project where your code
resides.
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.
2021-01-03 14:25:43 +05:30
[Introduced ](https://gitlab.com/gitlab-org/gitlab/-/issues/13195 ) in [GitLab Premium ](https://about.gitlab.com/pricing/ ) 13.5,
**group wikis** became available. Their usage is similar to project wikis, with a few [limitations ](../../group/index.md#group-wikis ).
2017-08-17 22:00:37 +05:30
## First time creating the Home page
2021-04-17 20:07:23 +05:30
The first time you visit a Wiki, you are directed to create the Home page.
The Home page is necessary to be created because it serves as the landing page
when viewing a Wiki. Complete the **Content** section, and then select
2017-08-17 22:00:37 +05:30
**Create page**. You can always edit it later, so go ahead and write a welcome
message.
![New home page ](img/wiki_create_home_page.png )
## Creating a new wiki page
2021-02-22 17:27:13 +05:30
NOTE:
2019-07-07 11:18:12 +05:30
Requires Developer [permissions ](../../permissions.md ).
2021-04-17 20:07:23 +05:30
Create a new page by selecting the **New page** button that can be found
2019-12-04 20:38:33 +05:30
in all wiki pages.
2017-08-17 22:00:37 +05:30
2021-04-17 20:07:23 +05:30
Enter a title for your new wiki page.
2019-12-04 20:38:33 +05:30
You can specify a full path for the wiki page by using '/' in the
2021-04-17 20:07:23 +05:30
title to indicate subdirectories. Any missing directories are created
automatically. For example, a title of `docs/my-page` creates a wiki
2019-12-04 20:38:33 +05:30
page with a path `/wikis/docs/my-page` .
2017-08-17 22:00:37 +05:30
2021-04-17 20:07:23 +05:30
After you enter the page name, it's time to fill in its content. GitLab wikis
2020-04-08 14:13:33 +05:30
support Markdown, RDoc, AsciiDoc, and Org. For Markdown based pages, all the
2017-08-17 22:00:37 +05:30
[Markdown features ](../../markdown.md ) are supported and for links there is
some [wiki specific ](../../markdown.md#wiki-specific-markdown ) behavior.
In the web interface the commit message is optional, but the GitLab Wiki is
2021-04-17 20:07:23 +05:30
based on Git and needs a commit message, so one is created for you if you
don't enter one.
2017-08-17 22:00:37 +05:30
2021-04-17 20:07:23 +05:30
When you're ready, select **Create page** and the new page is created.
2017-08-17 22:00:37 +05:30
![New page ](img/wiki_create_new_page.png )
2020-03-13 15:44:24 +05:30
### Attachment storage
2021-04-17 20:07:23 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/33475) in GitLab 11.3.
2018-11-20 20:47:30 +05:30
2021-04-17 20:07:23 +05:30
Any file uploaded to the wiki with the GitLab
interface is stored in the wiki Git repository, and is available
2018-11-20 20:47:30 +05:30
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
2021-04-17 20:07:23 +05:30
repository, you must upload them again.
2018-11-20 20:47:30 +05:30
2020-04-08 14:13:33 +05:30
### Special characters in page titles
Wiki pages are stored as files in a Git repository, so certain characters have a special meaning:
- Spaces are converted into hyphens when storing a page.
- Hyphens (`-`) are converted back into spaces when displaying a page.
- Slashes (`/`) can't be used, because they're used as path separator.
2020-03-13 15:44:24 +05:30
### Length restrictions for file and directory names
2021-04-17 20:07:23 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24364) in GitLab 12.8.
2020-03-13 15:44:24 +05:30
Many common file systems have a [limit of 255 bytes for file and directory names ](https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits ), and while Git and GitLab both support paths exceeding those limits, the presence of them makes it impossible for users on those file systems to checkout a wiki repository locally.
To avoid this situation, these limits are enforced when editing pages through the GitLab web interface and API:
- 245 bytes for page titles (reserving 10 bytes for the file extension).
- 255 bytes for directory names.
Please note that:
- Non-ASCII characters take up more than one byte.
- It's still possible to create files and directories exceeding those limits locally through Git, but this might break on other people's machines.
2017-08-17 22:00:37 +05:30
## Editing a wiki page
2021-01-29 00:20:46 +05:30
You need Developer [permissions ](../../permissions.md ) or higher to edit a wiki page.
To do so:
2019-07-07 11:18:12 +05:30
2021-04-17 20:07:23 +05:30
1. Select the edit icon (**{pencil}**).
2021-01-29 00:20:46 +05:30
1. Edit the content.
2021-04-17 20:07:23 +05:30
1. Select **Save changes** .
2017-08-17 22:00:37 +05:30
2020-04-22 19:07:51 +05:30
### Adding a table of contents
To generate a table of contents from the headings in a Wiki page, use the `[[_TOC_]]` tag.
For an example, see [Table of contents ](../../markdown.md#table-of-contents ).
2017-08-17 22:00:37 +05:30
## Deleting a wiki page
2021-01-29 00:20:46 +05:30
You need Maintainer [permissions ](../../permissions.md ) or higher to delete a wiki page.
To do so:
2019-07-07 11:18:12 +05:30
2021-01-29 00:20:46 +05:30
1. Open the page you want to delete.
2021-04-17 20:07:23 +05:30
1. Select **Delete page** .
2021-01-29 00:20:46 +05:30
1. Confirm the deletion.
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
## Moving a wiki page
2021-01-29 00:20:46 +05:30
You need Developer [permissions ](../../permissions.md ) or higher to move a wiki page.
To do so:
2021-04-17 20:07:23 +05:30
1. Select the edit icon (**{pencil}**).
2021-01-29 00:20:46 +05:30
1. Add the new path to the **Title** field.
2021-04-17 20:07:23 +05:30
1. Select **Save changes** .
2021-01-29 00:20:46 +05:30
For example, if you have a wiki page called `about` under `company` and you want to
move it to the wiki's root:
2018-03-17 18:26:18 +05:30
2021-04-17 20:07:23 +05:30
1. Select the edit icon (**{pencil}**).
2021-01-29 00:20:46 +05:30
1. Change the **Title** from `about` to `/about` .
2021-04-17 20:07:23 +05:30
1. Select **Save changes** .
2018-03-17 18:26:18 +05:30
2021-01-29 00:20:46 +05:30
If you want to do the opposite:
2018-03-17 18:26:18 +05:30
2021-04-17 20:07:23 +05:30
1. Select the edit icon (**{pencil}**).
2021-01-29 00:20:46 +05:30
1. Change the **Title** from `about` to `company/about` .
2021-04-17 20:07:23 +05:30
1. Select **Save changes** .
2018-03-17 18:26:18 +05:30
2017-08-17 22:00:37 +05:30
## Viewing a list of all created wiki pages
2021-01-03 14:25:43 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/17673/) in GitLab 13.5, wiki pages are displayed as a nested tree in the sidebar and pages overview.
2017-08-17 22:00:37 +05:30
Every wiki has a sidebar from which a short list of the created pages can be
found. The list is ordered alphabetically.
2021-01-03 14:25:43 +05:30
![Wiki sidebar ](img/wiki_sidebar_v13_5.png )
2017-08-17 22:00:37 +05:30
2021-04-17 20:07:23 +05:30
If you have many pages, not all are listed in the sidebar. Select
2020-05-24 23:13:21 +05:30
**View All Pages** to see all of them.
2017-08-17 22:00:37 +05:30
## Viewing the history of a wiki page
The changes of a wiki page over time are recorded in the wiki's Git repository,
2021-04-17 20:07:23 +05:30
and you can view them by selecting **Page history** .
2017-08-17 22:00:37 +05:30
From the history page you can see the revision of the page (Git commit SHA), its
2020-07-28 23:09:34 +05:30
author, the commit message, and when it was last updated.
2021-04-17 20:07:23 +05:30
To see how a previous version of the page looked like, select a revision
2020-07-28 23:09:34 +05:30
number in the **Page version** column.
2017-08-17 22:00:37 +05:30
![Wiki page history ](img/wiki_page_history.png )
2020-07-28 23:09:34 +05:30
### Viewing the changes between page versions
2021-04-17 20:07:23 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15242) in GitLab 13.2.
2020-07-28 23:09:34 +05:30
Similar to versioned diff file views, you can see the changes made in a given Wiki page version:
1. Navigate to the Wiki page you're interested in.
2021-04-17 20:07:23 +05:30
1. Select **Page history** to see all page versions.
1. Select the commit message in the **Changes** column for the version you're interested in.
2020-07-28 23:09:34 +05:30
![Wiki page changes ](img/wiki_page_diffs_v13_2.png )
2020-04-22 19:07:51 +05:30
## Wiki activity records
2020-07-28 23:09:34 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14902) in **GitLab 12.10.**
2021-04-17 20:07:23 +05:30
> - Git events were [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/216014) in **GitLab 13.0.**
2021-01-03 14:25:43 +05:30
> - [Feature flag for Git events was removed](https://gitlab.com/gitlab-org/gitlab/-/issues/258665) in **GitLab 13.5**
2020-04-22 19:07:51 +05:30
Wiki events (creation, deletion, and updates) are tracked by GitLab and
2021-04-17 20:07:23 +05:30
displayed on the [user profile ](../../profile/index.md#access-your-user-profile ),
2020-04-22 19:07:51 +05:30
[group ](../../group/index.md#view-group-activity ),
2021-03-11 19:13:27 +05:30
and [project ](../working_with_projects.md#project-activity ) activity pages.
2020-04-22 19:07:51 +05:30
2017-08-17 22:00:37 +05:30
## Adding and editing wiki pages locally
Since wikis are based on Git repositories, you can clone them locally and edit
them like you would do with every other Git repository.
2021-04-17 20:07:23 +05:30
In the right sidebar, select **Clone repository** and follow the on-screen
2017-08-17 22:00:37 +05:30
instructions.
2020-06-23 00:09:42 +05:30
Files that you add to your wiki locally must have one of the following
supported extensions, depending on the markup language you wish to use,
2021-04-17 20:07:23 +05:30
otherwise they don't display when pushed to GitLab:
2020-06-23 00:09:42 +05:30
- Markdown extensions: `.mdown` , `.mkd` , `.mkdn` , `.md` , `.markdown` .
- AsciiDoc extensions: `.adoc` , `.ad` , `.asciidoc` .
- Other markup extensions: `.textile` , `.rdoc` , `.org` , `.creole` , `.wiki` , `.mediawiki` , `.rst` .
2018-11-18 11:00:15 +05:30
## Customizing sidebar
2021-04-17 20:07:23 +05:30
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/23109) in GitLab 13.8, the sidebar can be customized by selecting the **Edit sidebar** button.
2019-09-04 21:01:54 +05:30
2021-03-08 18:12:59 +05:30
To customize the Wiki's navigation sidebar, you need Developer permissions to the project.
2020-05-24 23:13:21 +05:30
2021-04-17 20:07:23 +05:30
In the top-right, select **Edit sidebar** and make your changes. This creates a wiki page named `_sidebar` which fully replaces the default sidebar navigation.
2020-05-24 23:13:21 +05:30
Example for `_sidebar` (using Markdown format):
```markdown
### [Home](home)
- [Hello World ](hello )
- [Foo ](foo )
- [Bar ](bar )
---
- [Sidebar ](_sidebar )
```
2019-09-04 21:01:54 +05:30
2021-02-22 17:27:13 +05:30
Support for displaying a generated table of contents with a custom side navigation is planned.