File names, commands, entries, and anything that refers to code should be added to code blocks.
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
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.
useful to copy and paste, as they can easily do it with the button on code blocks.
- Add a blank line above and below code blocks.
- For regular code blocks, always use a highlighting class corresponding to the
- For regular code blocks, always use a highlighting class corresponding to the
language for better readability. Examples:
language for better readability. Examples:
````md
~~~md
```ruby
```ruby
Ruby code
Ruby code
```
```
...
@@ -673,16 +674,17 @@ nicely on different mobile devices.
...
@@ -673,16 +674,17 @@ nicely on different mobile devices.
```
```
```md
```md
Markdown code
[Markdown code example](example.md)
```
```
```text
```text
Code for which no specific highlighting class is available.
Code or text 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
- To display raw markdown instead of rendered markdown, you can use triple backticks
markdown to display. See [example](https://gitlab.com/gitlab-org/gitlab-ce/blob/8c1991b9bb7e3b8d606481fdea316d633cfa5eb7/doc/development/documentation/styleguide.md#L275-287).
with `md`, like the `Markdown code` example above, unless you want to include triple
backticks in the code block as well. In that case, use triple tildes (`~~~`) instead.
- For a complete reference on code blocks, check the [Kramdown guide](https://about.gitlab.com/handbook/product/technical-writing/markdown-guide/#code-blocks).
- 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
## Alert boxes
...
@@ -1024,7 +1026,7 @@ on this document. Further explanation is given below.
...
@@ -1024,7 +1026,7 @@ on this document. Further explanation is given below.
The following can be used as a template to get started:
The following can be used as a template to get started:
````md
~~~md
## Descriptive title
## Descriptive title
One or two sentence description of what endpoint does.
One or two sentence description of what endpoint does.
...
@@ -1052,7 +1054,7 @@ Example response:
...
@@ -1052,7 +1054,7 @@ Example response:
}
}
]
]
```
```
````
~~~
### Fake tokens
### Fake tokens
...
@@ -1080,7 +1082,7 @@ You can use the following fake tokens as examples.
...
@@ -1080,7 +1082,7 @@ You can use the following fake tokens as examples.
### Method description
### Method description
Use the following table headers to describe the methods. Attributes should
Use the following table headers to describe the methods. Attributes should
always be in code blocks using backticks (```` ```).
always be in code blocks using backticks (`` ` ``).
- Review the Thoughtbot code-review guide for suggestions to follow when reviewing merge requests:[Thoughtbot](https://github.com/thoughtbot/guides/tree/master/code-review)
- Review the Thoughtbot code-review guide for suggestions to follow when reviewing merge requests:
- To remove files from stage use reset HEAD where HEAD is the last commit of the current branch. This will unstage the file but maintain the modifications.
- To remove files from stage use reset HEAD where HEAD is the last commit of the current branch. This will unstage the file but maintain the modifications.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30829) in GitLab 12.2.
This setting allows you to rate limit the requests to raw endpoints, defaults to `300` requests per minute.
It can be modified in **Admin Area > Network > Performance Optimization**.
For example, requests over `300` per minute to `https://gitlab.com/gitlab-org/gitlab-ce/raw/master/app/controllers/application_controller.rb` will be blocked.
![Rate limits on raw endpoints](img/rate_limits_on_raw_endpoints.png)
This limit is:
- Applied independently per project, per commit and per file path.
- Not applied per IP address.
- Active by default. To disable, set the option to `0`.