1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-19 06:06:54 +00:00

Improved script tools.

This commit is contained in:
Cotes Chung
2020-04-02 23:25:19 +08:00
parent ad992db75f
commit 214480613e
4 changed files with 44 additions and 13 deletions

View File

@@ -11,6 +11,8 @@ MIT License
'''
import sys
import os
import glob
def get_yaml(path):
@@ -37,6 +39,16 @@ def get_yaml(path):
return yaml, num
def get_makrdown_files(path):
MD_EXTENSIONS = ["md", "markdown", "markdn", "mdown"]
ret_files = []
for extension in MD_EXTENSIONS:
ret_files.extend(glob.glob(os.path.join(path, "*." + extension)))
return ret_files
def check_py_version():
if not sys.version_info.major == 3 and sys.version_info.minor >= 5:
print("WARNING: This script requires Python 3.5 or higher, "