path to pdf
This commit is contained in:
parent
6c99e372a9
commit
acf98f1387
@ -119,11 +119,11 @@ def handle_q_and_a_row(line, list_of_q_and_as, category):
|
|||||||
def to_pdf(filename):
|
def to_pdf(filename):
|
||||||
import docker
|
import docker
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
|
|
||||||
current_dir = os.getcwd()
|
current_dir = os.getcwd()
|
||||||
print(current_dir)
|
|
||||||
|
|
||||||
# OUTPUT_FODLER = "output"
|
# OUTPUT_FODLER = "output"
|
||||||
output_folder_path = os.path.join(current_dir, OUTPUT_FODLER)
|
output_folder_path = os.path.join(current_dir, OUTPUT_FODLER)
|
||||||
|
print(output_folder_path)
|
||||||
|
|
||||||
# https://docker-py.readthedocs.io/en/stable/containers.html
|
# https://docker-py.readthedocs.io/en/stable/containers.html
|
||||||
client.containers.run('marpteam/marp-cli', '{} --pdf'.format(filename), volumes=[output_folder_path + ':/home/marp/app/'],
|
client.containers.run('marpteam/marp-cli', '{} --pdf'.format(filename), volumes=[output_folder_path + ':/home/marp/app/'],
|
||||||
|
@ -133,7 +133,7 @@ def download_pdf_file():
|
|||||||
"""Download the .pdf file."""
|
"""Download the .pdf file."""
|
||||||
# print("sending file with name: " + filename)
|
# print("sending file with name: " + filename)
|
||||||
current_dir = os.getcwd()
|
current_dir = os.getcwd()
|
||||||
full_dir = os.path.join(current_dir, "output")
|
full_dir = os.path.join(current_dir, OUTPUT_FODLER)
|
||||||
print("full_dir: " + full_dir)
|
print("full_dir: " + full_dir)
|
||||||
return send_from_directory(full_dir, "slide-deck.pdf", as_attachment=True)
|
return send_from_directory(full_dir, "slide-deck.pdf", as_attachment=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user