feat: docs for adding code blocks in code blocks (#7144)

This commit is contained in:
Shubham Palriwala 2021-06-08 02:25:03 +05:30 коммит произвёл GitHub
Родитель 4f8124b201
Коммит d3812b429e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 19 добавлений и 3 удалений

Двоичные данные
assets/images/help/writing/fenced-code-show-backticks-rendered.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Просмотреть файл

@ -5,10 +5,11 @@ redirect_from:
- /articles/creating-and-highlighting-code-blocks
- /github/writing-on-github/creating-and-highlighting-code-blocks
versions:
free-pro-team: '*'
enterprise-server: '*'
github-ae: '*'
free-pro-team: "*"
enterprise-server: "*"
github-ae: "*"
---
### Fenced code blocks
You can create fenced code blocks by placing triple backticks <code>\`\`\`</code> before and after the code block. We recommend placing a blank line before and after code blocks to make the raw formatting easier to read.
@ -29,7 +30,22 @@ function test() {
{% endtip %}
To display triple backticks in a fenced code block, wrap them inside quadruple backticks.
<pre>
````
```
Look! You can see my backticks.
```
````
</pre>
![Rendered fenced code with backticks block](/assets/images/help/writing/fenced-code-show-backticks-rendered.png)
### Syntax highlighting
<!-- If you make changes to this feature, update /getting-started-with-github/github-language-support to reflect any changes to supported languages. -->
You can add an optional language identifier to enable syntax highlighting in your fenced code block.