Skip to content

Export html deck - #64

Closed
razodin137 wants to merge 26 commits into
omacom:masterfrom
razodin137:export-html-deck
Closed

razodin137 wants to merge 26 commits into
omacom:masterfrom
razodin137:export-html-deck

Conversation

@razodin137

Copy link
Copy Markdown

HTML Export. You don't have to merge my vibe coded slop but it works for me and consider it a feature request.

razodin137 and others added 4 commits November 17, 2026 15:52
Every slide renders as WebP inlined into one navigable file: arrows,
click, swipe, counter, and #N deep links. hype export deck.html, the
--html flag, and Export as HTML (Ctrl+Alt+E) in the editor.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The desktop identity follows the binary's name, so the fork installs
beside an installed hype with its own entry and icon, Writecam-style.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The HTML folder export passes no filename patterns to the portal file
chooser, since a folder has no extension to filter on. The chooser still
sent the resulting empty filter as "filters" and "current_filter", and
the portal rejects a filter with no rules outright, failing the whole
SaveFile call with "invalid filter: no filters". Send no filter options
at all in that case.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 1/5

[Medium impact] The changes reach Hype's export and slide-presentation workflows.

Do not merge until copied files are checked, media names stay distinct, and embedded Markdown cannot swallow the deck script.

Findings

  1. P1 Security Exports can include private files ▶
  2. P1 Duplicate names lose exported pictures ▶
  3. P1 Code examples can blank exports ▶

Summary

Adds self-contained HTML decks, editable HTML folders, and shared slide transitions for the app and browser.

  • Hype exports Markdown decks as a single HTML file or an editable folder.
  • Slides can use named transitions, with per-slide choices overriding the deck default.
  • An Arch package can install the HTML-export build beside Hype under its own name.
  • A shell script runs prompt files one by one and stops at the first failed check.
  • The welcome deck and slide-title helper move to support the export changes.

Three issues need attention: folder exports can share private local files, duplicate media names can lose pictures, and some valid code examples leave exported decks blank.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  M[Markdown presentation] --> E[Export]
  E --> S[Single HTML file]
  E --> F[Editable HTML folder]
  S --> P[Rendered slide pictures]
  F --> A[Markdown and media files]
  P --> B[Browser navigation and transitions]
  A --> B
  T[Shared transition shaders] --> B
  T --> N[Native app transitions]
Loading

Reviews (10) · Last reviewed commit: "fixes" · Reviewed by Greptile

Comment thread src/deck.cpp Resolved
Comment thread src/deck.html Resolved
Comment thread pkgbuild/hype-html/PKGBUILD Resolved
yep
Comment thread src/deck.cpp Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.cpp Resolved
Comment thread tests/test_deck_render.py Resolved
Media from outside the deck's folder is copied into images/ or videos/ when
the editable HTML folder is exported, but the embedded Markdown kept the
author's path. An absolute path still resolved on the author's machine and
failed everywhere else, so a shared folder showed missing pictures and
videos. Rewrite those references, posters included, to the paths the copies
take; code and comments keep their text.

Also render svg blocks as data-URL images rather than page markup, so a
shared deck's drawing cannot run script or restyle the page, and require a
table's delimiter row before treating a pipe line as a table.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
razodin137 and others added 4 commits November 18, 2026 12:28
Transitions are one GLSL ES 1.00 fragment body each, defining
vec4 transition(vec2 uv) over fromTex and toTex with a progress uniform.
The registry prepends the shared simplex-noise, hash and cosine-palette
helpers, wraps a body for Qt Quick's ShaderEffect, and publishes every
body as compact JSON for the HTML exports' WebGL renderer. The bodies
avoid ES 3.00 features, so the identical source runs in both places.

The first library is crossfade, dissolve, liquid and glitch, with "none"
as the default no-op. Wiring them into the editor and the exports comes
next.

Co-Authored-By: Claude Code <noreply@anthropic.com>
A deck's front matter chooses the default transition and its duration; a slide's hype: directive overrides them. The model exposes both, writes the deck default through setScalar, and upserts a slide's directive through withSlideProperty, so every choice is undoable. The selected slide reports the transition it will play: its own valid choice, or the deck's.

Co-Authored-By: Claude Code <noreply@anthropic.com>
hype_commands now runs test_deck_transitions alongside the render, svg and navigation suites.
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.js Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/Main.qml Resolved
Comment thread scripts/split-serial.sh Resolved
A fenced example containing a hype: directive was read as the slide's
real property, so code samples overrode the chosen transition and the
writer could never win against them. Match properties in outsideCode,
as the writer already does.
The note removal pass masked code across the whole presentation, so a
backtick on one slide could pair with another slide's backtick and hide
a private note in between from the removal. Scan each slide's range
separately, matching how the editor reads notes.
A font or colour containing & or < produced invalid XML, so the drawing
failed to decode and vanished from the browser deck. Escape attribute
values before building the SVG, as the native renderer does.
Line cleanup removed a trailing backslash before code spans were
parsed, so a backslash inside a span that crossed a line boundary was
lost from the exported slide. Strip hard-break markers only outside
code.
Cached textures captured the first frame, so leaving a playing video
showed its old frame during the transition. Repaint the outgoing and
incoming textures when a transition starts.
Every visited slide kept a full 1920x1080 canvas for the lifetime of
the page. Keep only the slides a transition can need and repaint the
rest on demand.
Advancing before an image loaded uploaded an empty canvas and never
refreshed the texture, so the picture was missing for the whole
animation. Check texture readiness and skip or defer until the media is
painted.
The preview switched to the new slide before the transition frames were
ready, so the new slide flashed, then the old one returned and faded
again. Keep the outgoing render on screen until the shader starts.
test_deck_render was never added to hype_commands, so bin/test skipped
the fitted-text and list checks even with Chromium installed.
Comment thread src/deck.js Resolved
The .scratch/split logs were committed by an older split-serial.sh that
staged with a plain `git add -A`. The exclusion pathspec was added midway
through that run, too late to affect a loop bash had already parsed, so
all nine steps picked up their own transcript. They made up 12,276 of the
17,210 added lines on this branch and are agent transcripts rather than
anything the feature needs.

Untrack them and ignore the directory, along with .hype-backups, which
the editor writes beside every presentation and which must never be
committed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 18, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

Comment thread src/deck.cpp
Comment on lines +1928 to +1936
const auto media = parseMedia(slide.source, base);
for (const auto &item : {qMakePair(media.path, media.video), qMakePair(media.poster, false)}) {
// A missing file is not a failure: the browser draws Hype's missing-media
// notice in its place, as the editor does.
if (item.first.isEmpty() || !QFile::exists(item.first))
continue;
QString target = QDir(base).relativeFilePath(QFileInfo(item.first).absoluteFilePath());
if (target.startsWith(".."))
target = (item.second ? "videos/" : "images/") + QFileInfo(item.first).fileName();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Exports can include private files. exportHtmlFolder copies any existing file named by a media or poster reference. parseMedia accepts arbitrary paths, and validateStructure checks slide boundaries, not file contents. A supplied deck referencing /home/alice/.ssh/id_rsa therefore bundles that file into the shared folder, even though the browser cannot display it.

Verify that copied files really are supported media, and require approval before including unrelated files outside the presentation folder.

How this was verified: Markdown paths pass through assetPath unchanged when absolute, then reach QFile::copy after only an existence check.

Comment thread src/deck.cpp
Comment on lines +1934 to +1941
QString target = QDir(base).relativeFilePath(QFileInfo(item.first).absoluteFilePath());
if (target.startsWith(".."))
target = (item.second ? "videos/" : "images/") + QFileInfo(item.first).fileName();
if (seen.contains(target))
continue;
seen.insert(target);
copies.append({item.first, target});
targets.insert(QFileInfo(item.first).absoluteFilePath(), target);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Duplicate names lose exported pictures. Two external files such as /a/photo.png and /b/photo.png both get the destination images/photo.png. The second hits continue, so it is neither copied nor added to targets. Its Markdown keeps the original path, and the export reports success despite missing that picture when shared.

Give different source files unique destination names and record a mapping for each one. The same problem affects posters.

Comment thread src/deck.cpp Resolved
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