-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc_script.py
42 lines (28 loc) · 909 Bytes
/
doc_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
import time, datetime
import argparse
dic = {
'title': '',
'description': '',
'keywords': [],
'tags': [],
'date': ''
}
def get_update_time(filepath):
return time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(os.path.getmtime(filepath)))
def gen_frontmatter(filepath):
...
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-a", dest="author")
parser.add_argument("--authors", dest="authors", default='Qiuwen')
args = parser.parse_args()
if os.path.exists('docone/blog'):...
title, description = input("title: "), input("description: ")
keywords, tags = input("keywords: ").split('/'), input("tags: ").split('/')
if args.author:
dic['author'] = args.author
else:
dic['authors'] = args.authors
# gen_frontmatter('./doc_script.py')
print(args, keywords, tags)