-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate
More file actions
executable file
·25 lines (19 loc) · 871 Bytes
/
generate
File metadata and controls
executable file
·25 lines (19 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
import argparse
import os.path
import subprocess
def main():
parser = argparse.ArgumentParser(description="Simple driver for pandoc. Or use pandoc directly for more options.")
parser.add_argument("--format", help="Output format", default="beamer")
parser.add_argument("--incremental", "-i", help="Incremental display of lists", default=False, action="store_true")
parser.add_argument("source", help="Source markdown file")
args = parser.parse_args()
output = os.path.splitext(args.source)[0] + ".pdf" #".tex"
pan_args = ["pandoc", "-f", "markdown", "-V", "theme:PaloAlto"]
if args.incremental:
pan_args.append("-i")
pan_args.extend(["--write", "beamer", "-o", output, args.source])
print "Executing:", " ".join(pan_args)
subprocess.check_call(pan_args)
if __name__ == "__main__":
main()