-
-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for expressive code in snippets #717
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
Conversation
This update introduces the handling of expressive code metadata for code snippets, enabling enhanced representation and functionality. Changes include parsing, storing, and rendering expressive attributes in snippets, along with updates to tests and relevant components to validate the new feature. Additionally, a package dependency (Argon) is updated for compatibility. Only works for comment snippets currently.
Also addresses issue #537 |
@SimonCropp I can make the |
can u add some docs |
Introduced the `ExpressiveCode` class to centralize regex pattern handling, supporting both .NET 8.0+ generated regex and static regex for older versions. Updated `StartEndTester` to utilize the shared `ExpressiveCode.Instance.Pattern` for consistency and maintainability. Expanded documentation with examples of snippet metadata and its rendering.
@SimonCropp I've made the changes you requested. Please re-review and let me know if you'd like any more changes. I did notice that #716 was a feature to add metadata at the target. That could be a follow up to this PR where I can make it also handle this metadata at write-time. |
Reorganized Regex initialization using `#if NET8_0_OR_GREATER` to leverage `GeneratedRegex` for .NET 8+ and fallback to static initialization otherwise instance is null.
Simplified the logic for generating the language declaration by checking for empty `ExpressiveCode`. No more TrimEnd.
Thank you sir. You are a scholar and a gentlemen. 🧐 |
lol. thanks. i think i still owe you more drinks than the other way around i will deploy a beta now. have a play, if u r ok with it, i will deploy a stable when u give me the ok |
28.0.0-beta.1 deployed. give nuget 10 min to cache it |
This update introduces the handling of expressive code metadata for code snippets, enabling enhanced representation and functionality. Changes include parsing, storing, and rendering expressive attributes in snippets and updates to tests and relevant components to validate the new feature. Additionally, a package dependency (Argon) is updated for compatibility.
Only works for comment snippets currently.
See https://expressive-code.com/ for more details. #714
TL;DR:
This...
Get converted into...