Skip to content

Switch from pkgdown to altdoc for documentation#503

Open
Copilot wants to merge 47 commits into
mainfrom
copilot/switch-to-altdoc
Open

Switch from pkgdown to altdoc for documentation#503
Copilot wants to merge 47 commits into
mainfrom
copilot/switch-to-altdoc

Conversation

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Description

Replaces pkgdown with altdoc following the UCD-SERG/rpt pattern. Documentation renders with Quarto via altdoc::render_docs().

Changes:

  • DESCRIPTION: Added altdoc, bslib, and webshot2 to Suggests; updated Config/Needs/website with d-morrison/altdoc@recursive-qmd-search remote; merged with main branch preserving both altdoc and snapr in Remotes
  • altdoc/ directory created:
    • quarto_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). Enabled execute.freeze: auto for performance optimization. Matches old pkgdown article structure including all articles. Added explicit project.render list to control which files are rendered (*.qmd, *.Rmd, .md, excluding README.md, index.md, and _.qmd include files).
    • index.qmd: Includes README.md
    • CONTRIBUTING.md: Includes .github/CONTRIBUTING.md
    • styles.css: Custom sidebar spacing
    • .gitignore: Ignores Quarto build artifacts (_site/, .quarto/, pkgdown.yml)
  • .github/workflows/docs.yaml:
    • Workflow name "Docs 📚" restored
    • Uses altdoc::render_docs(freeze = TRUE) instead of pkgdown::build_site() with freeze enabled to cache expensive computations
    • Timeout increased to 30 minutes (from 20) for safety
    • Workflow elements reordered to match main branch structure (push, release, pull_request, workflow_dispatch)
    • Added cancel-in-progress: true to concurrency settings
    • Removed duplicate name key
    • Removed unused PKGDOWN_DEV_MODE environment variable
    • Tag trigger uses glob pattern (v*) instead of regex for proper matching
    • Added release event handler to set subdirectory from github.event.release.tag_name
    • Made workflow_dispatch tag input required with safe default value ('docs')
    • Enabled target-folder deployment for proper tag versioning to subdirectories
    • Main branch deploys to repository root (empty subdir) to match package URL https://ucd-serg.github.io/serocalculator/
    • Fixed clean-exclude pattern from pr-preview to preview to match actual preview directory structure
    • Removed index.qmd from path filters (file is in altdoc/, not repository root)
  • .Rbuildignore: Added ^altdoc$ and ^_quarto$, removed pkgdown-specific patterns
  • .gitignore: Added _freeze/ and **/_freeze/ to ignore Quarto freeze cache; added _quarto/ and altdoc/pkgdown.yml to prevent tracking build artifacts
  • vignettes/_metadata.yml: Created with format settings extracted from _quarto.yml; added prefer-html: true to pptx format to allow HTML widgets
  • vignettes/articles/simulate_xsectionalData.qmd: Added prefer-html: true to YAML front-matter and configured knitr to use webshot2 for HTML widget screenshots in pptx format
  • vignettes/articles/serocalculator.Rmd: Used Quarto's conditional content system to show Shiny app only in HTML format and display a note with link in non-HTML formats (pptx, etc.)
  • Removed files: pkgdown/ directory, _quarto.yml from repo root, altdoc/pkgdown.yml (auto-generated file)
  • Removed from git tracking: 230 _quarto/ build artifact files (commit a3a0428) that were previously committed but should not be versioned
  • Merge conflicts resolved: Merged latest changes from main branch; resolved conflicts in DESCRIPTION (kept both altdoc and snapr remotes), R/sim_pop_data.R (integrated main's refactoring with verbose_level and days_per_year while preserving explicit curve_params documentation), and man/plot_curve_params_one_ab.Rd (regenerated from roxygen2)

Path Configuration:

  • All file paths in quarto_website.yml are relative to repo root (not altdoc/)
  • Altdoc handles path resolution before Quarto processes the configuration
  • Bibliography: vignettes/references.bib
  • Navbar/sidebar files: man/, vignettes/, NEWS.md, CODE_OF_CONDUCT.md
  • Output directory: ../docs/ (relative to altdoc/ directory)
  • Added explicit project.render list following the rpt pattern to control which files are rendered: ["*.qmd", "!README.md", "!index.md", "!_*.qmd", "*.Rmd", "*.md"]

Article Structure (Matches Old pkgdown):

  • Get started section: serocalculator.Rmd (with conditional content for Shiny app - shows app in HTML, shows note with link in non-HTML formats)
  • Methodology section: methodology.qmd, simulate_xsectionalData.qmd
  • Examples section: enteric_fever_example.Rmd, scrubTyphus_example.Rmd
  • Other section: version-crosswalk-1.3-to-1.4.qmd
  • Test articles and include files (test-quarto-article.qmd, _*.qmd) automatically excluded via the project.render list

Conditional Content for Shiny App:

  • Used Quarto's conditional content system ({.content-visible when-format="html"} and {.content-hidden when-format="html"}) in serocalculator.Rmd
  • Shiny app (knitr::include_app()) displays only in HTML format
  • Non-HTML formats (pptx, etc.) show a note: "This interactive Shiny app is only available in the HTML version of this article. View the HTML version"
  • Allows the vignette to render properly in all output formats without errors

Navbar Structure:

  • Navbar menu items use text/file properties with separator headings (e.g., "---Get started---", "---Methodology---") for visual organization
  • This is the correct Quarto syntax for navbar menus (section/contents structure is only valid for sidebars)
  • Fixes Quarto validation error: "property name section is invalid"

Performance Optimization:

  • Enabled Quarto freeze feature (execute.freeze: auto) to cache expensive computations
  • This significantly speeds up builds by only re-executing code when source files change
  • Fixes the 20-minute timeout issue that was causing workflow failures
  • Freeze cache stored in _freeze/ directory (ignored by git)
  • Workflow passes freeze = TRUE to altdoc::render_docs() for consistency

Workflow Improvements:

  • Tag trigger uses glob pattern (v*) for proper version tag matching
  • Release events properly set subdirectory from tag name
  • workflow_dispatch requires tag input with safe default ('docs') to prevent accidental overwrites
  • All deployment scenarios (push, release, workflow_dispatch) properly set target-folder
  • Main branch deploys to root (empty subdir) to match advertised package URL
  • Timeout increased to 30 minutes to accommodate initial builds before freeze cache is established
  • Removed unused pkgdown environment variables for cleaner workflow
  • Fixed clean-exclude pattern to properly protect PR preview directories

Documentation and Code Quality Fixes:

  • Enhanced curve_params documentation in sim_pop_data() with required column names (antigen_iso, y0, y1, t1, alpha, r) and reference to load_sr_params() for proper structure
  • Added missing @param curve_params documentation to sim_pop_data()
  • Fixed duplicate @inheritParams log_likelihood in sim_pop_data()
  • Regenerated .Rd files with roxygen2::roxygenise()
  • Integrated main branch refactoring: Accepted main's improvements including new .validate_verbose() helper function, verbose_level variable for clearer verbose handling, and days_per_year variable (renamed from day2yr) for better code clarity
  • Fixed R CMD check issues: Added ^_quarto$ to .Rbuildignore to exclude Quarto build directory

Vignette Rendering Fixes:

  • Added webshot2 dependency to DESCRIPTION Suggests for HTML widget screenshot support
  • Added prefer-html: true to simulate_xsectionalData.qmd YAML front-matter (both top-level and under format.pptx) to allow HTML widgets (e.g., plotly, DT tables) to render in pptx format
  • Configured knitr with knitr::opts_knit$set(rmarkdown.html_dependency.prefer = TRUE) in the setup chunk of simulate_xsectionalData.qmd to enable HTML widget screenshots via webshot2
  • Used conditional content in serocalculator.Rmd to handle Shiny app rendering across different output formats
  • This resolves Quarto rendering errors: "Functions that produce HTML output found in document targeting pptx output"

Repository Cleanup:

  • Removed 230 _quarto/ build artifact files from git tracking (commit a3a0428)
  • Removed altdoc/pkgdown.yml from git tracking (auto-generated build metadata file)
  • Added _quarto/ and altdoc/pkgdown.yml to .gitignore to prevent future tracking of build artifacts
  • These files are generated during documentation builds and should not be versioned
  • Keeps repository clean of generated documentation files

Maintained:

  • PR preview deployment to /preview/pr<number>/
  • GitHub Pages deployment for main branch and version tags with proper subdirectory structure
  • Output to docs/ directory
  • Support for .Rmd and .qmd vignettes

Configuration:

  • Bootstrap 5 with light/dark theme toggle
  • Downlit code-linking enabled
  • Bibliography from vignettes/references.bib
  • Navbar uses text/file structure with separator headings for menu organization
  • Sidebar uses section/contents structure: Home, Articles (Get started/Methodology/Examples/Other), Reference, News, Code of Conduct, Contributing
  • Freeze enabled for fast incremental builds
  • Explicit render list controls which files are processed by Quarto

Note on Multi-version Documentation:

The insightsengineering/r-pkgdown-multiversion action 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 the target-folder parameter with appropriate safeguards.


  • The title of your PR should briefly describe the change.
  • Commit/merge messages to be included in NEWS.md should begin with -.
  • Code should follow the tidyverse style guide.
  • Documentation should use roxygen2, with Markdown syntax.
  • Contributions should include unit tests (using testthat). - N/A for infrastructure change

For more information see Contributing.

Original prompt

This section details on the original issue you should resolve

<issue_title>switch to altdoc</issue_title>
<issue_description>follow the example of https://github.com/d-morrison/altdoc</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI and others added 10 commits February 2, 2026 06:03
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>
Copilot AI changed the title [WIP] Switch to altdoc implementation Switch from pkgdown to altdoc for documentation Feb 2, 2026
Copilot AI requested a review from d-morrison February 2, 2026 06:16
Comment thread .Rbuildignore Outdated
Comment thread .github/workflows/docs.yaml
Comment thread .github/workflows/docs.yaml
Comment thread altdoc/.gitignore Outdated
Comment thread altdoc/quarto_website.yml Outdated
… navbar structure, extract _quarto.yml to vignettes/_metadata.yml

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

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:

  • https://api.github.com/repos/UCD-SERG/rpt/contents/vignettes
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Comment thread .github/workflows/docs.yaml
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>

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 4849262.

Conflicts resolved:

  1. DESCRIPTION: Kept both altdoc and snapr in Remotes section
  2. R/sim_pop_data.R: Accepted main branch's refactoring (.validate_verbose(), verbose_level, days_per_year) while preserving explicit curve_params documentation
  3. man/plot_curve_params_one_ab.Rd: Regenerated from roxygen2

Integrated from main:

  • New .validate_verbose() helper function for robust parameter validation
  • Refactored verbose handling using verbose_level variable
  • Renamed day2yr to days_per_year for clarity
  • Updated tests and snapshots

All changes successfully merged and documentation regenerated.

@d-morrison

Copy link
Copy Markdown
Member

@claude reivew and fix

@claude

claude Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 4m 27s —— View job


Review and Fix PR #503: Switch to altdoc

Issues found and fixed:

  1. _quarto/ build artifacts re-tracked in git — commit a3a0428 removed 230 files, but b4c8ff4 ("Changes before error encountered") re-added them. 96 generated files were still tracked. Fixed by re-running git rm -r --cached _quarto/.

  2. .gitignore missing _quarto/ entry — added in commit 703cc4a but lost in a subsequent merge. Fixed by re-adding _quarto/ and altdoc/pkgdown.yml to .gitignore.

  3. altdoc/freeze.rds tracked in git — build artifact that should not be versioned. Removed from tracking and added freeze.rds to altdoc/.gitignore.

Reviewed and confirmed correct (no changes needed):

  • altdoc/quarto_website.yml: correct structure, bibliography path resolves properly via altdoc, article structure matches old pkgdown site, navbar/sidebar properly configured
  • .github/workflows/docs.yaml: tag glob pattern correct (v*), release event sets subdir, main branch deploys to root, clean-exclude: preview matches cleanup job, target-folder properly wired, no stale PKGDOWN_DEV_MODE variable
  • vignettes/articles/serocalculator.Rmd: conditional content correctly wraps Shiny app for HTML-only display
  • vignettes/articles/simulate_xsectionalData.qmd: prefer-html: true and webshot2 setup correct
  • man/sim_pop_data.Rd / R/sim_pop_data.R: curve_params fully documented with required columns

Todo:

  • Read CLAUDE.md for repo-specific instructions
  • Analyze changed files and current state of the PR branch
  • Review key configuration files
  • Identify issues
  • Add _quarto/ and altdoc/pkgdown.yml back to .gitignore
  • Remove _quarto/ tracked files from git (96 files, commit 97dc494)
  • Add freeze.rds to altdoc/.gitignore and untrack it
  • Commit and push
    | Branch

…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>
@d-morrison

Copy link
Copy Markdown
Member

@claude fix the failing workflow

@claude

claude Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 13m 23s —— View job


Fixed Failing Workflow

Root cause: When rendering serocalculator.Rmd to pptx format with prefer-html: true (set in vignettes/_metadata.yml), knitr's is_html_output() returns TRUE even in pptx context. This causes knitr::include_app() to produce an <iframe>, and webshot2 then tries to screenshot the Shiny app URL (https://ucdserg.shinyapps.io/...) — which is blocked by the CI firewall. The pandoc/pptx failure then prevents serocalculator.html from being placed in _quarto/, so Quarto can't complete the final rename step.

The {.content-visible when-format="html"} div doesn't prevent the knitr chunk from executing in .Rmd files (Quarto processes divs at the pandoc level, after knitr already runs).

Fix (commit b7366d3):

  • Added eval=knitr::pandoc_to("html") to the knitr::include_app() chunk — this uses the actual pandoc target format (not the preferred format), so the chunk is skipped entirely in pptx/revealjs contexts even when prefer-html: true is set

  • Removed top-level prefer-html: true from document YAML (already correctly set per-format in vignettes/_metadata.yml)

  • Check CI status to identify failing workflows

  • Read relevant files and understand current state

  • Diagnose root cause (pptx render fails due to blocked Shiny app screenshot via webshot2)

  • Fix the chunk in serocalculator.Rmd

  • Commit and push (b7366d3)

  • Verify CI passes
    | Branch

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>
@d-morrison

Copy link
Copy Markdown
Member

@claude fix and review

@claude

claude Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 8m 44s —— View job


Fix and Review PR #503: Switch to altdoc

Todo:

  • Read CLAUDE.md for repo-specific instructions
  • Analyze current PR state (diff, CI status)
  • Review changed files for issues
  • Identify root cause of failing Docs workflow
  • Fix serocalculator.Rmd rendering failure (commit 8eb089c)
  • Review remaining changes for correctness
  • Push fix

Fix Applied

Root cause: output: rmarkdown::html_vignette in serocalculator.Rmd caused Quarto to use rmarkdown's rendering pipeline, which writes HTML to the source directory instead of _quarto/vignettes/articles/. The final rename step then fails with NotFound: No such file or directory. The working Rmd files (enteric_fever_example.Rmd, scrubTyphus_example.Rmd) both use output: bookdown::html_document2, which does not trigger this issue.

Changes in 8eb089c:

  • output: rmarkdown::html_vignetteoutput: bookdown::html_document2 (with base_format: rmarkdown::html_vignette to preserve vignette styling for R CMD check)
  • Replaced knitr::include_app() R chunk with a raw HTML <iframe> — removes knitr HTML widget dependencies that could cause additional silent pandoc failures, and removes the need for eval=knitr::pandoc_to("html")

Code Review

Issues

1. altdoc/quarto_website.ymlstyle: floating on sidebar items (minor)

style: floating is a sidebar-level property, not valid on individual items or sections:

# Current (wrong level)
- text: Home
  file: index.qmd
  style: floating    # ← not a valid item property
- section: Articles
  style: floating    # ← not a valid section property

These are likely ignored by Quarto, but should be removed to avoid unexpected behavior in future Quarto versions. The style: floating belongs on the sidebar: key itself if needed.

2. vignettes/_metadata.yml — rmarkdown inline R in YAML (minor)

date: '`r Sys.Date()`'

This is rmarkdown's inline R syntax. For .qmd files (like simulate_xsectionalData.qmd), Quarto's syntax is date: "!expr Sys.Date()". For .Rmd files, knitr processes this correctly. The date may render as the literal string `r Sys.Date()` in .qmd vignettes. Not a build failure, but worth knowing.

3. vignettes/articles/simulate_xsectionalData.qmd — redundant prefer-html: true (cosmetic)

prefer-html: true        # top-level (applies to all formats)
format:
  pptx:
    prefer-html: true    # redundant

The top-level prefer-html: true already applies to all formats, making the format.pptx entry redundant.

Confirmed Correct

  • Navbar structure: correctly uses text/file for menu items (not section/contents which is sidebar-only syntax)
  • Sidebar structure: correctly uses section/contents
  • Bibliography: set at project level as vignettes/references.bib (altdoc resolves relative to repo root)
  • Freeze: execute.freeze: auto and freeze = TRUE in workflow are consistent
  • Deployment: main deploys to root (empty subdir), tags/releases deploy to /<tag>/, workflow_dispatch requires tag input with safe default 'docs'
  • PR preview: clean-exclude: preview matches the actual preview directory structure from rossjrw/pr-preview-action
  • Git artifacts: _quarto/, altdoc/pkgdown.yml, _freeze/ are all gitignored and excluded from .Rbuildignore
  • sim_pop_data() docs: curve_params parameter is fully documented with required columns (antigen_iso, y0, y1, t1, alpha, r) and reference to load_sr_params()
  • Warnings about man/serocalculator-package.qmd: these are expected — altdoc generates this file at build time from man/serocalculator-package.Rd, but Quarto resolves nav links before all generated files are in place. Does not cause build failure.
    | Branch

…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>
@d-morrison

Copy link
Copy Markdown
Member

Claude Code CLI (local session) is working on this — paws off until I'm done.

@claude

claude Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 3m 4s —— View job


Code Review: PR #503 — Switch from pkgdown to altdoc

Todo:

  • Review diff (git diff origin/main...HEAD)
  • Review altdoc configuration (altdoc/quarto_website.yml, altdoc/index.qmd, etc.)
  • Review GitHub Actions workflow (.github/workflows/docs.yaml)
  • Review R package files (DESCRIPTION, R/sim_pop_data.R, man/)
  • Review vignette changes
  • Check build hygiene (.Rbuildignore, .gitignore)
  • Post review findings

Findings

Bugs

1. vignettes/_metadata.yml:2 — rmarkdown inline R syntax won't work in .qmd files

date: '`r Sys.Date()`'

This is knitr's inline R syntax for .Rmd files. In .qmd files, Quarto processes YAML fields directly (not via knitr), so simulate_xsectionalData.qmd will render the literal string `r Sys.Date()` in its header instead of the current date. The Quarto equivalent is date: "!expr Sys.Date()" (YAML tagged expression). Fix this →

2. inst/WORDLIST — "Serological" removed but still in package title

Serological was dropped from the WORDLIST, but man/serocalculator-package.Rd line 7 contains \title{serocalculator: Estimating Infection Rates from Serological Data} (generated from DESCRIPTION's Title: field). It was added to the WORDLIST because hunspell doesn't include it in its default dictionary. Removing it will break the spell-check CI workflow. Fix this →

Minor issues

3. altdoc/quarto_website.yml:55,57,74style: floating is invalid on item/section entries

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

style is a sidebar-level key, not valid on individual items or sections. Quarto silently ignores these, but they're misleading and may become validation errors in a future Quarto release. Move style: floating to the sidebar: key itself if floating style is desired.

4. vignettes/articles/simulate_xsectionalData.qmd:7-8 — redundant prefer-html: true under format.pptx

prefer-html: true          # top-level: applies to all formats
format:
  pptx:
    prefer-html: true      # redundant; top-level already covers this

The top-level entry already covers all formats. The format.pptx entry is harmless but dead config.

5. .github/workflows/docs.yaml:81needs: connect is not a standard r-lib/actions value

needs: |
  connect
  website

Standard needs values for r-lib/actions/setup-r-dependencies are website, check, coverage, test. connect is not documented and will be silently ignored. If it was meant to install rsconnect-related packages, it won't do anything here. Remove to avoid confusion.

6. .github/workflows/docs.yaml:112 — step-level timeout-minutes duplicates the job-level timeout

The job already has timeout-minutes: 30 (line 56), and the "Build site" step also sets timeout-minutes: 30. A step timeout cannot exceed the job timeout anyway, so this is redundant. Remove the step-level setting.

7. .Rbuildignore^\.positai$ is out of scope

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 .gitignore rather than committed here.

Confirmed correct

  • Navbar structure: uses text/file properties (correct for navbar menus; section/contents is sidebar-only)
  • Sidebar structure: uses section/contents (correct)
  • Article structure: matches old pkgdown site (Get started, Methodology, Examples, Other sections)
  • Freeze config: execute.freeze: auto in config and freeze = TRUE in workflow are consistent
  • Deployment: main → root (empty subdir), version tags/releases → /<tag>/, dispatch → inputs.tag
  • clean-exclude: preview: matches preview/pr<N> directory structure from rossjrw/pr-preview-action
  • serocalculator.Rmd: bookdown::html_document2(base_format = rmarkdown::html_vignette) is the right approach for dual-use (vignette + altdoc); conditional Quarto divs for Shiny app work correctly
  • sim_pop_data docs: iter column is auto-added when missing (as_sr_params.R:71-82), so not listing it as required is accurate
  • Build hygiene: _quarto/, _freeze/, altdoc/pkgdown.yml are all gitignored; no build artifacts tracked

Out-of-scope change to note

R/sim_pop_data.R and man/sim_pop_data.Rd include documentation improvements (curve_params parameter description, removed @inheritParams log_likelihood) that are bundled with this infrastructure PR. Not a problem, but worth noting if you want a clean PR history.


| 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>
@claude

claude Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

PR #503 Review: Switch from pkgdown to altdoc

Todo:

  • Load tools
  • Review current state of changed files
  • Check for remaining issues from previous reviews
  • Fix: vignettes/_metadata.yml date syntax for .qmd compatibility
  • Review and post findings

View job run

github-actions Bot and others added 2 commits May 27, 2026 05:10
- 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>
@claude

claude Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

PR #503 Review: Switch from pkgdown to altdoc

Todo:

  • Load tools
  • Read changed files and check previous review findings
  • Identify remaining issues — spell check failing: altdoc and gh missing from WORDLIST
  • Fix inst/WORDLIST: add altdoc and gh
  • Remove dead knitr::opts_knit$set(...) from simulate_xsectionalData.qmd
  • Commit and push
  • Final review update

View job run

- 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>
@d-morrison

Copy link
Copy Markdown
Member

@claude we want to keep rendering the html, revealjs, and docx formats; see how https://github.com/d-morrison/rpt does it

@github-actions

Copy link
Copy Markdown
Contributor

👀 Picked up by workflow run #26497844818. R setup runs first; Claude itself responds after that.

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://UCD-SERG.github.io/serocalculator/pr-preview/pr-503/

Built to branch gh-pages at 2026-05-27 07:54 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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>
@github-actions

Copy link
Copy Markdown
Contributor

The commit is done. Here's a summary of what was changed and why:

Problem: The previous commit removed revealjs and pptx from vignettes/_metadata.yml because both html and revealjs output .html files, causing a filename collision that broke the altdoc build.

Solution (following the rpt pattern for avoiding the collision):

  1. vignettes/_metadata.yml — Added docx format globally (safe: .docx has no filename collision with .html) and format-links: [docx] on the HTML format so every page shows a download link.

  2. vignettes/methodology.qmd — Added revealjs format only in this file's frontmatter (not globally in _metadata.yml) with output-file: methodology-slides.html. This gives revealjs a distinct filename so it doesn't collide with the HTML page methodology.html. The HTML format on this file also gets format-links: [docx, revealjs] to link to both secondary formats.

  3. inst/WORDLIST — Added docx and revealjs (alphabetically) since these terms appear in NEWS.md.

The key insight is: docx is safe globally (different extension), but revealjs must be file-specific with an explicit output-file to avoid the HTML collision.

— posted by @claude post-step from workflow run

@d-morrison

Copy link
Copy Markdown
Member

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

@d-morrison

Copy link
Copy Markdown
Member

@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

@github-actions

Copy link
Copy Markdown
Contributor

👀 Picked up by workflow run #26501114281. R setup runs first; Claude itself responds after that.

@github-actions

Copy link
Copy Markdown
Contributor

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 .qmd files (e.g., man/as_sr_params.qmd) that are never committed to git, causing 404s. Additionally, on PR-preview builds, "Edit this page" and "View source" links pointed to main instead of the PR branch.

Fix (ported from d-morrison/rpt PR #136/#137):

  1. altdoc/scripts/fix-man-source-urls.sh (new) — a Quarto post-render script that rewrites "View source" hrefs in rendered man page HTML from .qmd.Rd. Registered as project.post-render in quarto_website.yml.

  2. docs.yaml — on PR builds, uses yq (pre-installed on ubuntu-latest) to rewrite three keys in altdoc/quarto_website.yml before render_docs() runs:

    • website.repo-url → PR head repo URL (correct fork)
    • website.repo-branch → PR head branch (so "Edit this page"/"View source" land on the right branch)
    • Navbar GitHub icon href → PR conversation URL
      After rendering, sed rewrites "Report an issue" links to the base repo's /issues page.
  3. altdoc/quarto_website.yml — comments added explaining the dynamic rewrites.

— posted by @claude post-step from workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

switch to altdoc

3 participants