Skip to content
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

Plugin hook for final text #86

Open
cyberw opened this issue Oct 18, 2022 · 1 comment
Open

Plugin hook for final text #86

cyberw opened this issue Oct 18, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@cyberw
Copy link
Contributor

cyberw commented Oct 18, 2022

In some cases it is useful to access the literal text that is about to be output by transformer, rather than accessing the AST.

This could of course be done in post-processing step, but integrating it all into transformer is nice for useability.

Some use cases:

  • Apply code formatting (e.g. Black)
  • Add any code that is separate from the actual requests (e.g. event handler registration this could be done using regular hooks, but it is complex) (solved this case using OpaqueBlock)

I can probably implement this myself, as just another plugin hook, called with the complete text just before output. If it sounds good to you @thilp

@cyberw cyberw added the enhancement New feature or request label Oct 18, 2022
@cyberw
Copy link
Contributor Author

cyberw commented Oct 18, 2022

Because I found OpaqueBlock this just fell way down my prio list :) (so I wont start working on it myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant