Closed stefaniebutland closed 1 month ago
How to turn whole site to pdf? Searching
Typst available in Quarto 1.4:
Typst is a new open-source markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use. Typst creates beautiful PDF output with blazing fast render times.
The following also gave only homepage content and did not include hyperlinks
typst:
toc: true
number-sections: true
Comments from posit/ quarto team in 2023 indicate we can pdf a book but not a website Is it possible to print your whole website to PDFs? #5782
This is great sleuthing Stef, thanks. Yes for the Reflections Booklet, we had to make the project a Book, not a Website. I'll ask Andy about options for current website-to-pdf workarounds vs changing Series to a Book.
@jules32 the main barrier to converting the site to a book (which is the cleanest way to do this), is the three-level hierarchy (Core Lessons > GitHub Strategies > GitHub for Publishing). Books only allow two levels (Part > Chapter), so we would have to "flatten" that section to two levels...
Thanks @ateucher ! I've just merged and we can test to see how it looks
I've merged my branch with edits, so when @ateucher you're able to implement in Main, all my updates will be there. Thank you!
I opted not to convert to a book, rather included a file _make_pdf.qmd
that compiles a pdf.
Closed by #54
Hi @ateucher ,
I noticed that the publish date was wrong so I fixed it to today's date and pushed, which updated the date on the html book. But I can't seem to update the PDF's date. I've tried via web browser (GitHub Action build) and also by running locally. When I tried running locally following the GitHub Action's code L29, I get this error:
JLos-MacBook-Pro:series jlo$ quarto::quarto_render("_make_pdf.qmd")
bash: syntax error near unexpected token `"_make_pdf.qmd"'
Do you mind having a look and updating the PDF? Thank you!
Following up @ateucher -
I realized I needed to also fix today's date in the _make_pdf.qmd
file as well. The GitHub Action has now created a PDF with today's date.
Could you please still look into how to create the local build, and update the README with how to build the PDF locally? Thank you!
Nice, I didn't know about the last-modified
quarto keyword (https://github.com/Openscapes/series/commit/ce9685d995f251daf0b6b64f87eb611444a1263f). I wonder if it should be today
instead though? last-modified
might not get updated if the constituent pages get updated but not _make_pdf.qmd
itself?
Ah yes please update to today
if that is the best current approach! Is there a way to delete it from the _make_pdf.qmd
so that it only appears in one place, on the root index.qmd
?
Not easily I don't think. But just saw this: https://github.com/quarto-dev/quarto-cli/issues/5967. Basically last-modified
relies on the timestamp on your computer, so will always give today's date in GitHub Actions - basically the same behaviour as today
:). I think the most straightforward is to just set today
in both places... they should then always match since they're rendered at the same time in GitHub Actions
Sounds like a good plan!
Continuing in #56
adding
format: pdf: default
to_quarto.yml
resulted in pdf of onlyindex.qmd
on my first try. Cool that it adds "pdf" button to home page.Noting attempt here.
Output
hyperlinks worked, but links to
filename.qmd
were linked to that filename, not the html