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

Is there a way to highlight different lines on multiple code blocks simultaneously #22

Open
damageboy opened this issue Aug 5, 2019 · 4 comments

Comments

@damageboy
Copy link

It would be nice to be able to highlight different lines on different code blocks simulatenously, as I'm going over two variations of the same code in one slide.

I can mimic this by merging into one code block, of course, which I do now, but this would allow for even higher degree of freedom...

Is there a way to achieve this?

@bnjmnt4n
Copy link
Owner

bnjmnt4n commented Aug 9, 2019

This seems like a decent idea, which could be implemented with a little modifications. I feel that the syntax is getting a little clunky though. Any suggestions on how to describe highlighting different lines on different code blocks at the same time?

I was thinking something like: data-code-focus="1#1-3,4,7|2#5" to describe this, using | and 1# to indicate different code blocks and allowing - or , to indicate specific lines within the code block.

To maintain compatibility with current syntax, something like data-code-focus="1-3,4,7|5" and data-code-block="1|2" can be used to represent the same lines.

Feel free to chime in with any recommendations.

@bnjmnt4n
Copy link
Owner

bnjmnt4n commented Aug 9, 2019

The syntax when used with #19 (if that were ever implemented) would then be something like data-code-focus="2#7[13-15],9".

@damageboy
Copy link
Author

I really like it!

It's obviously complex when you look at it from the outside, but this isn't a simple request to begin with.
I think 1#1-3,4|2#5-7 is really the best we can ever hope for...

To be honest I thought of much worse things when I opened to issue... :)

@bnjmnt4n
Copy link
Owner

I’ve implemented this, but will probably work on some of the other issues before making a new release (probably going to be a major bump due to changes to Reveal’s plugin API).

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