debian-mirror-gitlab/doc/development/documentation/structure.md

167 lines
7.9 KiB
Markdown
Raw Normal View History

2018-11-20 20:47:30 +05:30
---
2019-02-15 15:39:39 +05:30
description: What to include in GitLab documentation pages.
2018-11-20 20:47:30 +05:30
---
2019-02-15 15:39:39 +05:30
# Documentation structure and template
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
This document will help you determine how to structure a page within GitLab's
documentation and what content to include. These standards help ensure consistency
and completeness throughout the documentation, and they make it easier to contribute.
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
Before getting started, familiarize yourself with [GitLab's Documentation guidelines](index.md)
and the section on Content in the [Style Guide](styleguide.md).
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
## Components of a documentation page
2018-11-20 20:47:30 +05:30
2019-12-04 20:38:33 +05:30
Most pages will be dedicated to a specific GitLab feature or to a use case that involves
2019-02-15 15:39:39 +05:30
one or more features, potentially in conjunction with third-party tools.
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
Every feature or use case document should include the following content in the following sequence,
with exceptions and details noted below and in the template included on this page.
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
- **Title**: Top-level heading with the feature name, or a use case name, which would start with
2019-07-07 11:18:12 +05:30
a verb, like Configuring, Enabling, etc.
2020-04-22 19:07:51 +05:30
- **Introduction**: A couple sentences about the subject matter and what's to be found
on this page. Describe what the feature or topic is, what it does, and in what context it should
be used. There is no need to add a title called "Introduction" or "Overview," because people rarely
search for these terms. Just put this information after the title.
2019-02-15 15:39:39 +05:30
- **Use cases**: describes real use case scenarios for that feature/configuration.
- **Requirements**: describes what software, configuration, account, or knowledge is required.
- **Instructions**: One or more sets of detailed instructions to follow.
- **Troubleshooting** guide (recommended but not required).
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
For additional details on each, see the [template for new docs](#template-for-new-docs),
below.
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
Note that you can include additional subsections, as appropriate, such as 'How it Works', 'Architecture',
2019-12-21 20:55:43 +05:30
and other logical divisions such as pre- and post-deployment steps.
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
## Template for new docs
2018-11-20 20:47:30 +05:30
To start a new document, respect the file tree and file name guidelines,
as well as the style guidelines. Use the following template:
```md
2019-02-15 15:39:39 +05:30
<!--Follow the Style Guide when working on this document. https://docs.gitlab.com/ee/development/documentation/styleguide.html
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.-->
2018-11-20 20:47:30 +05:30
---
2019-02-15 15:39:39 +05:30
description: "Short document description." # Up to ~200 chars long. They will be displayed in Google Search snippets. It may help to write the page intro first, and then reuse it here.
2018-11-20 20:47:30 +05:30
---
2019-02-15 15:39:39 +05:30
# Feature Name or Use Case Name **[TIER]** (1)
<!--If writing about a use case, drop the tier, and start with a verb, e.g. 'Configuring', 'Implementing', + the goal/scenario-->
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
<!--For pages on newly introduced features, add the following line. If only some aspects of the feature have been introduced, specify what parts of the feature.-->
> [Introduced](link_to_issue_or_mr) in GitLab (Tier) X.Y (2).
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
An introduction -- without its own additional header -- goes here.
2020-04-22 19:07:51 +05:30
Offer a description of the feature or use case, and what to expect on this page.
2019-02-15 15:39:39 +05:30
(You can reuse this content, or part of it, for the front matter's `description` at the top of this file).
2018-11-20 20:47:30 +05:30
2020-04-22 19:07:51 +05:30
The introduction should answer the following questions:
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
- What is this feature or use case?
2018-11-20 20:47:30 +05:30
- Who is it for?
- What is the context in which it is used and are there any prerequisites/requirements?
2019-02-15 15:39:39 +05:30
- What can the audience do with this? (Be sure to consider all applicable audiences, like GitLab admin and developer-user.)
- What are the benefits to using this over any alternatives?
2018-11-20 20:47:30 +05:30
## Use cases
2019-02-15 15:39:39 +05:30
Describe some 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 scenarios
for use (e.g. variations on the main use case), but if that's not applicable, the section can be omitted.
Examples of use cases on feature pages:
- CE and EE: [Issues](../../user/project/issues/index.md#use-cases)
- CE and EE: [Merge Requests](../../user/project/merge_requests/index.md)
2019-09-04 21:01:54 +05:30
- EE-only: [Geo](../../administration/geo/replication/index.md)
- EE-only: [Jenkins integration](../../integration/jenkins.md)
2018-11-20 20:47:30 +05:30
## Requirements
2019-02-15 15:39:39 +05:30
State any requirements for using the feature and/or following along with the instructions.
2018-11-20 20:47:30 +05:30
2019-02-15 15:39:39 +05:30
These can include both:
- technical requirements (e.g. an account on a third party service, an amount of storage space, prior configuration of another feature)
- prerequisite knowledge (e.g. familiarity with certain GitLab features, cloud technologies)
Link each one to an appropriate place for more information.
2018-11-20 20:47:30 +05:30
## Instructions
2019-02-15 15:39:39 +05:30
"Instructions" is usually not the name of the heading.
This is the part of the document where you can include one or more sets of instructions, each to accomplish a specific task.
Headers should describe the task the reader will achieve by following the instructions within, typically starting with a verb.
2019-07-07 11:18:12 +05:30
Larger instruction sets may have subsections covering specific phases of the process.
2020-03-13 15:44:24 +05:30
Where appropriate, provide examples of code or configuration files to better clarify intended usage.
2018-11-20 20:47:30 +05:30
- Write a step-by-step guide, with no gaps between the steps.
2020-04-08 14:13:33 +05:30
- Include example code or configurations as part of the relevant step. Use appropriate markdown to [wrap code blocks with syntax highlighting](../../user/markdown.md#colored-code-and-syntax-highlighting).
2018-11-20 20:47:30 +05:30
- Start with an h2 (`##`), break complex steps into small steps using
2019-02-15 15:39:39 +05:30
subheadings h3 > h4 > h5 > h6. _Never skip a hierarchy level, such
2018-11-20 20:47:30 +05:30
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
2019-02-15 15:39:39 +05:30
single heading like `## Configuring X` for instructions when the feature
2018-11-20 20:47:30 +05:30
is simple and the document is short.
<!-- ## Troubleshooting
2019-02-15 15:39:39 +05:30
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->
2018-12-13 13:39:08 +05:30
---
2018-11-20 20:47:30 +05:30
Notes:
2019-09-04 21:01:54 +05:30
- (1): Apply the [tier badges](styleguide.md#product-badges) accordingly
- (2): Apply the correct format for the [GitLab version introducing the feature](styleguide.md#gitlab-versions-and-tiers)
2018-12-13 13:39:08 +05:30
```
## Help and feedback section
2020-03-13 15:44:24 +05:30
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
2018-12-13 13:39:08 +05:30
can be omitted from the doc by adding a key into the its frontmatter:
```yaml
---
feedback: false
---
```
The default is to leave it there. If you want to omit it from a document,
you must check with a technical writer before doing so.
### Disqus
We also have integrated the docs site with Disqus (introduced by
2020-03-13 15:44:24 +05:30
[!151](https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/151)),
2018-12-13 13:39:08 +05:30
allowing our users to post comments.
To omit only the comments from the feedback section, use the following
key on the frontmatter:
```yaml
---
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,
you must check with a technical writer.
Note that once `feedback: false` is added to the frontmatter, it will automatically omit
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
conversions can be viewed on Google Analytics by navigating to **Behavior > Events > Top events > docs**.