Skip to content

feat: link the package website in .zenodo.json - #156

Merged
larnsce merged 2 commits into
devfrom
issue-154-zenodo-site-link
Nov 3, 2026
Merged

larnsce merged 2 commits into
devfrom
issue-154-zenodo-site-link

Conversation

@larnsce

@larnsce larnsce commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses #154. .zenodo.json now links the package website, so the next release of a package keeps the site link on its Zenodo record. Until now that link had to be added by hand in the Zenodo editor (as on guluswm 1.0.0) and was lost at the next release. DESCRIPTION, CITATION.cff, inst/CITATION and the README are unchanged.

Changes

  • New internal helper pkg_site_url() in R/config.R. It reads the url of _pkgdown.yml first, then the DESCRIPTION URL entry on the pages domain (github.io unless Config/washr/pages-domain says otherwise). It passes over a GitHub repository URL and returns the URL as written.
  • build_dataset_jsonld() uses the DESCRIPTION half of the helper (pkgdown = FALSE). JSON-LD output is unchanged.
  • build_zenodo_json():
    • description: with a website, <p>Description</p><p>Explore the data on a curated website: <a href="URL">URL</a></p>. The Description field is HTML escaped (&, <, >), because Zenodo reads the field as HTML. Without a website it stays the plain Description.
    • related_identifiers: the repository (isSupplementTo) is always written, then the website (isDocumentedBy, resource_type: other), then source DOIs (isDerivedFrom, unchanged).
  • Roxygen docs of update_zenodo_json() and the man page updated, plus a NEWS entry.
  • Tests: new cases for the description link, _pkgdown.yml winning over DESCRIPTION, no website, escaping, an empty Description, reading from another working directory, and unit tests for pkg_site_url(). The existing related identifier tests have new expectations. The readiness fixture rewrites .zenodo.json after it writes _pkgdown.yml, and the zenodo_json readiness test covers a changed site URL.

Decisions

  1. JSON-LD keeps reading the URL from DESCRIPTION only, so its output is unchanged.
  2. check_publication_readiness() reports zenodo_json as differing on existing packages until each one reruns update_citation() at its next release. The NEWS entry says so.
  3. An empty Description with a website writes only the website paragraph.
  4. The URL is kept as written (trailing slash kept).
  5. The repository link is written always. Any related identifier replaces the release tag link that Zenodo adds by default.

Test and check results

  • devtools::test(): 867 expectations, 0 failed, 0 skipped, 0 warnings, 0 errors.
  • devtools::check(): 0 errors, 0 warnings, 0 notes.

Follow-up

  • openwashdata/pkgreview: the add-doi prompt (from pkgreview#35) only needs to confirm the site link on the Zenodo record, not ask for it to be added.

larnsce and others added 2 commits November 3, 2026 14:40
pkg_site_url() returns the site URL the package records: the url of
_pkgdown.yml first, then the entry of the DESCRIPTION URL field on the
pages domain. A GitHub repository URL is passed over. The JSON-LD builder
uses its DESCRIPTION half (pkgdown = FALSE), so its output is unchanged.
Groundwork for #154.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0154SimKVEa4TH9HJ5GELbuv
build_zenodo_json() adds the package website to the Zenodo record when
pkg_site_url() finds one: a second paragraph "Explore the data on a
curated website" with the link in the description, written as HTML with
the Description field escaped, and a related identifier with the relation
isDocumentedBy and resource_type other. An empty Description gives only
the website paragraph. The repository link (isSupplementTo) is now always
written, since any related identifier replaces the release tag link that
Zenodo adds by default; source DOIs keep isDerivedFrom. Without a website
the description stays plain.

The readiness fixture rewrites .zenodo.json after it writes _pkgdown.yml,
and the zenodo_json readiness test covers a changed site URL.

Addresses #154.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0154SimKVEa4TH9HJ5GELbuv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant