Skip to content

Commit 5182a5a

Browse files
authored
Update event.py
Added to_markdown_string() function, that outputs the event details in the required markdown format.
1 parent 2571e10 commit 5182a5a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/events-automation/event.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ def __init__(self, name, location, date, url, virtual, organizerName, maybeSpam,
1111
self.recurring = recurring
1212
self.inPast = inPast
1313
self.maybeSpam = maybeSpam
14+
15+
def to_markdown_string(self) -> str:
16+
if self.virtual:
17+
return f'* {self.date} | Virtual ({self.location}) | [{self.organizerName}](TODO: ORGANISER URL HERE)\n\t*[**{self.name}**]({self.url})'
18+
else:
19+
return f'* {self.date} | {self.location} | [{self.organizerName}](TODO: ORGANISER URL HERE)\n\t*[**{self.name}**]({self.url})'
20+

0 commit comments

Comments
 (0)