Skip to content

Commit

Permalink
Add code.md to show how to highlight line numbers. (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuchse-ego authored Oct 28, 2024
1 parent 409016a commit 95b6852
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [Extended Syntax](markdown/extended-syntax.md)
- Backgrounds
- Media
- Code
- [Code](markdown/code.md)
- Math
- Fragments
- Links
Expand Down Expand Up @@ -44,7 +44,7 @@
- Reference

- Reference

- [API](api.md)
- [Configuration](configuration.md)

Expand Down
28 changes: 28 additions & 0 deletions docs/markdown/code.md
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"}`)).

0 comments on commit 95b6852

Please sign in to comment.