--- description: 'Writing styles, markup, formatting, and other standards for GitLab Documentation.' --- # Documentation Style Guide This document defines the standards for GitLab's documentation content and files. For broader information about the documentation, see the [Documentation guidelines](index.md). For programmatic help adhering to the guidelines, see [linting](index.md#linting). See the GitLab handbook for further [writing style guidelines](https://about.gitlab.com/handbook/communication/#writing-style-guidelines) that apply to all GitLab content, not just documentation. ## Content These guidelines help toward the goal of having every user's search of documentation yield a useful result, and ensuring content is consistent, helpful, and easy to consume. ### Single source of truth (SSOT) on the GitLab product The documentation is the SSOT for all information related to the implementation, usage, and troubleshooting of GitLab products and features. It evolves continually, in keeping with new products and features, and with improvements for clarity, accuracy, and completeness. This policy prevents information silos, ensuring that it remains easy to find information about GitLab products. It also informs decisions about the kinds of content we include in our documentation. ### All helpful information Include problem-solving actions that may address rare cases or be considered 'risky', so long as proper context is provided in the form of fully detailed warnings and caveats. This kind of content should be included as it could be helpful to others and, when properly explained, its benefits outweigh the risks. If you think you have found an exception to this rule, contact the Technical Writing team. ### All helpful media types and sources Include any media types/sources if the content is relevant to readers. You can freely include or link presentations, diagrams, videos, etc.; no matter who it was originally composed for, if it is helpful to any of our audiences, we can include it. - If you use an image that has a separate source file (for example, a vector or diagram format), link the image to the source file so that it may be reused or updated by anyone. - Do not copy and paste content from other sources unless it is a limited quotation with the source cited. Typically it is better to either rephrase relevant information in your own words or link out to the other source. ### Markdown All GitLab documentation is written using [Markdown](https://en.wikipedia.org/wiki/Markdown). The [documentation website](https://docs.gitlab.com) uses GitLab Kramdown as its Markdown rendering engine. For a complete Kramdown reference, see the [GitLab Markdown Kramdown Guide](https://about.gitlab.com/handbook/product/technical-writing/markdown-guide/). The [`gitlab-kramdown`](https://gitlab.com/gitlab-org/gitlab_kramdown) Ruby gem will support all [GFM markup](../../user/markdown.md) in the future. That is, all markup that is supported for display in the GitLab application itself. For now, use regular Markdown markup, following the rules in the linked style guide. Note that Kramdown-specific markup (e.g., `{:.class}`) will not render properly on GitLab instances under [`/help`](index.md#gitlab-help). ## Structure ### Organize by topic, not by type Beyond top-level audience-type folders (e.g. `administration`), we organize content by topic, not by type, so that it can be located as easily as possible within the single-source-of-truth (SSOT) section for the subject matter. For example, do not create groupings of similar media types (e.g. glossaries, FAQs, or sets of all articles or videos). Such grouping of content by type makes it difficult to browse for the information you need and difficult to maintain up-to-date content. Instead, organize content by its subject (e.g. everything related to CI goes together) and cross-link between any related content. ### Folder structure overview The documentation is separated by top-level audience folders [`user`](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/user), [`administration`](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/administration), and [`development`](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/development) (contributing) folders. Beyond that, we primarily follow the structure of the GitLab user interface or API. Our goal is to have a clear hierarchical structure with meaningful URLs like `docs.gitlab.com/user/project/merge_requests/`. With this pattern, you can immediately tell that you are navigating to user-related documentation about Project features; specifically about Merge Requests. Our site's paths match those of our repository, so the clear structure also makes documentation easier to update. The table below shows what kind of documentation goes where. | Directory | What belongs here | |:----------------------|:---------------------------------------------------------------------------------------------------------------------------------| | `doc/user/` | User related documentation. Anything that can be done within the GitLab UI goes here, including usage of the `/admin` interface. | | `doc/administration/` | Documentation that requires the user to have access to the server where GitLab is installed. The admin settings that can be accessed via GitLab's interface exist under `doc/user/admin_area/`. | | `doc/api/` | API related documentation. | | `doc/development/` | Documentation related to the development of GitLab, whether contributing code or docs. Related process and style guides should go here. | | `doc/legal/` | Legal documents about contributing to GitLab. | | `doc/install/` | Contains instructions for installing GitLab. | | `doc/update/` | Contains instructions for updating GitLab. | | `doc/topics/` | Indexes per topic (`doc/topics/topic-name/index.md`): all resources for that topic. | ### Working with directories and files 1. When you create a new directory, always start with an `index.md` file. Do not use another file name and **do not** create `README.md` files. 1. **Do not** use special characters and spaces, or capital letters in file names, directory names, branch names, and anything that generates a path. 1. When creating a new document and it has more than one word in its name, make sure to use underscores instead of spaces or dashes (`-`). For example, a proper naming would be `import_projects_from_github.md`. The same rule applies to images. 1. For image files, do not exceed 100KB. 1. We do not yet support embedded videos. Please link out. 1. There are four main directories, `user`, `administration`, `api` and `development`. 1. The `doc/user/` directory has five main subdirectories: `project/`, `group/`, `profile/`, `dashboard/` and `admin_area/`. 1. `doc/user/project/` should contain all project related documentation. 1. `doc/user/group/` should contain all group related documentation. 1. `doc/user/profile/` should contain all profile related documentation. Every page you would navigate under `/profile` should have its own document, i.e. `account.md`, `applications.md`, `emails.md`, etc. 1. `doc/user/dashboard/` should contain all dashboard related documentation. 1. `doc/user/admin_area/` should contain all admin related documentation describing what can be achieved by accessing GitLab's admin interface (_not to be confused with `doc/administration` where server access is required_). 1. Every category under `/admin/application_settings` should have its own document located at `doc/user/admin_area/settings/`. For example, the **Visibility and Access Controls** category should have a document located at `doc/user/admin_area/settings/visibility_and_access_controls.md`. 1. The `doc/topics/` directory holds topic-related technical content. Create `doc/topics/topic-name/subtopic-name/index.md` when subtopics become necessary. General user- and admin- related documentation, should be placed accordingly. 1. The directories `/workflow/`, `/university/`, and `/articles/` have been **deprecated** and the majority their docs have been moved to their correct location in small iterations. If you are unsure where a document or a content addition should live, this should not stop you from authoring and contributing. You can use your best judgment and then ask the reviewer of your MR to confirm your decision, and/or ask a technical writer at any stage in the process. The techncial writing team will review all documentation changes, regardless, and can move content if there is a better place for it. ### Avoid duplication Do not include the same information in multiple places. Instead, choose one single-source-of-truth location and link from other relevant locations. ### References across documents - Give each folder an index.md page that introduces the topic, introduces the pages within, and links to the pages within (including to the index pages of any next-level subpaths). - To ensure discoverability, ensure each new or renamed doc is linked from its higher-level index page and other related pages. - When making reference to other GitLab products and features, link to their respective docs, at least on first mention. - When making reference to third-party products or technologies, link out to their external sites, documentation, and resources. ### Structure within documents - Include any and all applicable subsections as described on the [structure and template](structure.md) page. - Structure content in alphabetical order in tables, lists, etc., unless there is a logical reason not to (for example, when mirroring the UI or an otherwise ordered sequence). ## Language - Use inclusive language and avoid jargon, as well as uncommon words. The docs should be clear and easy to understand. - Write in the 3rd person (use "we", "you", "us", "one", instead of "I" or "me"). - Be clear, concise, and stick to the goal of the doc. - Write in US English. - Capitalize "G" and "L" in GitLab. - Use title case when referring to [features](https://about.gitlab.com/features/) or [products](https://about.gitlab.com/pricing/) (e.g., GitLab Runner, Geo, Issue Boards, GitLab Core, Git, Prometheus, Kubernetes, etc), and methods or methodologies (e.g., Continuous Integration, Continuous Deployment, Scrum, Agile, etc). Note that some features are also objects (e.g. "GitLab's Merge Requests support X." and "Create a new merge request for Z."). ## Text - Splitting long lines (preferably up to 100 characters) can make it easier to provide feedback on small chunks of text. - Insert an empty line for new paragraphs. - Use sentence case for titles, headings, labels, menu items, and buttons. - Insert an empty line between different markups (e.g., after every paragraph, header, list, etc). Example: ```md ## Header Paragraph. - List item 1 - List item 2 ``` ### Tables overlapping the TOC By default, all tables have a width of 100% on docs.gitlab.com. In a few cases, the table will overlap the table of contents (ToC). For these cases, add an entry to the document's frontmatter to render them displaying block. This will make sure the table is displayed behind the ToC, scrolling horizontally: ```md --- table_display_block: true --- ``` ## Emphasis - Use double asterisks (`**`) to mark a word or text in bold (`**bold**`). - Use underscore (`_`) for text in italics (`_italic_`). - Use greater than (`>`) for blockquotes. ## Punctuation Check the general punctuation rules for the GitLab documentation on the table below. Check specific punctuation rules for [list items](#list-items) below. | Rule | Example | | ---- | ------- | | Always end full sentences with a period. | _For a complete overview, read through this document._| | Always add a space after a period when beginning a new sentence | _For a complete overview, check this doc. For other references, check out this guide._ | | Do not use double spaces. | --- | | Do not use tabs for indentation. Use spaces instead. You can configure your code editor to output spaces instead of tabs when pressing the tab key. | --- | | Use serial commas ("Oxford commas") before the final 'and/or' in a list. | _You can create new issues, merge requests, and milestones._ | | Always add a space before and after dashes when using it in a sentence (for replacing a comma, for example). | _You should try this - or not._ | | Always use lowercase after a colon. | _Related Issues: a way to create a relationship between issues._ | ## List items - Always start list items with a capital letter. - Always leave a blank line before and after a list. - Begin a line with spaces (not tabs) to denote a subitem. - To nest subitems, indent them with two spaces. - To nest code blocks, indent them with four spaces. - Only use ordered lists when their items describe a sequence of steps to follow. **Markup:** - Use dashes (`-`) for unordered lists instead of asterisks (`*`). - Use the number one (`1`) for each item in an ordered list. When rendered, the list items will appear with sequential numbering. **Punctuation:** - Do not add commas (`,`) or semicolons (`;`) to the end of a list item. - Only add periods to the end of a list item if the item consists of a complete sentence. The [definition of full sentence](https://www2.le.ac.uk/offices/ld/resources/writing/grammar/grammar-guides/sentence) is: _"a complete sentence always contains a verb, expresses a complete idea, and makes sense standing alone"_. - Be consistent throughout the list: if the majority of the items do not end in a period, do not end any of the items in a period, even if they consist of a complete sentence. The opposite is also valid: if the majority of the items end with a period, end all with a period. - Separate list items from explanatory text with a colon (`:`). For example: ```md The list is as follows: - First item: this explains the first item. - Second item: this explains the second item. ``` **Examples:** Do: - First list item - Second list item - Third list item Don't: - First list item - Second list item - Third list item. Do: - Let's say this is a complete sentence. - Let's say this is also a complete sentence. - Not a complete sentence. Don't: - Let's say this is a complete sentence. - Let's say this is also a complete sentence. - Not a complete sentence ## Quotes Valid for markdown content only, not for frontmatter entries: - Standard quotes: double quotes (`"`). Example: "This is wrapped in double quotes". - Quote within a quote: double quotes (`"`) wrap single quotes (`'`). Example: "I am 'quoting' something within a quote". For other punctuation rules, please refer to the [GitLab UX guide](https://design.gitlab.com/content/punctuation/). ## Headings - Add **only one H1** in each document, by adding `#` at the beginning of it (when using markdown). The `h1` will be the document `
```
## Code blocks
- Always wrap code added to a sentence in inline code blocks (``` ` ```).
E.g., `.gitlab-ci.yml`, `git add .`, `CODEOWNERS`, `only: master`.
File names, commands, entries, and anything that refers to code should be added to code blocks.
To make things easier for the user, always add a full code block for things that can be
useful to copy and paste, as they can easily do it with the button on code blocks.
- For regular code blocks, always use a highlighting class corresponding to the
language for better readability. Examples:
````md
```ruby
Ruby code
```
```js
JavaScript code
```
```md
Markdown code
```
```text
Code for which no specific highlighting class is available.
```
````
- To display raw markdown instead of rendered markdown, use four backticks on their own lines around the
markdown to display. See [example](https://gitlab.com/gitlab-org/gitlab-ce/blob/8c1991b9bb7e3b8d606481fdea316d633cfa5eb7/doc/development/documentation/styleguide.md#L275-287).
- For a complete reference on code blocks, check the [Kramdown guide](https://about.gitlab.com/handbook/product/technical-writing/markdown-guide/#code-blocks).
## Alert boxes
Whenever you want to call the attention to a particular sentence,
use the following markup for highlighting.
_Note that the alert boxes only work for one paragraph only. Multiple paragraphs,
lists, headers, etc will not render correctly. For multiple lines, use blockquotes instead._
### Note
```md
NOTE: **Note:**
This is something to note.
```
How it renders in docs.gitlab.com:
NOTE: **Note:**
This is something to note.
### Tip
```md
TIP: **Tip:**
This is a tip.
```
How it renders in docs.gitlab.com:
TIP: **Tip:**
This is a tip.
### Caution
```md
CAUTION: **Caution:**
This is something to be cautious about.
```
How it renders in docs.gitlab.com:
CAUTION: **Caution:**
This is something to be cautious about.
### Danger
```md
DANGER: **Danger:**
This is a breaking change, a bug, or something very important to note.
```
How it renders in docs.gitlab.com:
DANGER: **Danger:**
This is a breaking change, a bug, or something very important to note.
## Blockquotes
For highlighting a text within a blue blockquote, use this format:
```md
> This is a blockquote.
```
which renders in docs.gitlab.com to:
> This is a blockquote.
If the text spans across multiple lines it's OK to split the line.
For multiple paragraphs, use the symbol `>` before every line:
```md
> This is the first paragraph.
>
> This is the second paragraph.
>
> - This is a list item
> - Second item in the list
>
> ### This is an `h3`
```
Which renders to:
> This is the first paragraph.
>
> This is the second paragraph.
>
> - This is a list item
> - Second item in the list
>
> ### This is an `h3`
>{:.no_toc}
## Terms
To maintain consistency through GitLab documentation, the following guides documentation authors
on agreed styles and usage of terms.
### Describing UI elements
The following are styles to follow when describing UI elements on a screen:
- For elements with a visible label, use that label in bold with matching case. For example, `the **Cancel** button`.
- For elements with a tooltip or hover label, use that label in bold with matching case. For example, `the **Add status emoji** button`.
### Verbs for UI elements
The following are recommended verbs for specific uses.
| Recommended | Used for | Alternatives |
|:------------|:---------------------------|:---------------------------|
| "click" | buttons, links, menu items | "hit", "press", "select" |
| "check" | checkboxes | "enable", "click", "press" |
| "select" | dropdowns | "pick" |
| "expand" | expandable sections | "open" |
### Other Verbs
| Recommended | Used for | Alternatives |
|:------------|:--------------------------------|:-------------------|
| "go" | making a browser go to location | "navigate", "open" |
## GitLab versions and tiers
- Every piece of documentation that comes with a new feature should declare the
GitLab version that feature got introduced. Right below the heading add a
blockquote:
```md
> Introduced in GitLab 8.3.
```
- Whenever possible, every feature should have a link to the issue, MR or epic
(in that order) that introduced it. The above quote would be then transformed to:
```md
> [Introduced](