-
Notifications
You must be signed in to change notification settings - Fork 876
Support for custom Pygments formatter #1187
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 adds configuration support for using a custom Pygments formatter, either by giving the string name, or a custom formatter class (or callable).
This looks like a great start. Before we merge this, at a minimum, we will need to address the failing tests.
Finally, I wonder if perhaps we should have some error handling to deal with bad string names and/or objects (classes/callables) which don't properly match Pygments' API. As a reminder, a user passing text to Markdown should never result in an error. However, creating an instance of the Markdown class certainly can. So any error checking usually needs to happen when the extension is loaded, not when it is passed user input. If that is not possible or practical (as I suspect is the case here), then perhaps we should fall back to a default formatter on error. |
Understood. Thanks for detailed pointers @waylan. I checked the contributing guidelines that GitHub pointed me to, but the one you linked to has much more information. I'll get on this right away. |
Hey @waylan, I think I've covered all the feedback from your message. Please let me know if I've missed anything or if there's more changes you'd like before merging in. Also, could you please run the workflows again so I can see if we get all green now? Thanks! |
Fixed lint and spelling failures in the previous commit and pushed. |
This looks like it is ready to go. Thanks for doing the work. However, we have a bunch of bugfixes waiting for a bugfix release. Once we do that release, we can merge this. I've labeled this and added it to the correct milestone so that we don't forget about it. |
Thank you for sharing the merging plan. I'll look forward to the 3.4 release then. |
I will merge this if the conflicts are resolved. |
@waylan, thanks for the notification. I've just resolved merge conflicts. |
Hi team!
This adds configuration support for using a custom Pygments formatter, either by giving the string name, or a custom formatter class (or callable).
Inspired by #490, which wasn't merged back then because v3 work was going on. I'm hoping we can merge this feature now please?
Thank you for your time.