diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-02-01 11:42:41 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-02-01 11:42:41 (GMT) |
commit | f0c20584e7299c11e6eebad3d8388c4618863e94 (patch) | |
tree | bc226231b1464a40c0fe30d70f631bd12efbc2e4 /markdown | |
parent | 36828cf89af8fa3b49c44286c156e61558a36a43 (diff) |
Generate an html doc
Formatting fixes, no real content changes.
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) |