--- 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. ## Documentation is the single source of truth (SSOT) ### Why a single source of truth 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. The documentation is a continually evolving SSOT for all information related to the implementation, usage, and troubleshooting of GitLab products and features. ### All 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. We will add all troubleshooting information to the documentation, no matter how unlikely a user is to encounter a situation. For the Troubleshooting sections, people in GitLab Support can merge additions themselves. ### All media types 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. ### No special types In the software industry, it is a best practice to organize documentation in different types. For example, [Divio recommends](https://www.divio.com/blog/documentation/): 1. Tutorials 1. How-to guides 1. Explanation 1. Reference (for example, a glossary) At GitLab, we have so many product changes in our monthly releases that we can't afford to continually update multiple types of information. If we have multiple types, the information will become outdated. Therefore, we have a [single template](structure.md) for documentation. We currently do not distinguish specific document types, although we are open to reconsidering this policy once the documentation has reached a future stage of maturity and quality. If you are reading this, then despite our continual improvement efforts, that point hasn't been reached. ### Link instead of summarize There is a temptation to summarize the information on another page. This will cause the information to live in two places. Instead, link to the SSOT and explain why it is important to consume the information. ### 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. ### Docs-first methodology We employ a **docs-first methodology** to help ensure that the docs remain a complete and trusted resource, and to make communicating about the use of GitLab more efficient. - If the answer to a question exists in documentation, share the link to the docs instead of rephrasing the information. - When you encounter new information not available in GitLab’s documentation (for example, when working on a support case or testing a feature), your first step should be to create a merge request to add this information to the docs. You can then share the MR in order to communicate this information. New information that would be useful toward the future usage or troubleshooting of GitLab should not be written directly in a forum or other messaging system, but added to a docs MR and then referenced, as described above. Note that among any other doc changes, you can always add a Troubleshooting section to a doc if none exists, or un-comment and use the placeholder Troubleshooting section included as part of our [doc template](structure.md#template-for-new-docs), if present. The more we reflexively add useful information to the docs, the more (and more successfully) the docs will be used to efficiently accomplish tasks and solve problems. If you have questions when considering, authoring, or editing docs, ask the Technical Writing team on Slack in `#docs` or in GitLab by mentioning the writer for the applicable [DevOps stage](https://about.gitlab.com/handbook/product/categories/#devops-stages). Otherwise, forge ahead with your best effort. It does not need to be perfect; the team is happy to review and improve upon your content. Please review the [Documentation guidelines](index.md) before you begin your first documentation MR. Having a knowledge base is any form that is separate from the documentation would be against the docs-first methodology because the content would overlap with the documentation. ## 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). Hard-coded HTML is valid, although it's discouraged to be used while we have `/help`. HTML is permitted as long as: - There's no equivalent markup in markdown. - Advanced tables are necessary. - Special styling is required. - Reviewed and approved by a technical writer. ### Markdown Rules GitLab ensures that the Markdown used across all documentation is consistent, as well as easy to review and maintain, by [testing documentation changes](index.md#testing) with [`markdownlint`](index.md#markdownlint). This lint test fails when any document has an issue with Markdown formatting that may cause the page to render incorrectly within GitLab. It will also fail when a document is using non-standard Markdown (which may render correctly, but is not the current standard for GitLab documentation). ## Structure ### Organize by topic, not by type Because we want documentation to be a SSOT, we should [organize by topic, not by type](#organize-by-topic-not-by-type). ### 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. Do not upload video files to the product repositories. [Link or embed videos](#videos) instead. 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 technical 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. [Link to a SSOT instead.](#link-instead-of-summarize) ### 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 - [Write in markdown](#markdown). - 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, unless they are parameters or commands that are in backticks, or similar. - Always leave a blank line before and after a list. - Begin a line with spaces (not tabs) to denote a [nested subitem](#nesting-inside-a-list-item). - Only use ordered lists when their items describe a sequence of steps to follow: Do: These are the steps to do something: 1. First, do step 1 1. Then, do step 2 1. Finally, do step 3 Don't: This is a list of different features: 1. Feature 1 1. Feature 2 1. Feature 3 **Markup:** - Use dashes (`-`) for unordered lists instead of asterisks (`*`). - Prefix `1.` to each item in an ordered list. When rendered, the list items will appear with sequential numbering automatically. **Punctuation:** - Do not add commas (`,`) or semicolons (`;`) to the end of list items. - 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 (third item should have a `.` to match the first and second items): - Let's say this is a complete sentence. - Let's say this is also a complete sentence. - Not a complete sentence ### Nesting inside a list item It is possible to nest items under a list item, so that they render with the same indentation as the list item. This can be done with: - [Code blocks](#code-blocks) - [Blockquotes](#blockquotes) - [Alert boxes](#alert-boxes) - [Images](#images) Items nested in lists should always align with the first character of the list item. In unordered lists (using `-`), this means two spaces for each level of indentation: ~~~md - Unordered list item 1 A line nested using 2 spaces to align with the `U` above. - Unordered list item 2 > A quote block that will nest > inside list item 2. - Unordered list item 3 ```text a codeblock that will next inside list item 3 ``` - Unordered list item 4 ![an image that will nest inside list item 4](image.png) ~~~ For ordered lists, use three spaces for each level of indentation: ~~~md 1. Ordered list item 1 A line nested using 3 spaces to align with the `O` above. 1. Ordered list item 2 > A quote block that will nest > inside list item 2. 1. Ordered list item 3 ```text a codeblock that will next inside list item 3 ``` 1. Ordered list item 4 ![an image that will nest inside list item 4](image.png) ~~~ You can nest full lists inside other lists using the same rules as above. If you wish to mix types, that is also possible, as long as you don't mix items at the same level: ``` 1. Ordered list item one. 1. Ordered list item two. - Nested unordered list item one. - Nested unordered list item two. 1. Ordered list item three. - Unordered list item one. - Unordered list item two. 1. Nested ordered list item one. 1. Nested ordered list item two. - Unordered list item three. ``` ## 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 `