summaryrefslogtreecommitdiff
path: root/gen_md.py
diff options
context:
space:
mode:
Diffstat (limited to 'gen_md.py')
-rwxr-xr-xgen_md.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/gen_md.py b/gen_md.py
index 29b704f..5780360 100755
--- a/gen_md.py
+++ b/gen_md.py
@@ -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):