diff options
Diffstat (limited to 'gen_md.py')
-rwxr-xr-x | gen_md.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -2,6 +2,7 @@ import sys import os import shutil +import argparse import subprocess from pprint import pprint from data_lib import load_data, decode_auto @@ -41,14 +42,19 @@ def gen_previews(): resize(img_path, img_preview_path) def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--with-previews', action='store_true') + args = parser.parse_args() + data = load_data(sort='date') - print("Generating previews (don't forget to git add them)...") - gen_previews() + if args.with_previews: + print("Generating previews (don't forget to git add them)...") + gen_previews() print("Generating page...") - buf = [] + for post in data: cipher_type = post['type'] if 'type' in post else 1 if cipher_type in (1, 2): |