(no title)
pavs | 2 years ago
sudo apt install pandoc wkhtmltopdf
npm install -g readability-cli
pandoc -s https://www.paulgraham.com/avg.html -o output.html && readable output.html -o readable.html && wkhtmltopdf readable.html output.pdf && open output.pdf
going even further using bash script to prompt for url. #!/bin/bash
# Prompt the user for a URL
read -p "Enter the URL: " URL
# Use the URL in the pandoc command
pandoc -s $url -o output.html && readable output.html -o readable.html && wkhtmltopdf readable.html output.pdf && open output.pdf
chmod +x web2pdf.sh
# add an alias to bashrc
alias web2pdf='/path/to/your/web2pdf.sh'
source ~/.bashrc
bananskalhalk|2 years ago
Which is pretty much what OP did, with a few nice additions like nice output and some custom css and fonts. Which is nice and OP hope brings value to people.
If you add a few printf:s and include a nice template for pandoc* it would be more along the same thing.
*) Neither pandoc, wkhtmlpdf or weasyprint have (in my opinion) bad default templates.
natrys|2 years ago
worldsayshi|2 years ago
psanford|2 years ago
[1]: https://github.com/wkhtmltopdf/wkhtmltopdf