Created
August 6, 2013 00:34
-
-
Save Beyamor/6160968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
markdown_name = sys.argv[1] | |
name = markdown_name.split(".")[0] | |
latex_name = name + ".tex" | |
os.system("pandoc -f markdown -t latex %s -o %s" % (markdown_name, latex_name)) | |
with open(latex_name, "r") as latex_file: | |
latex_content = latex_file.read() | |
latex_content = """ | |
\documentclass[a4paper,12pt,parskip=full]{scrartcl} | |
\usepackage{setspace} | |
\doublespacing | |
\\begin{document} | |
%s | |
\end{document} | |
""" % (latex_content) | |
with open(latex_name, "w") as latex_file: | |
latex_file.write(latex_content) | |
os.system("pdflatex %s" % (latex_name)) |
I've downloaded a wiki from a github project (by replacing .git
with .wiki
) in the clone url. Now I want to convert that entire wiki to a single pdf.. Can will this script work for that?
If you face problems with packages, use pandoc -s to use pandoc templates instead of introducing headers and footers manually
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what's the usage for this script?