Skip to content

Commit

Permalink
Merge pull request #1294 from juw/url-separator
Browse files Browse the repository at this point in the history
Add url-separator
  • Loading branch information
geier authored Oct 24, 2023
2 parents f008bba + d2889c2 commit 3877aac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ Michael Tretter - michael.tretter [at] posteo [dot] net
Raúl Medina - raulmgcontact [at] gmail (dot] com
Matthew Rademaker - matthew.rademaker [at] gmail [dot] com
Valentin Iovene - val [at] too [dot] gy
Julian Wollrath
3 changes: 3 additions & 0 deletions doc/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ Several options are common to almost all of :program:`khal`'s commands
url
The URL embedded in the event, otherwise nothing.

url-separator
A separator: " :: " that appears when there is a url.

By default, all-day events have no times. To see a start and end time anyway simply
add `-full` to the end of any template with start/end, for instance
`start-time` becomes `start-time-full` and will always show start and end times (instead
Expand Down
3 changes: 3 additions & 0 deletions khal/khalendar/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ def format(self, format_string: str, relative_to, env=None, colors: bool=True):
attributes["categories"] = self.categories
attributes['uid'] = self.uid
attributes['url'] = self.url
attributes['url-separator'] = ""
if attributes['url']:
attributes['url-separator'] = " :: "

if "calendars" in env and self.calendar in env["calendars"]:
cal = env["calendars"][self.calendar]
Expand Down

0 comments on commit 3877aac

Please sign in to comment.