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

codeblock plugin: highlight a line? #584

Closed
xuhdev opened this Issue May 27, 2012 · 9 comments

Comments

Projects
None yet
4 participants
@xuhdev
Copy link

xuhdev commented May 27, 2012

Is it possible to highlight a line in a codeblock?

Thanks!

@imathis

This comment has been minimized.

Copy link
Owner

imathis commented May 27, 2012

I assume you mean marking a line of code to direct the reader's attention? This is a good idea. I'll give a shot at designing it.

@xuhdev

This comment has been minimized.

Copy link

xuhdev commented May 28, 2012

Yes, this is exactly what I mean. Thanks.

imathis added a commit that referenced this issue May 28, 2012

Refactored code plugins so that shared regexes are mixed in methods
Added option to mark one line or groups of lines in a code block

Relates to issue #584
@imathis

This comment has been minimized.

Copy link
Owner

imathis commented May 28, 2012

I just added this feature and merged it into 2.1. include_code, code_block, and the backtick code blocks all support it, but I still have to add styling and documentation.

Here's how it works though. You can add the option mark:1 to mark the first line in a code block. You can also set mark:1,5-8 to mark lines 1,5,6,7 and 8. This will add the css class name "marked" to a line number and a line of code for each line you choose to mark.

I still haven't figured out how I want to style marked lines. But this is what I came up with.

@xuhdev

This comment has been minimized.

Copy link

xuhdev commented May 28, 2012

Glad to hear that. Thanks!

@imathis

This comment has been minimized.

Copy link
Owner

imathis commented Jun 3, 2012

Thanks to (this commit)[https://github.com/imathis/octopress/commit/9b7958eab12e4f359c19308bf5c67b6cd628a819] this is now closed. here's a preview: http://cl.ly/H6Wz

@imathis imathis closed this Jun 3, 2012

@xuhdev

This comment has been minimized.

Copy link

xuhdev commented Jun 3, 2012

This is great! Thank you very much!

@cibernox

This comment has been minimized.

Copy link

cibernox commented Apr 21, 2013

I can't get this feature to work. I think it's gone!

@parkr

This comment has been minimized.

Copy link
Collaborator

parkr commented Apr 22, 2013

You can use marking! It's still in our plugin.

@cibernox

This comment has been minimized.

Copy link

cibernox commented Apr 22, 2013

Nope! But I think I know what happened. This feature is no in the master branch, only in the 2.1. Good for me 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment