Closed thomas-maurice closed 9 months ago
Thanks for the review!
I'd also like to float an idea out there... any interest in just replacing the extendedDetails HTML implementation with markdown while in the neighborhood?
I can definitely do that.
My alerts are also pretty vanilla but it is nice to add some markdown in the templates for links, highlighting important labels and so on, so i figured why not add a bit of style to my notifications saying that my homelab is down
I'll get to it over the weekend :)
@DRuggeri fixed, and updated the pull request description to reflect the change/give you all you need to test it on your side if you want to !
This pull request enables the support for markdown being rendered properly on the client side via a
--markdown
flag (or the correspondingMARKDOWN
environment variable). This also removes the support for HTML as it is not supported on gotify mobile.This has the side effect of not allowing to add colours in the notifications, but that didn't work initially anyways.
Similarly it allows to set a
--click_to_generator
flag (CLICK_TO_GENERATOR
environment variable) that allows to make the client notification clickable when opened on mobile. Previously this behaviour implied the use of--extended_details
, but this would also force the use of HTML, which is not supported (as per #31 and my own testing).End result, the following alert would show up as follows
On web:
On the app:
The notification sends me to the generator URL specified in the alert when I click on it on mobile, and nothing happens when the generator URL is absent from the json.
For reproducibility, the templates I used are: title.tmpl:
main.tmpl: