EN
Markdown - how to make blocks of TypeScript code (syntax highlighting - github, dev.to, stackoverflow)
3
points
In this article, we would like to show you how to create blocks of TypeScript code with syntax highlighting in markdown.
To create a block of TypeScript code with syntax highlighting you need to wrap your code with three backticks (```
) and tell markdown it's typescript
in the first line right after backticks.
Note: You can also type
ts
instead of wholetypescript
word.
Practical example:
```typescript
let array = [
{
id : 1,
group : 'Juices',
items : [
{ name : 'Apple', price : 1.4 },
{ name : 'Orange', price : 1.7 }
]
}
];
```
Result from github.com:
Result from dev.to:
Result from stackoverflow.com: