-
Notifications
You must be signed in to change notification settings - Fork 456
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
Add IS_FILE_RENDERED filter to enhance file processing flexibility #1062
Add IS_FILE_RENDERED filter to enhance file processing flexibility #1062
Conversation
tutor/env.py
Outdated
|
||
@hooks.Filters.IS_FILE_RENDERED.add() | ||
def _do_not_render_binary_files(result: bool, path: str) -> bool: | ||
"""Return bianry file""" |
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.
nit: the docstring does not make sense. Please update it.
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.
concern addressed
@@ -0,0 +1 @@ | |||
- [Feature] Introduces the IS_FILE_RENDERED Filter, enabling developers to specify files that should be copied without rendering. (by @Abdul-Muqadim-Arbisoft) |
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.
nit: having a bit more context here can be helpful for the devs.
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.
concern addressed
@DawoudSheraz @regisb I have tested this and working fine. Can you plz review it? |
@hinakhadim This is waiting on your review, thanks. |
resolved #975
Description:
This pull request introduces a new filter, IS_FILE_RENDERED, designed to enhance the flexibility of file handling within Tutor plugins. The new IS_FILE_RENDERED filter allows plugin developers to specify files that should not be rendered but instead copied .
Implementation Details:
The IS_FILE_RENDERED filter works by accepting a boolean flag and a file path. It returns a boolean indicating whether the file should be rendered. By default, all files are set to be rendered unless explicitly specified .