summaryrefslogtreecommitdiff
path: root/gen_md.py
diff options
context:
space:
mode:
authorrusinthread <rusinthread@cock.li>2017-01-18 16:57:44 +0300
committerrusinthread <rusinthread@cock.li>2017-01-18 16:57:44 +0300
commit73011a22c2be57079a40bec230cd9f80bfc829af (patch)
tree87c6b89e86610726906205a150d3061a35b71f0c /gen_md.py
parent6f98b826299808f446c88be993ef244b31cf4431 (diff)
add new ciphertexts
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):