diff options
Diffstat (limited to 'markdown')
-rwxr-xr-x | markdown | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/markdown b/markdown new file mode 100755 index 0000000..c79afd3 --- /dev/null +++ b/markdown @@ -0,0 +1,33 @@ +#!/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="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) |