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

Feature Request: create Linux command-line version to do converting from markdown to HTML files and PDFs #129

Open
ElectricRCAircraftGuy opened this issue Oct 8, 2020 · 1 comment
Labels

Comments

@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented Oct 8, 2020

Currently I use your tool manually to view a markdown file in Chrome then print it to a PDF from Chrome. See my answer here: https://superuser.com/questions/689056/how-can-i-convert-github-flavored-markdown-to-a-pdf/1591372#1591372.

However, I'd really like to be able to automate this by running a single command from the command-line. Perhaps you could help make this happen?

Example usage:

markdown2pdf readme.md  # convert readme.md to readme.pdf

If not, where should I begin in your code? If it is super simple I might be able to make time for it to do the PR myself.


Note: you may need to use Chrome's headless mode somehow to open and save a markdown to HTML file as PDF? See here and here and here: https://developers.google.com/web/updates/2017/04/headless-chrome.

@simov
Copy link
Owner

simov commented Oct 8, 2020

If you need it rendered with a specific theme before exporting, then yes, you need a renderer. So the way I would do it is by using https://www.npmjs.com/package/puppeteer to render the document and trigger the PDF export. Either way that's a tool outside of this project.

@simov simov added the question label Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants