Code Block Shortcode
Settings for generate different functions Code Blocks
Code Example #
Block Content #
``` ## This is the content ```
Will results:
## This is the content
Syntax Highlight #
Add languages after ```
```javascript document.getElementById('demo').innerHTML = 'Hello JavaScript'; ```
Will results:
document.getElementById("demo").innerHTML = "Hello JavaScript";
Display Line Numbers #
Line Numbers are not displayed by default.
Use linenos
in parameters.
```javascript {linenos=true} document.getElementById('demo').innerHTML = 'Hello JavaScript'; ```
Will results:
|
|
Change Starting Line Number #
Use linenostart
in parameters.
```python {linenos=true,linenostart=13} ```
Will results:
|
|
Highlight Certain Lines #
Use hl_lines
in parameters.
```ts {linenos=true,hl_lines=[3,"8-10"]} ```
Will results:
|
|
Without Line Number:
```ts {hl_lines=[3,"8-10"]} ```
Will results:
interface User {
name: string;
id: number;
}
const user: User = {
username: "Hayes",
Type '{ username: string; id: number; }' is not assignable to type 'User'.
Object literal may only specify known properties, and 'username' does not exist in type 'User'.
Type '{ username: string; id: number; }' is not assignable to type 'User'.
Object literal may only specify known properties, and 'username' does not exist in type 'User'.
id: 0,
};
Code Block Shortcode
was last edited on 2021-01-13
@16a6725
: update formatting