doc/user/project/wiki/_index.md
{{< details >}}
{{< /details >}}
Wiki provides project and group documentation in a familiar format. Wiki pages:
Each wiki is a separate Git repository. You can create and edit wiki pages through the GitLab web interface or locally using Git. Wiki pages written in Markdown support all Markdown features and provide wiki-specific behavior for links.
Wiki pages display a sidebar, which you can customize.
To access a project wiki:
If Plan > Wiki is not listed in the left sidebar of your project, a project administrator has disabled it.
Your wiki repository inherits the default branch name
from your instance or group. If no custom branch name is configured, GitLab uses main.
To rename your wiki's default branch, update the default branch name in your repository.
{{< history >}}
wiki_front_matter and wiki_front_matter_title. Enabled by default.wiki_front_matter and wiki_front_matter_title removed in GitLab 17.3.{{< /history >}}
When a wiki is created, it is empty. On your first visit, you can create the home page users see when viewing the wiki. This page requires a specific path to be used as your wiki's home page. To create it:
home. The page on this
path serves as the front page for your wiki.{{< history >}}
wiki_front_matter and wiki_front_matter_title. Enabled by default.wiki_front_matter and wiki_front_matter_title removed in GitLab 17.3.
+- Create a wiki page from the top bar introduced in GitLab 18.10.{{< /history >}}
Prerequisites:
To create a new wiki page from a project or group:
Alternatively:
After opening the new page form, complete the following steps:
{{< history >}}
{{< /history >}}
You can create a new wiki page from a template if you have at least one template in your project.
Prerequisites:
{{< tabs >}}
{{< tab title="From template list" >}}
{{< /tab >}}
{{< tab title="From template page" >}}
{{< /tab >}}
{{< tab title="From new page form" >}}
{{< /tab >}}
{{< /tabs >}}
Wikis are based on Git repositories, so you can clone them locally and edit them like you would do with every other Git repository. To clone a wiki repository locally:
Files you add to your wiki locally must use one of the following supported extensions, depending on the markup language you wish to use. Files with unsupported extensions don't display when pushed to GitLab:
.mdown, .mkd, .mkdn, .md, .markdown..adoc, .ad, .asciidoc..textile, .rdoc, .org, .creole, .wiki, .mediawiki, .rst.{{< history >}}
wiki_front_matter and wiki_front_matter_title. Disabled by default.wiki_front_matter and wiki_front_matter_title enabled by default in GitLab 17.2.wiki_front_matter and wiki_front_matter_title removed in GitLab 17.3.{{< /history >}}
Wiki pages are stored as files in a Git repository, and by default, the filename of a page is also its title. Certain characters in the filename have a special meaning:
-) are converted back into spaces when displaying a page./) are used as path separators, and can't be displayed in titles. If you
create a file with title containing / characters, GitLab creates all the subdirectories
needed to build that path. For example, a title of docs/my-page creates a wiki
page with a path /wikis/docs/my-page.To circumvent these limitations, you can also store the title of a wiki page in a front matter block before a page's contents. For example:
---
title: Page title
---
Many common file systems have a limit of 255 bytes for file and directory names. Git and GitLab both support paths exceeding those limits. However, if your file system enforces these limits, you cannot check out a local copy of a wiki that contains filenames exceeding this limit. To prevent this problem, the GitLab web interface and API enforce these limits:
Non-ASCII characters take up more than one byte.
While you can still create files locally that exceed these limits, your teammates may not be able to check out the wiki locally afterward.
{{< history >}}
{{< /history >}}
Prerequisites:
When you preview a page and scroll, a sticky bar at the top of the page keeps the Edit button and other actions accessible.
Unsaved changes to a wiki page are preserved in local browser storage to prevent accidental data loss.
{{< history >}}
{{< /history >}}
Wiki pages with headings in their contents automatically display a table of contents section in the sidebar.
You can also choose to optionally display a separate table of contents section on the page
itself. To generate a table of contents from a wiki page's subheadings, use the
[[_TOC_]] tag. For an example, see table of contents.
Prerequisites:
{{< history >}}
wiki_redirection. Enabled by default.wiki_front_matter and wiki_front_matter_title. Enabled by default.wiki_redirection, wiki_front_matter and wiki_front_matter_title removed in GitLab 17.3.{{< /history >}}
In GitLab 17.1 and later, when you move or rename a page, a redirect is
automatically set up from the old page to the new page. A list of redirects
is stored in the .gitlab/redirects.yml file in the Wiki repository.
Prerequisites:
About under Company and you want to
move it to the wiki's root, change the Path from About to /About.{{< history >}}
print_wiki. Disabled by default.print_wiki removed in GitLab 16.6.{{< /history >}}
You can export a wiki page as a PDF file:
A PDF of the wiki page is created.
With the diagrams.net integration, you can create and embed SVG diagrams on wiki pages! The diagram editor is available in both the plain text editor and the rich text editor.
On GitLab.com, this integration is enabled for all users and does not require any additional configuration.
On GitLab Self-Managed, you can integrate with the free diagrams.net website or host your own diagrams.net site in offline environments.
To set up the integration, you must:
After completing the integration, the diagrams.net editor opens with the URL you provided.
{{< history >}}
{{< /history >}}
You can create templates to use when creating new pages, or to apply
to existing pages. Templates are wiki pages that are stored in the templates/
directory in the wiki repository.
Prerequisites:
Templates of a particular format can only be applied to pages of the same format. For example, Markdown templates only apply to Markdown pages.
When you are creating or editing a wiki page, you can apply a template.
Prerequisites:
{{< history >}}
{{< /history >}}
You can restore a wiki page template to any previous version from its history. This creates a new version with the restored content while preserving the full version history.
Prerequisites:
To restore a wiki page template to a previous version:
The page template is restored to the selected version. All previous versions remain in the page history.
You can also restore wiki pages using the same process.
The wiki page subscriptions feature allows you to receive notifications when changes are made to wiki pages you're interested in. This feature can enhance collaboration by keeping team members informed about updates to important documentation.
You can subscribe to specific wiki pages to receive notifications when someone:
When you change your subscription status, GitLab shows a confirmation message:
Notifications turned onNotifications turned offAny user with access to view a wiki page can subscribe to it. Your subscription status is personal and doesn't affect other users.
Notifications follow your project notification settings. They are delivered through your configured notification channels.
The changes of a wiki page over time are recorded in the wiki's Git repository. The history page shows:
To view the changes for a wiki page:
You can see the changes made in a version of a wiki page, similar to versioned diff file views:
{{< history >}}
{{< /history >}}
You can restore a wiki page to any previous version from its history. This creates a new version with the restored content while preserving the full version history.
Prerequisites:
To restore a wiki page to a previous version:
The page is restored to the selected version. All previous versions remain in the page history.
You can also restore wiki page templates using the same process.
{{< history >}}
wiki_floating_sidebar_toggle. Disabled by default.wiki_floating_sidebar_toggle removed.{{< /history >}}
Wiki pages display a sidebar that contains a list of pages in the wiki, displayed as a nested tree, with sibling pages listed in alphabetical order.
You can find a page by its title in the wiki using the search box in the sidebar. You can toggle the sidebar open or closed using the sidebar toggle ({{< icon name="sidebar" >}}) located in the upper-left corner of the page.
For performance reasons, the sidebar is limited to displaying 5000 entries. To view a list of all pages, select View All Pages in the sidebar.
You can manually edit the contents of the sidebar navigation.
Prerequisites:
This process creates a wiki page named _sidebar which fully
replaces the default sidebar navigation:
A _sidebar example, formatted with Markdown:
### Home
- [Hello World](hello)
- [Foo](foo)
- [Bar](bar)
---
- [Sidebar](_sidebar)
Wikis are enabled by default in GitLab. Project administrators can enable or disable a project wiki by following the instructions in sharing and permissions.
Administrators for GitLab Self-Managed can configure additional wiki settings.
You can disable group wikis from the group settings
To add a link to an external wiki from a project's left sidebar:
You can now see the External wiki option from your project's left sidebar.
When you enable this integration, the link to the external wiki doesn't replace the link to the internal wiki. To hide the internal wiki from the sidebar, disable the project's wiki.
To hide the link to an external wiki:
To disable a project's internal wiki:
The internal wiki is now disabled, and users and project members:
Previously added wiki pages are preserved in case you want to re-enable the wiki. To re-enable it, repeat the process to disable the wiki but toggle it on (in blue).
{{< history >}}
{{< /history >}}
GitLab provides a rich text editing experience for GitLab Flavored Markdown in wikis.
Support includes:
To switch back to plain text, select Switch to plain text editing.
See also:
Supporting all GitLab Flavored Markdown content types in the rich text editor is a work in progress. For the status of the ongoing development for CommonMark and GitLab Flavored Markdown support, read:
GitLab tracks wiki creation, deletion, and update events. These events are displayed on the following pages:
Commits to wikis are not counted in repository analytics.
Page slugs are encoded using the
ERB::Util.url_encode method.
If you use an Apache reverse proxy, you can add a nocanon argument to the ProxyPass
line of your Apache configuration to ensure your page slugs render correctly.
{{< details >}}
{{< /details >}}
[!warning] This operation deletes all data in the wiki.
Any command that changes data directly could be damaging if not run correctly, or under the right conditions. We highly recommend running them in a test environment with a backup of the instance ready to be restored, just in case.
To clear all data from a project wiki and recreate it in a blank state:
Start a Rails console session.
Run these commands:
# Enter your project's path
p = Project.find_by_full_path('<username-or-group>/<project-name>')
# This command deletes the wiki project from the filesystem.
p.wiki.repository.remove
# Refresh the wiki repository state.
p.wiki.repository.expire_exists_cache
All data from the wiki has been cleared, and the wiki is ready for use.