-
Notifications
You must be signed in to change notification settings - Fork 7
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
Hooks on the data structure/event before/after event_from_yaml #44
Comments
Hi Richard, that could make sense. Are you thinking adding this as an argument when invoking yaml2ics as a script? And it gets the event as a string and returns it as a string? |
Hm, interesting idea... I didn't think of that. So far I was just thinking through the Python API, since that's how I use it (but python API should come first anyway). Since my entry point is Or... what would you say about adding a |
What should the hooks do, just so I can form an idea around what's needed? |
in this case my hook would be: if 'description_suffix' in event_data:
event_data['description'] = '\n\n'.join(event_data['description'], event_data.pop('description_suffix')) ... and maybe the equivalent for ... of course I could directly add this. On second thought, maybe it's useful for more people (except that the yaml templating isn't included in examples, I think...) |
Perhaps the easiest would be:
Would that work for your use-case? |
I'd be interested in a way to run hooks on the
event_yaml
(= loaded data structures) andevent
at the start/end ofevent_from_yaml
. Would you like that feature here, and if so, do you have any suggestions for implementing it? If you would like it, I can try an initial implementation (the only major problem is "how to pass arguments into there - do we carry around hooks between all the functions, or make something global?").My alternative option is to monkey-patch hooks in, but something clean+supported would be better... if we can find it.
(in this case, I would like to have a way to have a description_suffix that would be appended to the description. This would make template events with
&label
and<<: *label
) cleaner... but I expect that hooks would be better than making yaml2ics too specific to my needs...The text was updated successfully, but these errors were encountered: