🎨 make the markdown file configuration explicit

This commit is contained in:
mi
2025-11-14 16:00:03 +10:00
parent 04cd72b8d8
commit f7c32ca749
4 changed files with 55 additions and 14 deletions

View File

@@ -53,7 +53,7 @@ def main():
"""Add a new comic entry with defaults"""
parser = argparse.ArgumentParser(description='Add a new comic entry to comics_data.py')
parser.add_argument('-m', '--markdown', action='store_true',
help='Generate a markdown file for author notes')
help='Generate a markdown file for author notes and add author_note_md field to comic entry')
args = parser.parse_args()
# Get next number
@@ -77,7 +77,16 @@ def main():
content = f.read()
# Format new entry
entry_str = f""" {{
if args.markdown:
entry_str = f""" {{
'number': {comic['number']},
'filename': {repr(comic['filename'])},
'date': {repr(comic['date'])},
'alt_text': {repr(comic['alt_text'])},
'author_note_md': {repr(comic['date'] + '.md')}
}}"""
else:
entry_str = f""" {{
'number': {comic['number']},
'filename': {repr(comic['filename'])},
'date': {repr(comic['date'])},