-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code.md to show how to highlight line numbers. (#1135)
- Loading branch information
1 parent
409016a
commit 95b6852
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Code | ||
|
||
## Sigle line | ||
```markdown | ||
`single line of code` | ||
``` | ||
|
||
## Code block | ||
```markdown | ||
```js | ||
class Person(){ | ||
#name = "Jhon Doe" | ||
} | ||
``` | ||
|
||
``` | ||
|
||
## Line Numbers & Highlights | ||
Use the revealjs `<code data-line-numbers>` attribute from [their documentation](https://revealjs.com/code/): | ||
```markdown | ||
```js {data-line-numbers} | ||
class Person(){ | ||
#name = "Jhon Doe" | ||
#job = "Accounting" | ||
} | ||
|
||
``` | ||
Using these you can highlight line numbers (`{data-line-numbers="2,3"}`) and also create step-by-step fragments ((`{data-line-numbers="2|3"}`)). |