Skip to content

Commit

Permalink
add documentation for line number offset in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
flowolf committed May 12, 2023
1 parent 8de653f commit 46e2d22
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,37 @@ Powerful syntax highlighting features are built into reveal.js. Using the bracke
</div>
</div>

### Line Number Offset

You can add a [line number offset](/code/#line-number-offset-4.2.0) by adding a number and a colon at the beginning of your highlights.

```html
<section data-markdown>
<textarea data-template>
```js [712: 1-2|3|4]
let a = 1;
let b = 2;
let c = x => 1 + 2 + x;
c(3);
```
</textarea>
</section>
```
<div class="reveal reveal-example">
<div class="slides">
<section data-markdown>
<textarea data-template>
```js [712: 1-2|3|4]
let a = 1;
let b = 2;
let c = x => 1 + 2 + x;
c(3);
```
</textarea>
</section>
</div>
</div>

## Configuring *marked*

We use [marked](https://github.com/chjj/marked) to parse Markdown. To customize marked's rendering, you can pass in options when [configuring Reveal](/config/):
Expand Down

0 comments on commit 46e2d22

Please sign in to comment.