зеркало из https://github.com/github/docs.git
feat: docs for adding code blocks in code blocks (#7144)
This commit is contained in:
Родитель
4f8124b201
Коммит
d3812b429e
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче