saberland/saber

Feature request: Expose line number index for color highlighting

Apostolique opened this issue · 1 comments

Feature request

What problem does this feature solve?

It makes it possible to start the lines numbers to something else than 1.

What does the proposed API look like?

Exposed in a similar way to the current line highlighting in the markdown.

How should this be implemented in your opinion?

const lineNumber = index + 1

Are you willing to work on this yourself?

I could if no one else does.

We are using CSS counters in saber-highlight-css:

counter-reset: linenumber;

So probably we should inline that style into this line instead:

'<span aria-hidden="true" class="saber-highlight-line-numbers">' +

Like this:

<span 
  aria-hidden="true" 
  class="saber-highlight-line-numbers" 
  style="counter-reset: linenumber 0">

And make that 0 customizable.