Closed mitzimorris closed 8 months ago
this PR is only for building individual pdfs with quarto instead of bookdown.
quarto makes a distinction between projects for websites and books. the per-document _quarto.yml
files in the src
directory subdirs are for projects of type book
.
to build a quarto-based website which lets users switch between documents via a top navbar, will require a different _quarto.yml
file, type website
which will live in the _src
directory.
update:
build_quarto_pdfs.py
which handles the quarto build logic.src
dir which will build a quarto website for all the docs.this is what the landing page looks like:
this is what a page of the docs looks like:
now that all docs are in same place, cross references seem to be broken everywhere. todo.
update: this PR now builds both pdfs for individual docs and website for all docs. ready for review and/or beta testing.
latest change is to remove the html-version hack in the functions reference which provides a per-chapter psuedo-toc in the form of a set of links to the rendered html subsections. this isn't needed, given quarto right-hand-column toc. also upped the website toc depth to 3 - this only affects the right-hand-column toc - the sidebar nav shows chapters only.
still need to fix cross-refs - it's unclear whether book and websites both allow the kinds of hyperlinks described here: https://quarto.org/docs/books/book-crossrefs.html#hyperlinks
the SBC chapter could use some Goldilocks love w/r/t the figures - some render too big, some too small.
remaining challenges:
big problem - quarto website vs individual pdfs per document directory - I'm not sure we can get links that work for both.
previously, both html and pdf were generated on a per-directory basis, and bookdown/knitr assembled all of the .Rmd files into a single .md
/.tex
file that was fed through pandoc. therefore, within-document links looked like internal anchors - e.g. - src/stan-users-guide/clustering.Rmd
:
the [mixture modeling chapter](#mixture-modeling.chapter)).
...
As mentioned in the [clustering section](#clustering-mixture.section),
These links for for rendering the pdfs, because we're generating per-directory pdfs and for projects book
, quarto assembles a single .tex
file.
For the website, we need to change the links to include the filename, e.g.
the [mixture modeling chapter](finite-mixtures.Rmd)).
As mentioned in the [clustering section](finite-mixtures.Rmd#clustering-mixture.section),
After testing both pdf and website, quarto is doing the right thing. However, tracking down and updating the links in the Rmd files is going to be a total PITA.
What do you mean?
What do you mean?
updated previous comment. bottom line: this is tedious, but doable. best done when brain dead.
I don't know if I just now noticed this or if it wasn't like this before, but when I build the web version with the latest changes the top bar links to each doc set are drop downs, which don't really work that well with the number of sub-pages we have.
agree.
at some point I changed the config so that the nav bar entries mirrored the corresponding sidebar entries. bad idea.
@WardBrian - ready for another review pass.
The latest commit has fixed the tab titles for me for the SUG, but the other 3 manuals still don't have the page title in the tab
in latest commit fixed all page titles, added environment var file for STAN_DOCS_VERSION
.
still to do:
built the pdfs - the cross-document links are broken e.g:
Definite and indefinite one dimensional integrals can be performed in Stan
using the [`integrate_1d` function](../functions-reference/higher-order_functions.Rmd#functions-1d-integrator)
update:
web search turns up this discussion comment: https://github.com/quarto-dev/quarto-cli/discussions/3505#discussioncomment-6373686
tldr: links to other docs in the docset will be broken in the pdf.
trying one more thing: Stan Document set as monolithic pdf.
We shouldn't use relative links between pdfs (it doesn't currently for bookdown and I see no way this would ever work sensibly). In the current docs we just use full links to mc-stan.org/docs/.... when we need to link between two different manuals
OK, full links between manuals everywhere. update: this seems to work, but having fixed the above set of links to match what they will be, they're broken now.
ready for review. then we need to figure out how to launch the monolithic site.
@WardBrian - this time for sure? double checked links, got rid of use of html anchor ids.
should I add cleanup to this PR by getting rid bookdown config files _output.yml
index.Rmd
, book.json
?
You could, we will probably need some follow up PRs anyway at least for Jenkins, the readme, etc, so I think it’s also reasonable to wait
@mitzimorris the reference manual's quarto.yml got missed for the highlighting updates
@mitzimorris are you going to delete old index.Rmd
s here or would you rather leave that for another PR? Going to try to review again tomorrow morning
I can do a cleanup commit.
cleaned out all files not needed to use quarto to build the docs and modified the quarto build script to build the website.
just realized the quarto build script args need to be reworked because the logic is off; the simplest fix would be either build the unified html website, or build one or more pdfs. will try to fix tonight.
fixed. next up, deployment - cf https://quarto.org/docs/publishing/github-pages.html
another thing that needs updating - links to latest.
I think it sufficies to decide where we want to put the link on the new pages and update the script
for the existing pages, it will be a similar process to what I just did in #709. For various reasons it may be easier to wait to do those until the new version is actually live online
I just pushed a change to link_to_latest.py
, so I think that the only change needed for jenkins is to add Quarto to the docker image at https://github.com/stan-dev/ci-scripts/blob/master/docker/docs/Dockerfile
@serban-nicusor-toptal would you mind doing that? We can get a deb from https://quarto.org/docs/get-started/
So, after the above changes to build.py, I think we can:
Oh, and we need to rewrite the readme.
I just pushed a change to
link_to_latest.py
, so I think that the only change needed for jenkins is to add Quarto to the docker image at https://github.com/stan-dev/ci-scripts/blob/master/docker/docs/Dockerfile@serban-nicusor-toptal would you mind doing that? We can get a deb from https://quarto.org/docs/get-started/
Tested and pushed to master, see https://github.com/stan-dev/ci-scripts/commit/36f3184662c41fb6a3a3524ecdde91b1693f4bfa
users guide builds for me?
(base) ~/github/stan-dev/docs (issue/689-quarto-pdfs)> pdflatex --version
pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023)
kpathsea version 6.3.5
...
Compiled with libpng 1.6.39; using libpng 1.6.39
Compiled with zlib 1.2.13; using zlib 1.2.13
Compiled with xpdf version 4.04
(base) ~/github/stan-dev/docs (issue/689-quarto-pdfs)> quarto --version
1.3.450
Have you already pulled? I fixed whatever issue I was having in 4c6d8c9
pulled, merged, updated README
Submission Checklist
`r since("VERSION")`
Summary
Use quarto to build individual pdfs of the 4 docsets - Stan User's Guide, Reference Manual, Functions Reference and the CmdStan User's Guide; also provide quarto-generated website for all manuals with top nav bar that lets users access all Stan Docs plus interface docs.
Changes:
header.tex
andpostamble.tex
(for docs which have indexes) insrc
dir.index.Rmd
andindex.qmd
and then change pagestyle toplain
for references.Additions:
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Columbia University
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: