Converting blogdown site to PDF

I would be interested in converting a blogdown site to bookdown/PDF, as per this topic.

Is there any news about the functionality mentioned in the old topic? It would be very useful.
If not, any further suggestions on how to best approach the problem?

Thanks

There is not currently a supported way to do that inside blogdown. Still a project.

However, there is new feature in blogdown to add a post processor step when building the website.

Maybe this can help build a specific solution.

Hope it helps

Thank you very much for pointing me at this.

I run the command blogdown::build_site(local = FALSE, method = c("html"), run_hugo = TRUE)

I am not sure anything different than before happened.
I looked at the documentation and at the repository on github, but I could not find the script mentioned in the documentation:

For method = "html", the R script ‘R/build2.R’ (if exists) will be executed after Hugo has built
the site. This can be useful if you want to post-process the site.

Could you please point me to where the R script R/build2.R is?
If possible, could you say what should be happening after this command is run?

Thanks a lot

Sorry for not being that clear. build2.R is a not included inside blogdown. This feature is that if a script called build2.R is provided by the user in the R folder, then it will be executed as a post processor step, after building the website. This allows someone to do whatever wanted in this step.

So maybe, you can print some pages to PDF for example in this step. Just an idea though.

Thanks for the clarification.
I will think how to use it in this case. At the moment I managed to create a bash script that takes the Rmd files from blogdown, changes the paths (where necessary) and uses bookdown to create a pdf.

It is highly specific to the existing files structure. I will see if it can be converted to R and used by the post-processor to remove some steps.

Thanks a lot!

You can also tell build2.R to execute your bash script.

At the moment I managed to create a bash script that takes the Rmd files from blogdown, changes the paths (where necessary) and uses bookdown to create a pdf.

That is pretty interesting ! Hope you'll find time to share more !

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.