arnehilmann / markdeck

presentations as code - author cool slide decks, text-only, offline-ready, collaborative
https://arnehilmann.github.io/markdeck/
MIT License
1.25k stars 38 forks source link

PDF file not created #14

Closed neilhwatson closed 4 years ago

neilhwatson commented 5 years ago

The markdown below creates a zero sized pdf file.


title: bug report pdf: slides.pdf standalone: slides.html


Code

This code does not render prpoperly in standalone slides.html

# Is indented
if [[ 0 -eq 0 ]]
then
   echo "do something"
else
   echo "do something else"
if
# Looks like this in standalone html
if [[ 0 -eq 0 ]]
then
echo "do something"
else
echo "do something else"
if

Also slides.pdf is empty

arnehilmann commented 5 years ago

Are you sure that the pdf is empty? For some reasons (I try to investigate), rendering the. pdf took a few extra rounds. But in the end it was rendered, even with correct indentation. So, please check again if the pdf is still zero size...

neilhwatson commented 5 years ago
pdf_1         | Loading page http://web:8080/index.html?render=pdf ...
web_1         | Change detected index.html
standalone_1  | 2019-03-16 22:32:23.000000000 /target/index.html
standalone_1  | 2019-03-16 22:32:23.000000000 /target/.meta/standalone_rendered
standalone_1  | finished
pdf_1         | Error: Navigation Timeout Exceeded: 20000ms exceeded
pdf_1         |     at Promise.then (/decktape/node_modules/puppeteer/lib/NavigatorWatcher.js:73:21)
pdf_1         |     at <anonymous>
pdf_1         | pdf rendering finished
^CGracefully stopping... (press Ctrl+C again to force)
Stopping markdeck-bug_standalone_1 ... done
Stopping markdeck-bug_pdf_1        ... done
Stopping markdeck-bug_web_1        ... done
Stopping markdeck-bug_markdeck_1   ... done
Stopping markdeck-bug_a2sketch_1   ... done
Stopping markdeck-bug_helper_1     ... done

neil@luna:~/src/neil/test/markdeck-bug$ ls -l deck/|grep pdf
-rw-r--r-- 1 neil neil       0 Mar 16 18:32 slides.pdf
arnehilmann commented 5 years ago

Did you wait for a few seconds before stopping the containers? How many times came the "pdf rendering finished" message?

Additionally, I need some information about your setup: OS, docker version, docker-compose content, any other content beside slides.md (assets/, include*) Thnx...

neilhwatson commented 5 years ago

Last test was on Debian 10, today I'm on a Debian 9 host and it worked. Docker-compse version 1.22.0, no extra assets added by me, just the original md file.

web_1         | GET /assets/3rdparty/reveal.js/lib/font/source-sans-pro/source-sans-pro.css 404 2.203 ms - 209
pdf_1         | starting pdf rendering
pdf_1         | Loading page http://web:8080/index.html?render=pdf ...
pdf_1         | Refused to apply style from 'http://web:8080/assets/3rdparty/reveal.js/lib/font/source-sans-pro/source-sans-pro.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
pdf_1         | Live reload enabled.
pdf_1         | Loading page finished with status: 200
pdf_1         | Reveal JS plugin activated
standalone_1  | 2019-03-18 12:15:34.000000000 /target/index.html
standalone_1  | 2019-03-18 12:15:35.000000000 /target/.meta/standalone_rendered
standalone_1  | finished
Printing slide #/a-bash-snippet (6/6) ...   
pdf_1         | Printed 6 slides
pdf_1         | pdf rendering finished
arnehilmann commented 4 years ago

the pdf renders correctly, albeit running multiple times without any changes. that's not optimal, but at least the pdf gets generated