Wiki: Improve examples with code tags

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-08-27 23:26:29 +02:00
parent 690365f56b
commit 124a65bcfd
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 4 additions and 4 deletions

View file

@ -173,7 +173,7 @@ func (m modStreamSchedule) cronUpdateSchedule() {
} }
func (m modStreamSchedule) formatTime(t time.Time) string { func (m modStreamSchedule) formatTime(t time.Time) string {
// @attr timezone optional string "UTC" Timezone to display the times in (e.g. "Europe/Berlin") // @attr timezone optional string "UTC" Timezone to display the times in (e.g. `Europe/Berlin`)
tz, err := time.LoadLocation(m.attrs.MustString("timezone", ptrString("UTC"))) tz, err := time.LoadLocation(m.attrs.MustString("timezone", ptrString("UTC")))
if err != nil { if err != nil {
log.WithError(err).Fatal("Unable to load timezone") log.WithError(err).Fatal("Unable to load timezone")
@ -181,7 +181,7 @@ func (m modStreamSchedule) formatTime(t time.Time) string {
return localeStrftime( return localeStrftime(
t.In(tz), t.In(tz),
// @attr time_format optional string "%b %d, %Y %I:%M %p" Time format in [limited strftime format](https://github.com/Luzifer/discord-community/blob/master/strftime.go) to use (e.g. "%a. %d.%m. %H:%M Uhr") // @attr time_format optional string "%b %d, %Y %I:%M %p" Time format in [limited strftime format](https://github.com/Luzifer/discord-community/blob/master/strftime.go) to use (e.g. `%a. %d.%m. %H:%M Uhr`)
m.attrs.MustString("time_format", ptrString("%b %d, %Y %I:%M %p")), m.attrs.MustString("time_format", ptrString("%b %d, %Y %I:%M %p")),
// @attr locale optional string "en_US" Locale to translate the date to ([supported locales](https://github.com/goodsign/monday/blob/24c0b92f25dca51152defe82cefc7f7fc1c92009/locale.go#L9-L49)) // @attr locale optional string "en_US" Locale to translate the date to ([supported locales](https://github.com/goodsign/monday/blob/24c0b92f25dca51152defe82cefc7f7fc1c92009/locale.go#L9-L49))
m.attrs.MustString("locale", ptrString("en_US")), m.attrs.MustString("locale", ptrString("en_US")),

View file

@ -147,8 +147,8 @@ Posts stream schedule derived from Twitch schedule as embed in Discord channel
| `locale` | | string | `en_US` | Locale to translate the date to ([supported locales](https://github.com/goodsign/monday/blob/24c0b92f25dca51152defe82cefc7f7fc1c92009/locale.go#L9-L49)) | | `locale` | | string | `en_US` | Locale to translate the date to ([supported locales](https://github.com/goodsign/monday/blob/24c0b92f25dca51152defe82cefc7f7fc1c92009/locale.go#L9-L49)) |
| `schedule_entries` | | int64 | `5` | How many schedule entries to add to the embed as fields | | `schedule_entries` | | int64 | `5` | How many schedule entries to add to the embed as fields |
| `schedule_past_time` | | duration | `15m` | How long in the past should the schedule contain an entry | | `schedule_past_time` | | duration | `15m` | How long in the past should the schedule contain an entry |
| `time_format` | | string | `%b %d, %Y %I:%M %p` | Time format in [limited strftime format](https://github.com/Luzifer/discord-community/blob/master/strftime.go) to use (e.g. "%a. %d.%m. %H:%M Uhr") | | `time_format` | | string | `%b %d, %Y %I:%M %p` | Time format in [limited strftime format](https://github.com/Luzifer/discord-community/blob/master/strftime.go) to use (e.g. `%a. %d.%m. %H:%M Uhr`) |
| `timezone` | | string | `UTC` | Timezone to display the times in (e.g. "Europe/Berlin") | | `timezone` | | string | `UTC` | Timezone to display the times in (e.g. `Europe/Berlin`) |