import sys, cook2tex def create_book(argv): """ Takes: [ string ] argv Returns: [ string ] tex Takes multiple recipe paths as arguments and returns a complete latex document. One element per line. """ tex = [] tex.append("\\documentclass{article}") tex.append("\\usepackage{cuisine}") tex.append("\n") tex.append("\\begin{document}") for path in argv: tex.append("\n") tex += cook2tex.parse_recipe_from_file(path) tex.append("\n") tex.append("\\end{document}") return tex if __name__ == "__main__": for line in create_book(sys.argv[1:]): print(line)