Commit e1ec396e authored by Craig Norris's avatar Craig Norris

Merge branch 'selhorn-template-edits' into 'master'

Docs: Updated template guidelines

See merge request gitlab-org/gitlab!41839
parents b936b2d5 ab75c214
...@@ -4,42 +4,40 @@ description: What to include in GitLab documentation pages. ...@@ -4,42 +4,40 @@ description: What to include in GitLab documentation pages.
# Documentation structure and template # Documentation structure and template
This document will help you determine how to structure a page within GitLab's Use these standards to contribute content to the GitLab documentation.
documentation and what content to include. These standards help ensure consistency
and completeness throughout the documentation, and they make it easier to contribute.
Before getting started, familiarize yourself with [GitLab's Documentation guidelines](index.md) Before getting started, familiarize yourself with [GitLab's Documentation guidelines](index.md)
and the section on Content in the [Style Guide](styleguide.md). and the [Documentation Style Guide](styleguide.md).
## Components of a documentation page ## Components of a documentation page
Most pages will be dedicated to a specific GitLab feature or to a use case that involves Most pages are dedicated to a specific GitLab feature or to a use case that
one or more features, potentially in conjunction with third-party tools. involves one or more features, potentially in conjunction with third-party tools.
Every feature or use case document should include the following content in the following sequence, In general, each topic should include the following content, in this sequence:
with exceptions and details noted below and in the template included on this page.
- *Metadata*: Information about the stage, group, and how to find the technical
- **Title**: Top-level heading with the feature name, or a use case name, which would start with writer for the topic. This information isn't visible in the published help.
a verb, like "Configure", "Enable", and so on. - *Title*: A top-level heading with the feature or use case name. Choose a term
- **Introduction**: A couple sentences about the subject matter and what's to be found that defines the functionality and use the same term in all the resources
on this page. Describe what the feature or topic is, what it does, and in what context it should where the feature is mentioned.
be used. There is no need to add a title called "Introduction" or "Overview," because people rarely - *Introduction*: In a few sentences beneath the title, describe what the
search for these terms. Just put this information after the title. feature or topic is, what it does, and in what context it should be used.
- **Use cases**: describes real use case scenarios for that feature/configuration. - *Use cases*: Describe real user scenarios.
- **Requirements**: describes what software, configuration, account, or knowledge is required. - *Prerequisites*: Describe the software, configuration, account, permissions,
- **Instructions**: one or more sets of detailed instructions to follow. or knowledge required to use this functionality.
- **Troubleshooting** guide (recommended but not required). - *Tasks*: Present detailed step-by-step instructions on how to use the feature.
- *Troubleshooting*: List errors and how to address them. Recommended but not
For additional details on each, see the [template for new docs](#template-for-new-docs), required.
below.
You can include additional subsections, as appropriate, such as *How it Works*,
Note that you can include additional subsections, as appropriate, such as 'How it Works', 'Architecture', or *Architecture*. You can also include other logical divisions, such as
and other logical divisions such as pre-deployment and post-deployment steps. pre-deployment and post-deployment tasks.
## Template for new docs ## Template for new docs
To start a new document, respect the file tree and file name guidelines, Follow the [folder structure and file name guidelines](styleguide.md#folder-structure-overview)
as well as the style guidelines. Use the following template: and create a new topic by using this template:
```markdown ```markdown
<!--Follow the Style Guide when working on this document. <!--Follow the Style Guide when working on this document.
...@@ -47,94 +45,87 @@ https://docs.gitlab.com/ee/development/documentation/styleguide.html ...@@ -47,94 +45,87 @@ https://docs.gitlab.com/ee/development/documentation/styleguide.html
When done, remove all of this commented-out text, except a commented-out When done, remove all of this commented-out text, except a commented-out
Troubleshooting section, which, if empty, can be left in place to encourage future use.--> Troubleshooting section, which, if empty, can be left in place to encourage future use.-->
--- ---
description: "Short document description." # Up to ~200 chars long. They will be displayed description: "Short document description." # Up to ~200 chars long. This information is displayed
in Google Search snippets. It may help to write the page intro first, and then reuse it here. in Google Search snippets. It may help to write the page intro first, and then reuse it here.
stage: "Add the stage name here, and remove the quotation marks" stage: Add the stage name here
group: "Add the group name here, and remove the quotation marks" group: Add the group name here
info: To determine the technical writer assigned to the Stage/Group associated with this page, 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/#designated-technical-writers see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
--- ---
# Feature Name or Use Case Name **[TIER]** (1) # Feature or Use Case Name **[TIER]** (1)
<!--If writing about a use case, drop the tier, and start with a verb, <!--If you are writing about a use case, start with a verb,
for example, "Configure", "Implement", + the goal/scenario--> for example, "Configure", "Implement", + the goal/scenario-->
<!--For pages on newly-introduced features, add the following line. <!--For pages on newly-introduced features, add the following line.
If only some aspects of the feature have been introduced, specify which parts of the feature.--> If only some aspects of the feature have been introduced, specify which parts of the feature.-->
> [Introduced](link_to_issue_or_mr) in GitLab (Tier) X.Y (2). > [Introduced](link_to_issue_or_mr) in GitLab (Tier) X.Y (2).
An introduction -- without its own additional header -- goes here. Write a description of the feature or use case. This introduction should answer
Offer a description of the feature or use case, and what to expect on this page. these questions:
(You can reuse this content, or part of it, for the front matter's `description` at the top
of this file).
The introduction should answer the following questions:
- What is this feature or use case? - What is this feature or use case?
- Who is it for? - Who is it for?
- What is the context in which it is used and are there any prerequisites/requirements? - What is the context in which it is used and are there any prerequisites or
- What can the audience do with this? (Be sure to consider all applicable audiences, like requirements?
GitLab admin and developer-user.) - What can the audience do with this? (Be sure to consider all applicable
- What are the benefits to using this over any alternatives? audiences, such as GitLab admin and developer-user.)
- What are the benefits of using this over any existing alternatives?
You can reuse this content, or part of it, for the front matter's `description`
at the top of this file.
## Use cases ## Use cases
Describe some use cases, typically in bulleted form. Include real-life examples for each. Describe common use cases, typically in bulleted form. Include real-life examples
for each.
If the page itself is dedicated to a use case, this section can usually include more specific If the page itself is dedicated to a use case, this section usually includes more
scenarios for use (for example, variations on the main use case), but if that's not applicable, specific scenarios for use (for example, variations on the main use case), but if
the section can be omitted. that's not applicable, you can omit this section.
Examples of use cases on feature pages: Examples of use cases on feature pages:
- CE and EE: [Issues](../../user/project/issues/index.md#use-cases) - CE and EE: [Issues](../../user/project/issues/index.md#use-cases)
- CE and EE: [Merge Requests](../../user/project/merge_requests/index.md) - CE and EE: [Merge Requests](../../user/project/merge_requests/index.md)
- EE-only: [Geo](../../administration/geo/replication/index.md) - EE-only: [Geo](../../administration/geo/replication/index.md)
- EE-only: [Jenkins integration](../../integration/jenkins.md) - EE-only: [Jenkins integration](../../integration/jenkins.md)
## Requirements ## Prerequisites
State any requirements for using the feature and/or following along with the instructions. State any prerequisites for using the feature. These might include:
These can include both: - Technical prereqs (for example, an account on a third-party service, an amount
- technical requirements (for example, an account on a third party service, an amount of storage space, of storage space, or prior configuration of another feature)
prior configuration of another feature) - Prerequisite knowledge (for example, familiarity with certain GitLab features
- prerequisite knowledge (for example, familiarity with certain GitLab features, cloud technologies) or other products and technologies).
Link each one to an appropriate place for more information. Link each one to an appropriate place for more information.
## Instructions ## Tasks
This is the part of the document where you can include one or more sets of instructions.
Each topic should help users accomplish a specific task. Each topic should help users accomplish a specific task.
Headers should describe the task the reader will achieve by following the instructions within, The heading should:
typically starting with a verb. For example, `Create a package` or `Configure a pipeline`.
- Describe the task and start with a verb. For example, `Create a package` or
`Configure a pipeline`.
- Be short and descriptive (up to ~50 chars).
- Start from an `h2` (`##`), then go over `h3`, `h4`, `h5`, and `h6` as needed.
Never skip a hierarchy level (like `h2` > `h4`). It breaks the table of
contents and can affect the breadcrumbs.
Larger instruction sets may have subsections covering specific phases of the process. Bigger tasks can have subsections that explain specific phases of the process.
Where appropriate, provide examples of code or configuration files to better clarify
intended usage.
- Write a step-by-step guide, with no gaps between the steps. Include example code or configurations when needed. Use Markdown to wrap code
- Include example code or configurations as part of the relevant step. blocks with [syntax highlighting](../../user/markdown.md#colored-code-and-syntax-highlighting).
Use appropriate Markdown to wrap code blocks with
[syntax highlighting](../../user/markdown.md#colored-code-and-syntax-highlighting).
- Start with an h2 (`##`), break complex steps into small steps using
subheadings h3 > h4 > h5 > h6. _Never skip a hierarchy level, such
as h2 > h4_, as it will break the TOC and may affect the breadcrumbs.
- Use short and descriptive headings (up to ~50 chars). You can use one
single heading like `## Configure X` for instructions when the feature
is simple and the document is short.
Example topic: Example topic:
## Create a teddy bear ## Create a teddy bear
Start by writing a sentence or two about _why_ someone would want to perform this task. Create a teddy bear when you need something to hug. (Include the reason why you
It's not always possible, but is a good practice. For example: might do the task.)
Create a teddy bear when you need something to hug.
Follow this information with the task steps.
To create a teddy bear: To create a teddy bear:
...@@ -142,40 +133,40 @@ To create a teddy bear: ...@@ -142,40 +133,40 @@ To create a teddy bear:
1. Expand **This** and click **This**. 1. Expand **This** and click **This**.
1. Do another step. 1. Do another step.
After the numbered list, add a sentence with the expected result, if it The teddy bear is now in the kitchen, in the cupboard above the sink. _(This is the result.)_
is not obvious, and any next steps. For example:
The teddy bear is now in the kitchen, in the cupboard above the sink.
You can retrieve the teddy bear and put it on the couch with the other animals. You can retrieve the teddy bear and put it on the couch with the other animals. _(These are next steps.)_
Screenshots are not necessary. They are difficult to keep up-to-date and can clutter the page. Screenshots are not necessary. They are difficult to keep up-to-date and can
clutter the page.
<!-- ## Troubleshooting <!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues Include any troubleshooting steps that you can foresee. If you know beforehand
one might have when setting this up, or when something is changed, or on upgrading, it's what issues one might have when setting this up, or when something is changed,
important to describe those, too. Think of things that may go wrong and include them here. or on upgrading, it's important to describe those, too. Think of things that may
This is important to minimize requests for support, and to avoid doc comments with go wrong and include them here. This is important to minimize requests for
questions that you know someone might ask. Support, and to avoid documentation comments with questions that you know
someone might ask.
Each scenario can be a third-level heading, for example, `### Getting error message X`. Each scenario can be a third-level heading, for example, `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place If you have none to add when creating a doc, leave this section in place but
but commented out to help encourage others to add to it in the future. --> commented out to help encourage others to add to it in the future. -->
--- ---
Notes: Notes:
- (1): Apply the [tier badges](styleguide.md#product-badges) accordingly - (1): Apply the [tier badges](styleguide.md#product-badges) accordingly.
- (2): Apply the correct format for the - (2): Apply the correct format for the
[GitLab version that introduces the feature](styleguide.md#gitlab-versions-and-tiers) [GitLab version that introduces the feature](styleguide.md#gitlab-versions-and-tiers).
``` ```
## Help and feedback section ## Help and feedback section
The "help and feedback" section (introduced by [!319](https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/319)) displayed at the end of each document This section ([introduced](https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/319) in GitLab 11.4)
can be omitted from the doc by adding a key into the its front matter: is displayed at the end of each document and can be omitted by adding a key into
the front matter:
```yaml ```yaml
--- ---
...@@ -183,8 +174,8 @@ feedback: false ...@@ -183,8 +174,8 @@ feedback: false
--- ---
``` ```
The default is to leave it there. If you want to omit it from a document, The default is to leave it there. If you want to omit it from a document, you
you must check with a technical writer before doing so. must check with a technical writer before doing so.
### Disqus ### Disqus
...@@ -192,8 +183,8 @@ We also have integrated the docs site with Disqus (introduced by ...@@ -192,8 +183,8 @@ We also have integrated the docs site with Disqus (introduced by
[!151](https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/151)), [!151](https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/151)),
allowing our users to post comments. allowing our users to post comments.
To omit only the comments from the feedback section, use the following To omit only the comments from the feedback section, use the following key in
key on the front matter: the front matter:
```yaml ```yaml
--- ---
...@@ -201,36 +192,42 @@ comments: false ...@@ -201,36 +192,42 @@ comments: false
--- ---
``` ```
We are only hiding comments in main index pages, such as [the main documentation index](../../README.md), since its content is too broad to comment on. Before omitting Disqus, We're hiding comments only in main index pages, such as [the main documentation index](../../README.md),
you must check with a technical writer. since its content is too broad to comment on. Before omitting Disqus, you must
check with a technical writer.
Note that once `feedback: false` is added to the front matter, it will automatically omit Note that after adding `feedback: false` to the front matter, it will omit
Disqus, therefore, don't add both keys to the same document. Disqus, therefore, don't add both keys to the same document.
The click events in the feedback section are tracked with Google Tag Manager. The The click events in the feedback section are tracked with Google Tag Manager.
conversions can be viewed on Google Analytics by navigating to **Behavior > Events > Top events > docs**. The conversions can be viewed on Google Analytics by navigating to
**Behavior > Events > Top events > docs**.
## Guidelines for good practices ## Guidelines for good practices
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36576/) in GitLab 13.2 as GitLab Development documentation. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36576/) in GitLab 13.2 as GitLab Development documentation.
"Good practice" examples demonstrate encouraged ways of writing code while comparing with examples of practices to avoid. *Good practice* examples demonstrate encouraged ways of writing code while
These examples are labeled as "Bad" or "Good". comparing with examples of practices to avoid. These examples are labeled as
In GitLab development guidelines, when presenting the cases, it is recommended *Bad* or *Good*. In GitLab development guidelines, when presenting the cases,
to follow a **first-bad-then-good** strategy. First demonstrate the "Bad" practice (how things _could_ be done, which is often still working code), it's recommended to follow a *first-bad-then-good* strategy. First demonstrate
and then how things _should_ be done better, using a "Good" example. This is typically an improved example of the same code. the *Bad* practice (how things *could* be done, which is often still working
code), and then how things *should* be done better, using a *Good* example. This
is typically an improved example of the same code.
Consider the following guidelines when offering examples: Consider the following guidelines when offering examples:
- First, offer the "Bad" example, then the "Good" one. - First, offer the *Bad* example, and then the *Good* one.
- When only one bad case and one good case is given, use the same code block. - When only one bad case and one good case is given, use the same code block.
- When more than one bad case or one good case is offered, use separated code blocks for each. - When more than one bad case or one good case is offered, use separated code
With many examples being presented, a clear separation helps the reader to go directly to the good part. blocks for each. With many examples being presented, a clear separation helps
Consider offering an explanation (for example, a comment, a link to a resource, etc.) on why something is bad practice. the reader to go directly to the good part. Consider offering an explanation
(for example, a comment, or a link to a resource) on why something is bad
practice.
- Better and best cases can be considered part of the good case(s) code block. - Better and best cases can be considered part of the good case(s) code block.
In the same code block, precede each with comments: `# Better` and `# Best`. In the same code block, precede each with comments: `# Better` and `# Best`.
NOTE: **Note:** NOTE: **Note:**
While the bad-then-good approach is acceptable for the GitLab development guidelines, do not use it Although the bad-then-good approach is acceptable for the GitLab development
for user documentation. For user documentation, use "Do" and "Don't." For example, see the guidelines, do not use it for user documentation. For user documentation, use
[Pajamas Design System](https://design.gitlab.com/content/punctuation/). *Do* and *Don't*. For examples, see the [Pajamas Design System](https://design.gitlab.com/content/punctuation/).
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment