naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.04k stars 317 forks source link

[FEATURE]: Add command line tool for rendering large brews into a pdf #802

Open AlexeySachkov opened 5 years ago

AlexeySachkov commented 5 years ago

A lot of users have problems with rendering large brews: Chrome hangs, crashes, etc.

I propose some kind of a solution/workaround for this problem. The main idea is to distribute some console application which perform conversion from brew source code into a pdf without using browser.

Here is example of usage:

render-brew source_code.txt -o my_brew.pdf # converts brew code saved in source_code.txt into a pdf file named my_brew
render-brew http://homebrewery.naturalcrit.com/share/HkWWfylvum -o my-brew-2.pfd # converts brew by using share link into a pdf file named my-brew-2

I expect that such solution will require less resources (RAM) to render large brews

tcyrus commented 4 years ago

@AlexeySachkov Your second command can be done using something like this

chrome --headless --print-to-pdf="my-brew-2.pdf" https://homebrewery.naturalcrit.com/print/HkWWfylvum
tcyrus commented 4 years ago

@AlexeySachkov I built something that you might find useful https://github.com/tcyrus/homebrewery-standalone