reveal-code-focus icon indicating copy to clipboard operation
reveal-code-focus copied to clipboard

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

Open nodkz opened this issue 5 years ago • 2 comments

Will be great if this plugin also has built-in lines numbers support for the code.

For now, I'm doing this via 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!

nodkz avatar Oct 06 '18 11:10 nodkz

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 avatar Oct 27 '18 03:10 bnjmnt4n

SInce Reveal.js v3.8.0 has added support for line numbers, this might be something for me to reconsider. Not sure what approach to take though: Prism also uses CSS to implement this, while the solution incorporated in Reveal.js’ highlight plugin generates a table.

bnjmnt4n avatar Aug 10 '19 08:08 bnjmnt4n