Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default save location? #37

Closed
x-ji opened this issue Oct 14, 2018 · 5 comments
Closed

Default save location? #37

x-ji opened this issue Oct 14, 2018 · 5 comments
Labels
Feature New feature or enhancement question Further information is requested

Comments

@x-ji
Copy link

x-ji commented Oct 14, 2018

Sometimes I might just want to create PDFs from a list of web pages, using the page title as the default file name (using the page title is the default printing behavior of Chrome I believe).

Currently, if I run percollate without specifying --output, it claims to have saved the pdf, but I can't find it in the folder where I executed the command.

Can it just save the web page to the current folder using its title as the filename, when an --output flag is omitted?

@danburzo
Copy link
Owner

Thanks for the idea. I was not sure whether we should go for a default name when no output path is provided, or emit the PDF to stdout, so that the output can be piped to other commands. But since we already log things with console.log that would be picked up as well, so I guess having a default output path would work better.

Do you want to give it a shot in a PR? I'm thinking we can take the title property from the Readability output and run it through slugify.

Also, what should we do for multiple webpages → PDF?

@danburzo danburzo added question Further information is requested Feature New feature or enhancement labels Oct 15, 2018
@x-ji
Copy link
Author

x-ji commented Oct 15, 2018

Sure I might have time to work on it in a few days if nobody picks this up. This tool can be immensely helpful for me since I use the Sony DPT-RP1 to read long articles as PDFs.

For my use case I'd just want to save those different pages to different PDFs, as they are different articles. Previously I needed to manually print them one by one but with percollate hopefully one can produce the PDFs in one command. Maybe there's some other use case such as this one #25, which I think is separate from my intended use case though.

@danburzo
Copy link
Owner

Sounds good. I guess for multiple files we can go with percollate-<timestamp>.pdf until we figure out a better name for a bundle.

I think in #25 we're looking at using the programmatic API (#4) rather than trying to stretch the CLI to do it?

@danburzo
Copy link
Owner

Fixed in [email protected], let me know how that works for you!

@x-ji
Copy link
Author

x-ji commented Oct 15, 2018

It works. Thanks!

I think I misunderstood what you meant by multiple webpages. The current output is also useful, though ideally for me I'd want one separate PDF for one webpage, instead of putting all the pages into one PDF. Would that be hard to achieve? I might try to add this functionality, e.g. enabled by a flag. I opened a new issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or enhancement question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants