-
-
Notifications
You must be signed in to change notification settings - Fork 295
Initial Admonition support (github format) #186
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
Initial Admonition support (github format) #186
Conversation
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.
Nice start, have a look at my comments! Haven’t been able to actually test this yet (not behind a computer) but this should already be useful.
|
Cheers for the feedback @zefhemel. I've just pushed updates addressing these. |
|
Looks reasonable enough from the code perspective, I’ll check it out (literally) later to see if actually works 😉 before merging (QA you know). Or is there more you’d want to change (since it’s still marked as WIP). |
I think there are many things that can be added, more types, different syntax support, custom types etc. But that can be for future PR's. |
39a2fce to
4021d0f
Compare
|
Overall this works ok. The only issue I have is when the live preview kicks in. In its current behavior, this works strangely when adding spaces. I'm exegarating it in this video, but adding a space (even one) after CleanShot.2022-12-11.at.20.51.29.mp4How I would solve this myself is to simply be more conservative when to actually show the live preview icon. I would simply not do any of that magic if the cursor is on the first line (the line with the admonition). That way you can always see all the markup (including spaces), and when you move to the second (non-header) line, the header renders as a preview. This also solves the "two stages of preview" problem where depending on where your cursor is it either shows Alternatively somehow the space thing needs to be handled differently, now it feels a bit broken. Come to think of it, perhaps the problem is simply in your regex? It may be addressed differently. |
|
@zefhemel have addressed your other feedback. Regarding the replacement of icon, have changed it to your first suggestion (within first line or not). Its a nifty feature but not essential. Will take another look at that later on. |
6eebee7 to
2b090cc
Compare
|
Great, this is nice. I'll merge it, we can tweak things later. Thanks! |
Awesome thanks. You've got an interesting and useful project here, I'm happy to contribute more in future. |
Resolves #67
Adds initial markdown support for Admonitions (using github syntax):
And: