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

Comments

@seniorcandy
Copy link

@seniorcandy seniorcandy commented Sep 12, 2016

No description provided.

@keysona

This comment has been minimized.

Copy link
Contributor

@keysona 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

This comment has been minimized.

Copy link
Contributor

@davidlowryduda davidlowryduda commented Dec 20, 2016

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

This comment has been minimized.

Copy link
Author

@seniorcandy seniorcandy commented Dec 21, 2016

@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

This comment has been minimized.

Copy link
Contributor

@davidlowryduda davidlowryduda commented Dec 23, 2016

@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

This comment has been minimized.

Copy link
Author

@seniorcandy seniorcandy commented Dec 23, 2016

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

@nicholasserra

This comment has been minimized.

Copy link
Collaborator

@nicholasserra nicholasserra commented Dec 23, 2016

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
Projects
None yet
4 participants
You can’t perform that action at this time.