feat: Change count display to lead with count
The actual count is now the first item on each line, to make it easier to sort, strip, delete and compare afterwards.
This commit is contained in:
parent
d087c366c3
commit
b5c081fbf3
2 changed files with 4 additions and 4 deletions
|
@ -66,10 +66,10 @@ def format_count(
|
|||
count += 1
|
||||
|
||||
return (
|
||||
f"{count} "
|
||||
f"{document.get('author', '')}"
|
||||
f"{' - ' if 'author' in document else ''}" # only put separator if author
|
||||
f"{document.get('title', '')}: "
|
||||
f"{count}\n"
|
||||
f"{': ' if 'author' in document else ''}" # only put separator if author
|
||||
f"{document.get('title', '')}"
|
||||
).rstrip()
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ def test_markdown_setext():
|
|||
|
||||
def test_count_default():
|
||||
fmt = format_count
|
||||
assert fmt(document, annotations) == ("""document-author - document-title: 2""")
|
||||
assert fmt(document, annotations) == ("""2 document-author: document-title""")
|
||||
|
||||
|
||||
def test_csv_default():
|
||||
|
|
Loading…
Reference in a new issue