Skip to content

Commit 7350d21

Browse files
Mark Knoopmarkk
authored andcommitted
Add location-separator field
Analogous to `description-separator` and `url-separator` this can be used in a format string when the `location` information is desired.
1 parent 37d9c64 commit 7350d21

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

doc/source/usage.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ Several options are common to almost all of :program:`khal`'s commands
118118
location
119119
The event location.
120120

121+
location-separator
122+
A separator: " @ " that appears when there is a location.
123+
121124
calendar
122125
The calendar name.
123126

khal/khalendar/event.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,9 @@ def fmt(s: str) -> str: return s.strip()
738738
if attributes["description"]:
739739
attributes["description-separator"] = " :: "
740740
attributes["location"] = self.location.strip()
741+
attributes["location-separator"] = ""
742+
if attributes["location"]:
743+
attributes["location-separator"] = " @ "
741744
attributes["attendees"] = self.attendees
742745
attributes["all-day"] = str(allday)
743746
attributes["categories"] = self.categories

0 commit comments

Comments
 (0)