-
Notifications
You must be signed in to change notification settings - Fork 1
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
Choose filters to apply #1
Conversation
Regarding the |
38df03f
to
adff788
Compare
By all means — integrating that change here seems like a sensible approach. Thank you for suggesting that and for jumping on these changes! 😁 |
Moved the Part of the Pelican tests output:
|
If the following relevant comment is to be believed, the
That being the case, perhaps the Pelican test should be updated to no longer require |
Yes, I think the Pelican test should be changed. My understanding of the comment on |
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.
Many thanks for these enhancements, David! 🏅
@davidlesieur: Would you be willing to submit a pull request to Pelican to modify the aforementioned test? That way, as soon as I publish the next Typogrify release, we can merge that Pelican PR and ensure tests continue to pass. What do you think? |
Following up on getpelican/pelican#3436, here's a take at making the
typogrify()
function more flexible by allowing one to select which filters to apply.Some remarks about the proposed changes:
applyfilters()
andtypogrify()
short while avoiding name clashes with their corresponding filter functions, they are accessed throughkwargs.pop()
. That makes the function signatures less self-explanatory, but I am mentioning the keyword arguments in the docstrings.applyfilters()
totypogrify()
, because it was specifically testingtypogrify()
.widont
ignores theignore_tags
list, and then discovered that this issue had already been reported in Move widont filter to applyfilters function mintchaos/typogrify#30. I have added a comment and a test about this behavior. I understand thatwidont
only applies to a hardcoded list of tags, but it probably makes the API less predictable to one who wouldn't fully read the documentation or code. However, this would perhaps be better addressed separately from this PR.