-
Notifications
You must be signed in to change notification settings - Fork 0
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
Templating system #7
Comments
One bug I encountered recently in If such a templating system were to be implemented. It should allow for a way to automatically split up long templates, sending them piece-by-piece and recursively reply with the following segment to the previous post, to allow for the creation of threads through templating. |
Possible example implementation I found. |
The problem is, where should posts be split up? Should the responsibility of formatting be habded over to the user and posts are split up to the nearest new-line Example: A post is analyzed until a new-line is encountered. If the next new-line added to the length results in a How do we judge and test this? Where is the line? |
Another problem here is, implementing the following function def getTemplateText(filename: str, fields: Dict): -> str:
... would result in errors if the user were to change the template to include variables not included in the def getTemplateText(filename: str, *args, **kwargs): -> str:
fields = self.variables # Some dict with a bunch of variables This way were |
Problem
MastoBot
is intended to simplify the process of creating bots for Mastodon. This involves allowing the user to perform actions on notifications and filtering them, but often, users would like to respond to a notification with a post.This can easily be done in code, but
Jinja2
templates are by far the most sustainable and future-proof method to do this.It would allow for better customization and better implementations, and templates could also be easily shared between users but still allow for a personalized touch.
Such a templating system is generic enough to be part of
MastoBot
The text was updated successfully, but these errors were encountered: