Commit 4bb1db90 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis Committed by Ruben Davila

Merge branch 'doc-refactor-description-templates' into 'master'

Refactor description templates documentation

## What are the relevant issue numbers?

Refactors docs introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4981

See merge request !5839
parent 4030d5ab
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
- if can_add_template?(issuable) - if can_add_template?(issuable)
%p.help-block %p.help-block
Add Add
= link_to "issuable templates", help_page_path('workflow/description_templates') = link_to "description templates", help_page_path('user/project/description_templates')
to help your contributors communicate effectively! to help your contributors communicate effectively!
.form-group.detail-page-description .form-group.detail-page-description
......
# Description templates
>[Introduced][ce-4981] in GitLab 8.11.
Description templates allow you to define context-specific templates for issue
and merge request description fields for your project.
## Overview
By using the description templates, users that create a new issue or merge
request can select a description template to help them communicate with other
contributors effectively.
Every GitLab project can define its own set of description templates as they
are added to the root directory of a GitLab project's repository.
Description templates must be written in [Markdown](../markdown.md) and stored
in your project's repository under a directory named `.gitlab`. Only the
templates of the default branch will be taken into account.
## Creating issue templates
Create a new Markdown (`.md`) file inside the `.gitlab/issue_templates/`
directory in your repository. Commit and push to your default branch.
## Creating merge request templates
Similarly to issue templates, create a new Markdown (`.md`) file inside the
`.gitlab/merge_request_templates/` directory in your repository. Commit and
push to your default branch.
## Using the templates
Let's take for example that you've created the file `.gitlab/issue_templates/Bug.md`.
This will enable the `Bug` dropdown option when creating or editing issues. When
`Bug` is selected, the content from the `Bug.md` template file will be copied
to the issue description field. The 'Reset template' button will discard any
changes you made after picking the template and return it to its initial status.
![Description templates](img/description_templates.png)
[ce-4981]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4981
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- [Authorization for merge requests](authorization_for_merge_requests.md) - [Authorization for merge requests](authorization_for_merge_requests.md)
- [Change your time zone](timezone.md) - [Change your time zone](timezone.md)
- [Description templates](../user/project/description_templates.md)
- [Feature branch workflow](workflow.md) - [Feature branch workflow](workflow.md)
- [GitLab Flow](gitlab_flow.md) - [GitLab Flow](gitlab_flow.md)
- [Groups](groups.md) - [Groups](groups.md)
...@@ -18,7 +19,6 @@ ...@@ -18,7 +19,6 @@
- [Share projects with other groups](share_projects_with_other_groups.md) - [Share projects with other groups](share_projects_with_other_groups.md)
- [Web Editor](web_editor.md) - [Web Editor](web_editor.md)
- [Releases](releases.md) - [Releases](releases.md)
- [Issuable Templates](issuable_templates.md)
- [Milestones](milestones.md) - [Milestones](milestones.md)
- [Merge Requests](merge_requests.md) - [Merge Requests](merge_requests.md)
- [Revert changes](revert_changes.md) - [Revert changes](revert_changes.md)
......
# Description templates
Description templates allow you to define context-specific templates for issue and merge request description fields for your project. When in use, users that create a new issue or merge request can select a description template to help them communicate with other contributors effectively.
Every GitLab project can define its own set of description templates as they are added to the root directory of a GitLab project's repository.
Description templates are written in markdown _(`.md`)_ and stored in your projects repository under the `/.gitlab/issue_templates/` and `/.gitlab/merge_request_templates/` directories.
![Description templates](img/description_templates.png)
_Example:_
`/.gitlab/issue_templates/bug.md` will enable the `bug` dropdown option for new issues. When `bug` is selected, the content from the `bug.md` template file will be copied to the issue description field.
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