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

Add IS_FILE_RENDERED filter to enhance file processing flexibility #1062

Merged

Conversation

Abdul-Muqadim-Arbisoft
Copy link
Contributor

@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft commented May 8, 2024

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 .

@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft added the enhancement Enhancements will be processed by decreasing priority label May 9, 2024
@Abdul-Muqadim-Arbisoft Abdul-Muqadim-Arbisoft self-assigned this May 9, 2024
tutor/env.py Outdated

@hooks.Filters.IS_FILE_RENDERED.add()
def _do_not_render_binary_files(result: bool, path: str) -> bool:
"""Return bianry file"""
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concern addressed

@hinakhadim
Copy link
Contributor

@DawoudSheraz @regisb I have tested this and working fine. Can you plz review it?

@DawoudSheraz
Copy link
Contributor

@hinakhadim This is waiting on your review, thanks.

@DawoudSheraz DawoudSheraz merged commit d682b74 into overhangio:master May 28, 2024
2 checks passed
@DawoudSheraz DawoudSheraz deleted the muqadim/is-file-rendered-filter branch May 28, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancements will be processed by decreasing priority
Projects
Development

Successfully merging this pull request may close these issues.

Template rendering failure when installing theme plugin
3 participants