Add shareable-slide SVG renderer for published Versions#2798
Draft
bendichter wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.py—render_shareable_slide_svg(version: Version) -> strdandiapi/api/slides/dandi_logo.svg— verbatim copy ofweb/src/assets/logo.svg(fills inlined at module load so the logo nests cleanly inside the slide SVG)pyproject.toml/uv.lock— addsqrcode==8.2(used by the renderer for the SVG QR code; no PIL needed)What's deliberately out
librsvg/rsvg-convertlater; that decision and the deployment story belong with the integration PR)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
Local visual check
Refs #2797
🤖 Generated with Claude Code