vue-highlight.js icon indicating copy to clipboard operation
vue-highlight.js copied to clipboard

Support line numbers

Open ColinTree opened this issue 6 years ago • 5 comments

Can we add line number to the code field?

ColinTree avatar Nov 10 '18 18:11 ColinTree

Highlight.js doesn't support line number.

But it should be good if we can do this.

gluons avatar Nov 11 '18 04:11 gluons

https://github.com/wcoder/highlightjs-line-numbers.js is the main plugin for adding line numbers, which works quite well.

lights0123 avatar Jun 20 '19 20:06 lights0123

@lights0123 Wow! Interesting. I'll try it myself.

gluons avatar Jun 21 '19 02:06 gluons

@gluons I created a combination of this project and that plugin, which is available as a Gist here. Unfortunately, that plugin requires running on a browser, meaning that I needed to make this a browser-only component. Things like Nuxt will be unable to render line numbers on the server side.

lights0123 avatar Jun 21 '19 22:06 lights0123

I know it's been a year and a half, but any progress on this? :)

chenasraf avatar Jan 14 '21 12:01 chenasraf