kohheepeace / docusaurus-pdf

Generate PDF for docusaurus
https://drive.google.com/file/d/19P3qSwLLUHYigrxH3QXIMXmRpTFi4pKB/view
113 stars 18 forks source link

feat: support generating PDF for hosted docusaurus site #3

Closed maxarndt closed 4 years ago

maxarndt commented 4 years ago

Hey @KohheePeace!

I added support for docusaurus websites which where built and are hosted somewhere. So people don't need the sources and don't have to run npx docusaurus start.

Now there is some code which extracts the styles*.js and styles*.css from the HTML in order to be able to support websites which were created by docusaurus build. The function text() is used on the response of page.goto() to get the HTML of the page. Next, some regex is used to extract the paths of the mentioned files.

As a consequence I removed the newly introduced baseUrl parameter because I didn't see any further necessity to keep it. Because this is a non backward compatible change I bumped the version to 1.0.0. But feel free to adjust this if you like to handle the versioning in another way.

What do you think about this little change?

kohheepeace commented 4 years ago

@maxarndt Thanks! Looks great to me!