Skip to content

Commit

Permalink
Show event description (#56)
Browse files Browse the repository at this point in the history
Make use of the description property on events render it as html or as text in a span.
  • Loading branch information
changbowen authored Feb 1, 2024
1 parent c5188ac commit 69d9ee2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions neoteroi/mkdocs/projects/gantt/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,15 @@ def build_event(self, parent, event: Event):
if event.icon:
build_icon_html(dot_element, event.icon)

if event.description:
try:
des = etree.fromstring(event.description)
except etree.ParseError:
des = etree.fromstring(f"<span>{event.description}</span>")

des.set("class", f"description {des.get('class') or ''}")
dot_element.append(des)

def _calc_time_left(self, time: Union[date, datetime]) -> float:
delta = (
time
Expand Down

0 comments on commit 69d9ee2

Please sign in to comment.