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

feat: filter to modify object #304

Merged
merged 4 commits into from
Dec 17, 2023
Merged

Conversation

theotheo
Copy link
Contributor

Hello!

At first, thank you for this plugin. So I would like to propose a very small code change.

In my template, I needed the ability to modify objects of one annotation based on others. Specifically, I have special annotations corresponding to terms, and based on them, I modify the text of adjacent annotations, turning the highlighted terms within them into links.

For this scenario, I needed the ability to actually modify objects. This is possible in Jinja, but as described in the issue, Nunjucks does not support this functionality. Therefore, I decided to add the very simple filter suggested in the comments on the issue.

I understand that the scenario I described is probably quite rare. However, the code changes themselves are minimal, and it might enable someone to implement similar or even more interesting export variations. I tried to provide a brief but illustrative explanation of the use case in the documentation update.

What do you think?

@mgmeyers mgmeyers merged commit 21cc3ce into mgmeyers:main Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants