EN
Markdown - how to create code lines (syntax highlighting - github, dev.to, stackoverflow)
0
points
In this article, we would like to show you how to create code lines in markdown.
Below examples present how to create:
- Inline code
- Code blocks with highlighting
1. Creating inline code
To create inline code in markdown you need to wrap your code into backticks ``
.
Example:
`var result = 1`
Result:
2. Code blocks with highlighting
To create a code block with highlighting you need to wrap your code with three backticks (```
) and specify the programming language in the first line.
Example:
```javascript
const data = {
user: {
username: 'john',
password: 'Secret$$'
}
};
```
Result from github.com:
Result from dev.to:
Result from stackoverflow.com: