Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

A Few Minor Enhancements #12

Merged
merged 1 commit into from
Apr 5, 2016
Merged

A Few Minor Enhancements #12

merged 1 commit into from
Apr 5, 2016

Conversation

ekristen
Copy link
Contributor

@ekristen ekristen commented Apr 4, 2016

Hey Mihkel,

Thanks for the awesome service. We found that with one of our tools, the contents we wanted in the PDF wasn't always ready when the DOM was loaded, so we added a few options.

I also made some improvements to the dockerfile so that the build layers could be cached and not always rebuilt. When making code changes, only the last few layers get updated vs all the apt-get install command running again.

  • Dockerfile is now more cachable
  • Adds docker-compose.yml to help facilitate development
  • Adds two url options delay and waitForText
    • delay should be an integer expressed in seconds, when specified the pdf generation will delay until the time is met.
    • waitForText should be a string that will eventually appear. The application will continually scan until such time the text is found or the TIMEOUT is reached. Once the text is found the PDF will get generated. This is useful if text is loaded via XHR or websocket requests after the inital dom is ready.

@msokk
Copy link
Owner

msokk commented Apr 5, 2016

Hi!

Thanks for the pull request.

I have written Dockerfiles mostly with Alpine Linux as base, so I kinda optimized too much for minimal number of layers. As the image is big anyway, optimizing for caching makes sense.

delay and waitForText are good to have. I personally haven't rendered any dynamically generated content with this yet - static pages with CSS3 + Webfonts so far.

What do you think about HTTP API being sync? Any problems?
I went with this way initially as it keeps things more simple and I'm generating PDFs in a background workers anyway.

Anyway, will merge the PR, clean up some linter errors and release it as 0.5.0.
I'll try to get an CI with some integration up too.

@msokk msokk merged commit eebc425 into msokk:master Apr 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants