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

Accept input from stdin #15

Closed
Walnuts opened this issue Nov 18, 2010 · 4 comments
Closed

Accept input from stdin #15

Walnuts opened this issue Nov 18, 2010 · 4 comments

Comments

@Walnuts
Copy link

Walnuts commented Nov 18, 2010

I would like to be able to accept input from stdin so that html can be piped to it. For example, to convert from markdown to pdf, you could:

$ Markdown.pl test.md | wkpdf --output test.pdf
@plessl
Copy link
Owner

plessl commented Nov 18, 2010

I had planned to add this feature for a long time since it is good Unix tool practice to read from stdin. However, due to a bug in a the NSUrlConnection class, supporting reading from stdin in a natural way was not possible.

The good news is, that I have tried, whether this bug in NSUrlConnection still exists and a quick test revealed that the problem has probably been fixed in a recent OS X upgrade.

Could you please check, whether the following command works? If so, I will revise the command line interface to read from stdin if no --input argument is specified.

$ Markdown.pl test.md | wkpdf --input file:///dev/stdin --output test.pdf

@Walnuts
Copy link
Author

Walnuts commented Nov 19, 2010

it works using --source instead of --input. In a similar vein, I think it would be nice to be able to easily direct output to stdout, maybe like wget does? In other words, maybe alias --output with -O, and make -O- or maybe -O -- redirect to stdout?

@plessl
Copy link
Owner

plessl commented Nov 21, 2010

I have just released an update to wkpdf which reads from stdin if no --source argument is specified.

Unfortunately, it seems that the Cocoa printing libraries do not like printing to stdout. Hence, if wkpdf should support saving to stdout, a workaround needs to be implemented. Basically its no big deal, I just need to find some time to do this. Hence for the moment I will add this to the issue tracker as feature request.

If this feature is important/urgent for you, contributions are welcome.

@Walnuts
Copy link
Author

Walnuts commented Nov 22, 2010

Printing to stdout is not urgent, just wanted to suggest it. Thanks for the help with stdin!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants