Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

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

Open
nodkz opened this issue Oct 6, 2018 · 2 comments
Open

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

nodkz opened this issue Oct 6, 2018 · 2 comments

Comments

@nodkz
Copy link

nodkz commented Oct 6, 2018

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!

@bnjmnt4n
Copy link
Owner

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
Copy link
Owner

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 bnjmnt4n reopened this Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants