Highlight lines in fenced code blocks
- Dominant language
- Haskell
- Stars
- 218
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
> There's an [old issue](https://github.com/jgm/pandoc/issues/1183) I'd like to reignite for [highlighting lines of code](https://www.fxmk.dev/articles/code-samples-line-highlighting).
For my purposes, it'd be very handy to have css classes available for rows, which allows adding effects on a [flashcard reveal](https://github.com/badlydrawnrob/anki/issues/149) (some very rough [codepen examples](https://codepen.io/testuser-247585903/pen/MWxVvzp) here). This can be done manually, but it's a chore to locate the right lines (and it's unlikely end-users would bother), so it'd be nice to automate that.
It's possible to do with javascript, but I tend to keep my flashcards free of scripting and use plain html. With a `lines=1-2, 5, 9-20` setup you could easily achieve the codepen examples above with `:not(.highlighted-lines)` in css.
I understand this might be niche and difficult to achieve, but it's super handy (for [tutorials](https://elm.land/guide/pages-and-routes.html#using-components-on-pages) and blog posts also). The feature seems to be available in at least a couple of the highlight libraries out there.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the linked prior issue #1183 and the existing fenced-code highlighting path; the payload names no file or test. Done means supporting a lines=1-2, 5, 9-20 option that exposes row-level classes in the generated HTML for CSS-based highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100