blob: 3afb7b8fa3ba5ec66504e8ad04160967d090e8d5 (
plain)
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
|
#!/usr/bin/python3
import os
import argparse
import markdown2
parser = argparse.ArgumentParser(description="Format markdown text")
parser.add_argument("input_file_path", nargs=1, help="Input file path")
args = parser.parse_args()
output = """
<!DOCTYPE html>
<html lang="en">
<head>
<link href="http://fonts.googleapis.com/css?family=Droid+Serif"
rel="stylesheet"
type="text/css"/>
<link href="http://fonts.googleapis.com/css?family=Droid+Sans"
rel="stylesheet"
type="text/css"/>
<link href="markdown.css" rel="stylesheet"></link>
</head>
<body>
"""
with open(args.input_file_path[0]) as f:
output += markdown2.markdown(f.read())
output += """
</body>
</html>
"""
print(output)
|