[docs-infra] Add line and word highlighting on code blocks
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Summary
Sometimes, we may want to draw attention to a specific part of a code snippet. That can be either a small function, a variable, or an entire line. We currently lack a way of doing this "natively" within our docs-infra experience. Here's just a quick preview of what this could look like:
Benchmark
- @atomiks shared his rehype-pretty-code library that we could potentially use! In terms of DX, I don't think we should deviate too much from how it is done in it.
- Docusaurus also has its own way of adding this feature that we can be inspired by too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file, test, or entry point is named. Start by reviewing the rehype-pretty-code and Docusaurus references to understand their highlighting syntax and behavior, then determine the supported line and word-highlighting scope for docs-infra. Done means code blocks can visibly highlight the requested parts through the agreed documentation syntax.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100