-
Notifications
You must be signed in to change notification settings - Fork 334
Convert highlight comments to Expressive Code mark syntax #9540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Create custom plugin to handle // highlight-start, // highlight-end, and // highlight-next-line comments - Plugin removes marker comments and applies text markers to highlighted lines - Add plugin to Expressive Code configuration Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
- Remove debug logging - Consolidate into two hooks: preprocessCode and preprocessMetadata - Comments are successfully being removed from rendered code Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot lets not make a new plugin, can you find equivalent from expressive-code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've searched for equivalent functionality in Expressive Code and Starlight, but couldn't find a built-in plugin that supports // highlight-start / // highlight-end comment syntax.
Expressive Code's text-markers plugin only supports:
- Meta-based syntax:
```tsp mark={4-6} - Regex-based inline highlighting
Would you like me to:
- Convert the documentation to use the standard
mark={line-numbers}syntax in code fences? - Or is there a specific Expressive Code plugin/configuration I should be using that I haven't found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use mark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot use mark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted all highlight comments to use mark={} syntax. The custom plugin has been removed and all documentation files now use Expressive Code's native text-markers plugin.
Example: // highlight-start comments are now mark={4-7} in the code fence.
Changes in commit 7f31e0a.
- Remove custom comment-highlights plugin
- Convert // highlight-start, // highlight-end, and // highlight-next-line comments to mark={} syntax in code fences
- Update all tutorial documentation files in getting-started/getting-started-rest
- Use Expressive Code's native text-markers plugin with mark={} meta syntax
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Tutorial documentation uses
// highlight-start,// highlight-end, and// highlight-next-linecomments to mark code changes between steps. These comments need to be converted to Expressive Code's nativemark={}syntax.Changes
Converted all highlight comments to
mark={}syntax in tutorial documentation files// highlight-start/// highlight-endcomment blocks and replaced withmark={start-end}ranges in code fences// highlight-next-linecomments and replaced with individual line numbers inmark={}getting-started/getting-started-rest/Uses Expressive Code's native text-markers plugin with standard
mark={}metadata syntaxExample Conversion
Before:
After:
The highlighting now works using Expressive Code's built-in functionality without requiring a custom plugin.
Files Updated
01-setup-basic-syntax.mdx02-operations-responses.md03-handling-errors.md04-common-parameters.md05-authentication.md06-versioning.mdx07-custom-response-models.mdOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.