running a custom script when a page is created
Dear All,
I was wondering whether it would be possible to run a custom script when a page is created. I know that one can use templates, but templates support only 4 functions, and in fact, only one of them (strftime) is a standard python function. I believe it would be useful to let the user run whatever script they want. The particular example I have in mind is that I use calendar pages for documenting experiments, and I would like to create a folder for that particular date. I can create a link (although, I cannot use lowercase letters for months' names...), but I still have to create the folder in an external application. (Another option is to make a custom tool for this, but that is not very elegant, and it would still suffer from the limitations of strftime.) Could something like this be added to the template format:
[% IF expr %]
nothing will run here, this is only a text...
[% ELSIF expr %]
[% RUN myscript.py %]
myscript.py has run
[% END %]
I would suggest that the script runs before everything else, so its output (if any) could be inserted into the page just created.
If I got a pointer, I could try to implement this myself.
Thanks,
Zoltán
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Zim Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Zoltán Vörös
- Solved:
- Last query:
- Last reply: