Switch from pkgdown to altdoc for documentation#503
Conversation
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
… quarto package reference Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
… navbar structure, extract _quarto.yml to vignettes/_metadata.yml Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Resolved merge conflicts: - DESCRIPTION: Kept both altdoc and snapr in Remotes - R/sim_pop_data.R: Accepted main branch refactoring (verbose_level, days_per_year) while keeping explicit curve_params documentation - man/plot_curve_params_one_ab.Rd: Regenerated from roxygen2 Changes from main: - Added .validate_verbose() helper function - Refactored verbose handling to use verbose_level - Renamed day2yr to days_per_year for clarity - Updated tests and snapshots - Updated copilot instructions Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Merge conflicts resolved in commit 4849262. Conflicts resolved:
Integrated from main:
All changes successfully merged and documentation regenerated. |
|
@claude reivew and fix |
|
Claude finished @d-morrison's task in 4m 27s —— View job Review and Fix PR #503: Switch to altdocIssues found and fixed:
Reviewed and confirmed correct (no changes needed):
Todo:
|
…tignore Re-adds _quarto/ to .gitignore (lost in merge), removes 96 re-tracked build artifacts (re-introduced by commit b4c8ff4 after removal in a3a0428), removes altdoc/freeze.rds build artifact, and adds freeze.rds to altdoc/.gitignore. Co-authored-by: Douglas Ezra Morrison <d-morrison@users.noreply.github.com>
|
@claude fix the failing workflow |
|
Claude finished @d-morrison's task in 13m 23s —— View job Fixed Failing WorkflowRoot cause: When rendering The Fix (commit
|
When rendering to pptx with prefer-html: true, knitr::is_html_output()
returns TRUE, causing knitr::include_app() to produce an iframe that
webshot2 tries to screenshot. The Shiny app URL is blocked by the CI
firewall, causing pandoc to fail and serocalculator.html to not be
produced in _quarto/.
Fix: use eval=knitr::pandoc_to("html") so the chunk only executes
in HTML output (pandoc_to() returns the actual format, not the
preferred format, so it correctly returns FALSE for pptx).
Also remove top-level prefer-html: true from document YAML since
_metadata.yml already applies it to the pptx format specifically.
Co-authored-by: Douglas Ezra Morrison <d-morrison@users.noreply.github.com>
|
@claude fix and review |
|
Claude finished @d-morrison's task in 8m 44s —— View job Fix and Review PR #503: Switch to altdocTodo:
Fix AppliedRoot cause: Changes in
Code ReviewIssues1.
# Current (wrong level)
- text: Home
file: index.qmd
style: floating # ← not a valid item property
- section: Articles
style: floating # ← not a valid section propertyThese are likely ignored by Quarto, but should be removed to avoid unexpected behavior in future Quarto versions. The 2. date: '`r Sys.Date()`'This is rmarkdown's inline R syntax. For 3. prefer-html: true # top-level (applies to all formats)
format:
pptx:
prefer-html: true # redundantThe top-level Confirmed Correct
|
…rame Replace output: rmarkdown::html_vignette with bookdown::html_document2 (matching other working vignettes) and replace knitr::include_app() with a raw HTML iframe. The html_vignette output format caused Quarto to use rmarkdown's rendering pipeline, writing HTML to the source directory instead of _quarto/ — causing the rename step to fail. The raw iframe avoids knitr HTML dependencies that could also cause silent pandoc failure. Co-authored-by: Douglas Ezra Morrison <d-morrison@users.noreply.github.com>
|
Claude Code CLI (local session) is working on this — paws off until I'm done. |
# Conflicts: # .Rbuildignore
|
Claude finished @d-morrison's task in 3m 4s —— View job Code Review: PR #503 — Switch from pkgdown to altdocTodo:
FindingsBugs1. date: '`r Sys.Date()`'This is knitr's inline R syntax for 2.
Minor issues3. sidebar:
contents:
- text: Home
file: index.qmd
style: floating # ← invalid here
- section: Articles
style: floating # ← invalid here
...
- section: $ALTDOC_MAN_BLOCK
style: floating # ← invalid here
4. prefer-html: true # top-level: applies to all formats
format:
pptx:
prefer-html: true # redundant; top-level already covers thisThe top-level entry already covers all formats. The 5. needs: |
connect
websiteStandard 6. The job already has 7. This entry (a Posit AI local tool directory) was added in this PR but has nothing to do with switching to altdoc. It reads like a local development artifact that should have been in a per-user global Confirmed correct
Out-of-scope change to note
| Branch |
vignettes/_metadata.yml declared html + revealjs + pptx formats, and simulate_xsectionalData.qmd overrode to format: pptx. In the altdoc HTML website this caused (a) a quarto output-filename collision — revealjs and html both emit .html — which produced the 'rename serocalculator.html' NotFound that failed the docs build, and (b) a pptx/HTML-widget render error. Trim vignette formats to html-only. Verified locally with altdoc::render_docs(): all 48 files render and docs/ builds cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #503 Review: Switch from pkgdown to altdoc
|
- Remove invalid 'style: floating' from sidebar items/sections in
altdoc/quarto_website.yml; this property is only valid at the
sidebar level, not on individual items or sections.
- Fix date expression in vignettes/_metadata.yml: change knitr
inline-R syntax ('`r Sys.Date()`') to Quarto tagged-expression
syntax ('!expr Sys.Date()') so .qmd vignettes render the actual
current date instead of a literal string.
Co-authored-by: Douglas Ezra Morrison <undefined@users.noreply.github.com>
PR #503 Review: Switch from pkgdown to altdoc
|
- Add 'altdoc' and 'gh' to inst/WORDLIST (flagged in NEWS.md:5,7) - Remove dead knitr::opts_knit$set(rmarkdown.html_dependency.prefer = TRUE) from simulate_xsectionalData.qmd — this was added for webshot2 pptx screenshot support, which is no longer needed after pptx format was removed in 4c377ee Co-authored-by: Douglas Ezra Morrison <undefined@users.noreply.github.com>
|
@claude we want to keep rendering the html, revealjs, and docx formats; see how https://github.com/d-morrison/rpt does it |
|
👀 Picked up by workflow run #26497844818. R setup runs first; Claude itself responds after that. |
|
The previous commit (4c377ee) removed revealjs/pptx from _metadata.yml to fix an output-filename collision (both html and revealjs emit .html) and a pptx/HTML-widget render error. This commit restores multi-format rendering using the correct approach: - docx added globally in _metadata.yml (no collision: .docx != .html) - revealjs added only to methodology.qmd's frontmatter with an explicit output-file: methodology-slides.html, so the revealjs slides render to a distinct filename and do not collide with the HTML website output - format-links added so HTML pages link to their docx and revealjs versions - Added docx and revealjs to inst/WORDLIST for spell-check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The commit is done. Here's a summary of what was changed and why: Problem: The previous commit removed Solution (following the rpt pattern for avoiding the collision):
The key insight is: docx is safe globally (different extension), but revealjs must be file-specific with an explicit — posted by @claude post-step from workflow run |
|
the view source and edit this page links in https://ucd-serg.github.io/serocalculator/pr-preview/pr-503/man/as_sr_params.html is broken (and I suspect in other man pages). we made some improvements in https://github.com/d-morrison/rpt that might help fix this issue |
|
@claude the view source and edit this page links in https://ucd-serg.github.io/serocalculator/pr-preview/pr-503/man/as_sr_params.html is broken (and I suspect in other man pages). we made some improvements in https://github.com/d-morrison/rpt that might help fix this issue |
|
👀 Picked up by workflow run #26501114281. R setup runs first; Claude itself responds after that. |
|
The fix is committed. Here's a summary of what was done and why: Root cause: Quarto's "View source" links for man pages pointed to build-time-generated Fix (ported from
— posted by @claude post-step from workflow run |

Description
Replaces pkgdown with altdoc following the UCD-SERG/rpt pattern. Documentation renders with Quarto via
altdoc::render_docs().Changes:
altdoc,bslib, andwebshot2to Suggests; updatedConfig/Needs/websitewithd-morrison/altdoc@recursive-qmd-searchremote; merged with main branch preserving both altdoc and snapr in Remotesquarto_website.yml: Quarto config using altdoc template variables ($ALTDOC_PACKAGE_NAME,$ALTDOC_PACKAGE_URL_GITHUB,$ALTDOC_MAN_BLOCK) with correct navbar menu structure (text/file properties) and sidebar structure (section/contents), with all file paths relative to repo root (altdoc handles path resolution). Enabledexecute.freeze: autofor performance optimization. Matches old pkgdown article structure including all articles. Added explicitproject.renderlist to control which files are rendered (*.qmd, *.Rmd, .md, excluding README.md, index.md, and _.qmd include files).index.qmd: Includes README.mdCONTRIBUTING.md: Includes .github/CONTRIBUTING.mdstyles.css: Custom sidebar spacing.gitignore: Ignores Quarto build artifacts (_site/,.quarto/,pkgdown.yml)altdoc::render_docs(freeze = TRUE)instead ofpkgdown::build_site()with freeze enabled to cache expensive computationscancel-in-progress: trueto concurrency settingsnamekeyPKGDOWN_DEV_MODEenvironment variablev*) instead of regex for proper matchinggithub.event.release.tag_nametarget-folderdeployment for proper tag versioning to subdirectorieshttps://ucd-serg.github.io/serocalculator/pr-previewtopreviewto match actual preview directory structureindex.qmdfrom path filters (file is inaltdoc/, not repository root)^altdoc$and^_quarto$, removed pkgdown-specific patterns_freeze/and**/_freeze/to ignore Quarto freeze cache; added_quarto/andaltdoc/pkgdown.ymlto prevent tracking build artifacts_quarto.yml; addedprefer-html: trueto pptx format to allow HTML widgetsprefer-html: trueto YAML front-matter and configured knitr to use webshot2 for HTML widget screenshots in pptx formatpkgdown/directory,_quarto.ymlfrom repo root,altdoc/pkgdown.yml(auto-generated file)_quarto/build artifact files (commit a3a0428) that were previously committed but should not be versionedPath Configuration:
quarto_website.ymlare relative to repo root (not altdoc/)vignettes/references.bibman/,vignettes/,NEWS.md,CODE_OF_CONDUCT.md../docs/(relative to altdoc/ directory)project.renderlist following the rpt pattern to control which files are rendered:["*.qmd", "!README.md", "!index.md", "!_*.qmd", "*.Rmd", "*.md"]Article Structure (Matches Old pkgdown):
project.renderlistConditional Content for Shiny App:
{.content-visible when-format="html"}and{.content-hidden when-format="html"}) in serocalculator.Rmdknitr::include_app()) displays only in HTML formatNavbar Structure:
text/fileproperties with separator headings (e.g., "---Get started---", "---Methodology---") for visual organizationPerformance Optimization:
execute.freeze: auto) to cache expensive computations_freeze/directory (ignored by git)freeze = TRUEtoaltdoc::render_docs()for consistencyWorkflow Improvements:
v*) for proper version tag matchingDocumentation and Code Quality Fixes:
curve_paramsdocumentation insim_pop_data()with required column names (antigen_iso,y0,y1,t1,alpha,r) and reference toload_sr_params()for proper structure@param curve_paramsdocumentation tosim_pop_data()@inheritParams log_likelihoodinsim_pop_data().Rdfiles withroxygen2::roxygenise().validate_verbose()helper function, verbose_level variable for clearer verbose handling, and days_per_year variable (renamed from day2yr) for better code clarity^_quarto$to.Rbuildignoreto exclude Quarto build directoryVignette Rendering Fixes:
webshot2dependency to DESCRIPTION Suggests for HTML widget screenshot supportprefer-html: truetosimulate_xsectionalData.qmdYAML front-matter (both top-level and underformat.pptx) to allow HTML widgets (e.g., plotly, DT tables) to render in pptx formatknitr::opts_knit$set(rmarkdown.html_dependency.prefer = TRUE)in the setup chunk ofsimulate_xsectionalData.qmdto enable HTML widget screenshots via webshot2Repository Cleanup:
_quarto/build artifact files from git tracking (commit a3a0428)altdoc/pkgdown.ymlfrom git tracking (auto-generated build metadata file)_quarto/andaltdoc/pkgdown.ymlto.gitignoreto prevent future tracking of build artifactsMaintained:
/preview/pr<number>/docs/directoryConfiguration:
vignettes/references.bibNote on Multi-version Documentation:
The
insightsengineering/r-pkgdown-multiversionaction is not compatible with altdoc as it is specifically designed for pkgdown sites and expects pkgdown's output structure. However, the workflow now properly deploys tags to versioned subdirectories using thetarget-folderparameter with appropriate safeguards.-.testthat). - N/A for infrastructure changeFor more information see Contributing.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.