disable pdf export via rest in prod mode
This commit is contained in:
parent
7a5698467f
commit
152efedf7a
42
README.md
42
README.md
@ -13,8 +13,13 @@ Strings surrounded with quotation marks
|
|||||||
|
|
||||||
The [marp-cli](https://github.com/marp-team/marp-cli) can be used to convert the md to pdf:
|
The [marp-cli](https://github.com/marp-team/marp-cli) can be used to convert the md to pdf:
|
||||||
- Stand alone linux package https://github.com/marp-team/marp-cli/releases
|
- Stand alone linux package https://github.com/marp-team/marp-cli/releases
|
||||||
|
- run as server with PORT=5000 marp -s ./slides
|
||||||
|
- requires wget for download
|
||||||
|
- requires chrome to convert to pdf
|
||||||
- docker container https://hub.docker.com/r/marpteam/marp-cli/
|
- docker container https://hub.docker.com/r/marpteam/marp-cli/
|
||||||
`docker run --rm --init -v $PWD:/home/marp/app/ -e LANG=$LANG marpteam/marp-cli slide-deck.md --pdf`
|
`docker run --rm --init -v $PWD:/home/marp/app/ -e LANG=$LANG marpteam/marp-cli slide-deck.md --pdf`
|
||||||
|
- Run marp cli in its own docker container in server mode!!!
|
||||||
|
- output folder as volumne, so that marp container can assess it
|
||||||
|
|
||||||
powerpoint export is also possible with --pptx
|
powerpoint export is also possible with --pptx
|
||||||
|
|
||||||
@ -32,5 +37,42 @@ https://pythonise.com/series/learning-flask/flask-uploading-files
|
|||||||
python docker wait for container
|
python docker wait for container
|
||||||
|
|
||||||
|
|
||||||
|
CLI binary:
|
||||||
|
|
||||||
|
convert file
|
||||||
|
./marp --pdf ./slides/slide-deck.md
|
||||||
|
./marp --pdf ./slides/slide-deck.md
|
||||||
|
/opt/marp --pdf /code/csv-to-marp-converter/
|
||||||
|
|
||||||
|
start server
|
||||||
|
./marp --pdf --server ./slides/
|
||||||
|
PORT=4100 /opt/marp-cli --server ./
|
||||||
|
|
||||||
|
|
||||||
|
use marp server:
|
||||||
|
- link or embed marp server path (http://localhost:8080/) from result html
|
||||||
|
- Dockerfile
|
||||||
|
- download latest marp binary
|
||||||
|
- start server (on correct port)
|
||||||
|
|
||||||
|
wget -O marp-cli.tar.gz https://github.com/marp-team/marp-cli/releases/download/v1.1.1/marp-cli-v1.1.1-linux.tar.gz
|
||||||
|
|
||||||
|
|
||||||
|
when running release version from
|
||||||
|
|
||||||
|
[ WARN ] The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.
|
||||||
|
[ ERROR ] Failed converting Markdown. (You have to install Google Chrome, Chromium, or Microsoft Edge to convert slide deck with current options.)
|
||||||
|
|
||||||
|
|
||||||
|
when running cli with docker
|
||||||
|
docker run -v $PWD:/home/marp/app/ -e LANG=$LANG marpteam/marp-cli quiz-slides-template.md --pdf
|
||||||
|
|
||||||
|
[ ERROR ] Failed converting Markdown. (EACCES: permission denied, open
|
||||||
|
'/home/marp/app/quiz-slides-template.pdf')
|
||||||
|
|
||||||
|
chmod -R 0777 output/
|
||||||
|
|
||||||
|
docker run -v $PWD:/home/marp/app/ -e LANG=$LANG -e PORT=4100 -p 4100:4100 marpteam/marp-cli --server ./ -d
|
||||||
|
|
||||||
|
docker run -d -v /home/marcelo/git/docker-python-multi-service/csv-to-marp-converter/output:/home/marp/app/ -e LANG=$LANG -e PORT=4100 -p 4100:4100 marpteam/marp-cli --server ./
|
||||||
|
|
||||||
|
@ -64,6 +64,9 @@ def upload_image():
|
|||||||
csv_file.save(output_file_path)
|
csv_file.save(output_file_path)
|
||||||
|
|
||||||
# run converter
|
# run converter
|
||||||
|
if config_parser.prod_mode:
|
||||||
|
converter.convert(output_file_path, False)
|
||||||
|
else:
|
||||||
converter.convert(output_file_path, True)
|
converter.convert(output_file_path, True)
|
||||||
|
|
||||||
return render_template("return_result.html")
|
return render_template("return_result.html")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user