[DRAFT] feat: show line numbers in markdown blocks
Add line numbers for code blocks in Slidev VSCode extension
Motivation
I have many code blocks in my presentations. And I often need to know line numbers (e.g., for line highlighting {1|7-9...} ). It would therefore be useful to see line numbers directly in the editor.
Description
This PR adds an optional feature to display line numbers for code blocks in the Slidev VSCode extension, making it easier to reference specific lines when working with code in presentations.
Screenshots
Changes
1. Line numbers decoration for code blocks
- Added automatic line numbering for code blocks (triple backticks
```) - Ignores special blocks like
magic-move(4+ backticks) - Added
slidev.annotations-line-numberssetting (default:true)
Known issues
- Doesn't respect the
startLineoption - Shares the same triggers for creating annotations — looks odd until the document is saved
Deploy Preview for slidev ready!
| Name | Link |
|---|---|
| Latest commit | ec653bf4f8580bccdd7c3ed9e21cf8a533c05c49 |
| Latest deploy log | https://app.netlify.com/projects/slidev/deploys/69035a8acb62760008d57bf2 |
| Deploy Preview | https://deploy-preview-2320--slidev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
@slidev/client
npm i https://pkg.pr.new/slidevjs/slidev/@slidev/client@2320
create-slidev
npm i https://pkg.pr.new/slidevjs/slidev/create-slidev@2320
create-slidev-theme
npm i https://pkg.pr.new/slidevjs/slidev/create-slidev-theme@2320
@slidev/parser
npm i https://pkg.pr.new/slidevjs/slidev/@slidev/parser@2320
@slidev/cli
npm i https://pkg.pr.new/slidevjs/slidev/@slidev/cli@2320
@slidev/types
npm i https://pkg.pr.new/slidevjs/slidev/@slidev/types@2320
commit: ec653bf
Love the idea!
The lint error seems to require manual update.
Fixed