forked from FOSS-Community/progress-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.py
32 lines (23 loc) · 1.05 KB
/
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
import os
import time
import argparse as parsing
parser = parsing.ArgumentParser(description="ReadME.md to .html writer",formatter_class=parsing.ArgumentDefaultsHelpFormatter)
parser.add_argument('-i', '--input', action='store', type=str, required=True, help="name of the input file eg. template.html")
parser.add_argument('-t', '--title', action='store', type=str, default='Progress', help="title of the html page." )
parser.add_argument('-o', '--output', action='store', type=str, required=True, help="the generated output file name , which is generated in dist folder. eg. template.html")
args = parser.parse_args()
FILE_NAME = args.input
TITLE = args.title
OUTPUT_NAME = args.output
try:
os.system('npm install github-readme-to-html')
except:
print("NPM is not Installed")
print("Try : sudo apt install nodejs | sudo apt install npm ")
time.sleep(5)
print("Wait While The File is Converting")
time.sleep(15)
try:
os.system(f'npx github-readme-to-html -i {FILE_NAME} -t {TITLE} -o {OUTPUT_NAME}')
except:
print("Please Check If file is exit")