Skip to content

Add shareable-slide SVG renderer for published Versions#2798

Draft
bendichter wants to merge 1 commit into
masterfrom
shareable-slide-renderer-2797
Draft

Add shareable-slide SVG renderer for published Versions#2798
bendichter wants to merge 1 commit into
masterfrom
shareable-slide-renderer-2797

Conversation

@bendichter
Copy link
Copy Markdown
Member

@bendichter bendichter commented Apr 27, 2026

Summary

Adds a self-contained renderer at dandiapi/api/slides/ that produces a 1920×1080 CC-0 SVG "shareable slide" for a published Dandiset Version — title, DOI, contributors, key stats, citation, QR code. Researchers can drop this into talks when sharing or reusing data.

This PR is code only — the module is not yet wired into the publish flow, email templates, storage, or any API surface. Those integration points (Celery task, publish-confirmation email, S3 upload, landing-page button) are deliberately deferred and tracked in #2797.

What's in

  • dandiapi/api/slides/render.pyrender_shareable_slide_svg(version: Version) -> str
  • dandiapi/api/slides/dandi_logo.svg — verbatim copy of web/src/assets/logo.svg (fills inlined at module load so the logo nests cleanly inside the slide SVG)
  • pyproject.toml / uv.lock — adds qrcode==8.2 (used by the renderer for the SVG QR code; no PIL needed)

What's deliberately out

  • No changes to the publish service, Celery tasks, models, mail templates, views, or settings
  • No PNG rasterization (the caller can pipe the SVG through librsvg / rsvg-convert later; that decision and the deployment story belong with the integration PR)
  • No tests yet — happy to add a basic snapshot test in this PR if reviewers want

Visual preview

A rendered PNG of this code against live metadata for Dandiset 000409 (IBL — Brain Wide Map) will be attached as a comment so reviewers can see it inline.

Test plan

  • Reviewers eyeball the rendered output (PNG attached in a comment)
  • CI passes (ruff, format)
  • Confirm `qrcode==8.2` is acceptable as a runtime dep

Local visual check

# from a Django shell with a published Version v in the DB
from dandiapi.api.slides import render_shareable_slide_svg
from pathlib import Path
Path('/tmp/slide.svg').write_text(render_shareable_slide_svg(v))
# rsvg-convert -w 1920 -h 1080 -o /tmp/slide.png /tmp/slide.svg

Refs #2797

🤖 Generated with Claude Code

Introduces dandiapi.api.slides.render_shareable_slide_svg(version), which
produces a 1920x1080 CC-0 slide summarizing a published Dandiset Version
(title, DOI, contributors, key stats, citation, QR code) for use in talks.

The module is self-contained and not yet wired into the publish flow,
email templates, storage, or any API surface — those integration points
are tracked in #2797.

Adds qrcode==8.2 as a runtime dependency (used for the SVG QR code).
The DANDI logo asset is a verbatim copy of web/src/assets/logo.svg with
fills inlined at module load so it can be nested as a child <svg>.

Refs #2797

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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