Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to display line number in a code block? #225

Closed
seniorcandy opened this issue Sep 12, 2016 · 6 comments
Closed

how to display line number in a code block? #225

seniorcandy opened this issue Sep 12, 2016 · 6 comments

Comments

@seniorcandy
Copy link

No description provided.

@keysona
Copy link
Contributor

keysona commented Sep 16, 2016

Sorry, this lib can not do this.
It's just convert markdown to html.

And line number may be use css or js?

@davidlowryduda
Copy link
Contributor

Line numbers in code blocks can be done using css. See https://codepen.io/elomatreb/pen/hbgxp or https://www.sylvaindurand.org/using-css-to-add-line-numbering/ for two examples (although they are essentially the same) of implementations.

@seniorcandy
Copy link
Author

@davidlowryduda
Thanks man, it looks pretty good, but when I try to select the code in multiple lines, the numbers are also selected, and when I copy and paste the code, every empty line become two empty lines.
They look like

def print_hi(name)

	puts "Hi, #{name}"

end


print_hi('Tom')

#=> prints 'Hi, Tom' to STDOUT.

@davidlowryduda
Copy link
Contributor

@seniorcandy
Perhaps it would help to give you a single, self-contained example. So I made a self-contained example on my side website. Perhaps it makes more sense now?

@seniorcandy
Copy link
Author

@davidlowryduda
Yeah, it really helps a lot.
Much appreciated

@nicholasserra
Copy link
Collaborator

Thanks @davidlowryduda . I'm gonna close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants