Will be great if this plugin also adds lines numbers for code

#16 · open · 2 comments

View on GitHub ↗

nodkz

Will be great if this plugin also has built-in lines numbers support for the code. For now, I'm doing this via CSS: ```css code { counter-reset: line; } code > span { counter-increment: line; } code > span:before { content: counter(line); text-align: right; color: #555; /* border-right: 1px solid #555; */ width: 40px; padding-right: 8px; margin-right: 8px; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } ``` Thanks for amazing plugin!

Comments

bnjmnt4n

For now, I'm trying to keep the core features lean and minimal - this seems to be something that can be easily handled via CSS as you've done. I'm also trying to maintain compatibility with the original Reveal.js code syntax highlighting so I'll punt on this for now. Thanks for the snippet though - I might add a link to it in the extras page on the documentation for others' reference.

bnjmnt4n

SInce [Reveal.js v3.8.0](https://github.com/hakimel/reveal.js/releases/tag/3.8.0) has added support for line numbers, this might be something for me to reconsider. Not sure what approach to take though: [Prism](https://github.com/PrismJS/prism/blob/master/plugins/line-numbers/prism-line-numbers.js) also uses CSS to implement this, while [the solution incorporated in Reveal.js’ highlight plugin](https://github.com/wcoder/highlightjs-line-numbers.js) generates a table.