mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
better version header formatting
This commit is contained in:
parent
1b263ad38f
commit
b5c4a1757e
@ -45,15 +45,14 @@ class VersionEntry:
|
||||
self.link: str = ''
|
||||
|
||||
def __str__(self) -> str:
|
||||
if self.name.lower() == 'unreleased':
|
||||
return f'## {self.name}'
|
||||
segments = ['##', self.name]
|
||||
|
||||
date_str = self.date.isoformat() if self.date else 'UNKNOWN'
|
||||
line = f'## {self.name} - {date_str}'
|
||||
for tag in self.tags:
|
||||
line += ' [' + tag.upper() + ']'
|
||||
if self.date:
|
||||
segments += ['-', self.date.isoformat()]
|
||||
|
||||
return line
|
||||
segments += [f'[{t.upper()}]' for t in self.tags]
|
||||
|
||||
return ' '.join(segments)
|
||||
|
||||
|
||||
class Changelog:
|
||||
|
Loading…
Reference in New Issue
Block a user