Skip to content

Add components, templates, and slide libraries - #35

Open
ryanrhughes wants to merge 16 commits into
masterfrom
feature/editable-slide-layouts
Open

ryanrhughes wants to merge 16 commits into
masterfrom
feature/editable-slide-layouts

Conversation

@ryanrhughes

Copy link
Copy Markdown

Hype can now build designed slides, not just text and pictures. Slides are composed from components written in the slide's Markdown. Brands live in templates, and any presentation can be a template. A template's slides become a library you can pull from.

Components

  • 36 MDX-style components:
    • Layout: Row, Column, Grid, Split/Panel, Background, Place
    • Content: Card, Stat, List, Tags, Pill, Callout, Quote, Table, Image, Person, Logos, Video, Collage, QR
    • Data and diagrams: Chart, Gantt, Timeline, Steps, Cycle, Funnel, Venn, Tree, Progress
  • Data stays editable as Markdown tables and lists. 2,100 bundled Lucide icons (hype icons <word>).
  • Every slide fits itself with one scale factor: dense slides shrink, sparse ones grow, and hype check warns below 16px.
  • hype check names unknown components, props, colors, icons and images, with suggestions. hype help components prints the reference agents work from.
  • Every component takes font, bold and bold-tone (the color of bold words). Gradient text (tone="gradient" or two colors) keeps its colors in PDF.
  • Plain media slides gain layouts: layout=title, split, caption and caption-right, galleries and word clouds. All are in the editor's Layout menu.

Fonts

  • Any Google Fonts family a deck names downloads on first use, with its license, to ~/.local/share/hype/fonts/.
  • hype fonts <deck> shows where each font comes from. hype fonts add <family> --into <deck> bundles a font with a deck, and hype fonts search searches the catalog.
  • The editor's font menu has a Google Fonts… search.
  • HYPE_FONT_DOWNLOADS=0 turns downloads off.

Templates

  • template: names a template beside the deck (templates/acme/), in the library (~/.local/share/hype/templates/), a built-in one, or a folder or .md file.
  • A template is an ordinary presentation. Its front matter sets colors, fonts, type weights, margins and a frame drawn on every slide. Its <Define> blocks become components, and its fonts/ and images/ come along.
  • Templates can build on templates; the nearer one wins each setting.
  • <Define> works on any slide of any deck, so a deck can grow its own components.
  • theme: current follows the desktop's Omarchy theme as it changes.
  • Hype ships one built-in template, omarchy: the desktop's colors, JetBrains Mono, and Hyprland-style tiles.
  • hype templates, hype template save <deck> [--copy] and hype template remove <name> manage the library. A saved template is a link that follows the deck, or a frozen copy.

Slide libraries

  • A template's slides are ready to copy. <!-- hype: section="…" --> groups them, for example one section per case study.
  • In the editor, Ctrl+Shift+Enter opens the gallery: every slide drawn in the open deck's own look, with a search, section headers, and Add all for a whole section.
  • hype template slides <template> [n] lists the slides or prints one, for agents.
  • A copy leaves behind the template's definitions, section marks and the comments documenting its components.

Editor

  • The palette button is now one Look picker, with templates as previews and themes as color swatches.
  • File › Save as template… saves the open deck as a template.
  • New slide from template… is in the slide menu.

Agents

  • hype skill gains a "Designed decks" workflow: read the template, plan the arc, build in passes, hype check, render and look.
  • It also covers slide libraries and copying their slides as they are.

Merge with master

  • The branch is merged with master up to Click the slide to advance #34.
  • Placed images and the media layouts exclude each other, and a layout on a placed image is an error.
  • Caption tables keep equal, unruled columns under the new table style.
  • The branch's changed lines are formatted with .clang-format.

Validation

  • Qt suite with GUI tests: 117 passed, 0 failed, 5 skipped (portal, benchmarks, two-display).
  • Python CLI, export, shutdown and trials suites: 37 passed, 1 optional LibreOffice check skipped.
  • New tests cover:
    • components, fitting and checks
    • templates, chains and live template edits
    • the library: links, copies and removal
    • sections and multi-slide adds
    • the desktop theme following Omarchy
    • bold-tone, and PDF gradient text
    • the Look picker, gallery search and Save as template, driven through the editor
  • Three real decks (64 slides) render pixel-identical before and after the merge with master.
  • examples/showcase/ is a 16-slide deck built on a sample template, using most components.

Notes for review

  • Vendored: Lucide icons (ISC, src/icons-LICENSE.txt) and Nayuki's QR Code generator (MIT, src/qrcodegen.*, left unformatted).
  • Network: font downloads reach fonts.google.com and fonts.googleapis.com only when a deck names a font that isn't installed.
  • Size: the diff is large: 36 files, about 16k lines, of which icons.tsv is 2,100. src/blocks.cpp, layout.cpp and diagrams.cpp are the engine; templates.cpp is the library.

🤖 Generated with Claude Code

ryanrhughes and others added 5 commits September 30, 2026 22:17
Slides can now be composed from MDX-style components written in the
slide's Markdown: rows, grids, cards, stats, charts, Gantt roadmaps,
timelines, steps, cycles, funnels, Venn diagrams, org trees, logo walls,
split panels, QR codes and more, with Lucide icons. Everything stays
editable text, follows the theme, fits itself to the slide, and exports
sharp to PDF and PowerPoint. `hype check` names unknown components,
props, colors, icons and images with suggestions, and `hype help
components` prints the reference agents work from.

Any presentation can be a template. `template:` names a template in
templates/ beside the deck, in the library at
~/.local/share/hype/templates/, or one Hype ships (omarchy), or a folder
or .md file. A template brings its front matter, its <Define>
components, its fonts and images, and may build on a template of its
own. <Define> works on any slide of any deck. `theme: current` follows
the desktop's Omarchy theme live.

A template's slides are a library: grouped into sections with
<!-- hype: section="…" -->, they can be searched and added one at a
time or a section at once from the editor (Ctrl+Shift+Enter), or
printed with `hype template slides`. `hype templates` and `hype template
save|remove` manage the library; the editor's palette button picks a
template or theme, and File › Save as template… links or copies the
open deck into the library.

Google Fonts named by a deck download on first use. Every component
takes font, bold and bold-tone. Gradient text keeps its colors in PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in 0.5.0 and 0.6.0: presenter mode, placed images, inline SVG,
Markdown tables, theme colour parsing, and faster slide navigation.

Placed images and the media layouts (title, split, caption, gallery)
now exclude each other, and a layout on a placed image is an error.
Caption tables keep equal, unruled columns under the new table style.
Template and font changes notify selection listeners like every other
change. The branch's changed lines are formatted with .clang-format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Goosse

Goosse commented Nov 8, 2026

Copy link
Copy Markdown

Bug: On a composed slide, a live <Video> covers any text (or other content) that sits in the same region once playback starts. The still frame looks fine; presenting flashes the text once, then it disappears.

Cause: Markdown media slides repaint text via the /overlay image while VideoOutput plays underneath. Composed slides skipped that path (paintSlide returned early for overlayOnly), and the stage only showed the overlay for span / title / split / caption layouts—not layout === "components".

Patch: Paint a real overlay for composed slides (skip <Video> posters / backgrounds so the live player shows through), and enable the overlay image when deck.media.layout === "components".

Happy to open a PR against this branch if useful.

@Goosse

Goosse commented Nov 8, 2026

Copy link
Copy Markdown

Suggestion: Composed <Video> should support the same continuous / Play across slides behavior as markdown video embeds (see #40).

Right now readMedia only reads loop / muted / autoplay from <Video>, and Play across slides only rewrites markdown directives—so a component deck always restarts the player when advancing between slides that share a file.

Patch: Add a continuous prop on <Video>, honor it when presenting, and let the Layout menu toggle that prop on composed slides.

Happy to open a PR against this branch or #40 if useful.

@omarchybot omarchybot mentioned this pull request Nov 11, 2026
ryanrhughes and others added 4 commits November 17, 2026 20:11
A slide that names a component, prop or slot the template in use lacks,
but that another template within reach defines, no longer fails. The
component's content is drawn without it, the prop is left out, and the
slot's content joins the rest. `hype check` reports each as a warning in
place of an error, and no error band is drawn over the slide. A name no
template has is still an error, so slips stay loud.

Color words work the same way: `coral`, `teal`, or any web color name
the palette has no color for draws as the palette's nearest color by
hue, so a slide keeps its colors when its presentation moves to another
template.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`hype render` takes `--format png|webp|jpg` and `--quality`, and a
directory of slides can be written in any of them. A photograph-heavy
slide is a fraction of its PNG's size as WebP.

`hype batch` reads render and check requests from standard input, one
JSON object a line, and answers each on a line of its own. A server
keeps one engine running, with its fonts and pictures loaded, instead
of starting a process for every slide.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`groups="lanes"` gives each group a band named in a column on the left,
and puts bars that do not overlap on one row, so a lane is as tall as
its busiest stretch. Names sit inside their bars, on two lines where
one is too long, and the lanes share whatever room the chart is given.

An End of `→` runs a bar to the end of the chart and points it onward;
`Sep →` ends in September and points onward too. `periods` names spans
of the axis in place of months or numbers, each closed by a dotted
line, and `axis="bottom"` puts the axis under the plot. `radius`
squares the bars, `lane-width` and `lane-fill` set the column of names,
and `label-tone` gives the names in every bar one color.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Brings in 0.7.0 and 0.7.1: the CMake build, the translated window, a
video player loaded with the first video slide, new presentations in
the desktop's theme, safer render output, and Ctrl+Q.

The build's additions move to CMakeLists.txt: Qt Network, and
qrcodegen.c with the C compiler. The window's new text (the Look
picker, template slides, Save as template, Google Fonts, the media
layouts) is wrapped for translation and listed in en.json, and
"Theme: %1" leaves with the theme picker the Look button replaced.
What the component engine, templates and fonts report from C++ is
still English only.

Theme colors are read by master's readThemeColors, and choosing the
desktop theme still keeps its colors out of the file. Thumbnails are
keyed by the window's language, as master's are. Pictures in every
format are written beside their target and renamed over, as master's
PNG is, and `hype batch` refuses to render over the presentation
itself.

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

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The latest changes appear safe to merge.

Summary

This PR adds designed slide components, reusable templates, slide libraries, and Google Fonts support.

  • Slides can mix editable text with components, diagrams, and media layouts.
  • Presentations can share their look and slides through reusable templates.
  • Decks can use Google Fonts families that are not installed yet.
  • Render commands can save smaller images and answer repeated requests.

Reviews (7) · Last reviewed commit: "Keep a found video by all its slide is l..." · Reviewed by Greptile

Comment thread src/templates.cpp Resolved
Comment thread src/blocks.cpp Resolved
Comment thread src/blocks.cpp Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/fonts.cpp Resolved
Comment thread src/templates.cpp Resolved
Comment thread src/renderer.cpp Resolved
ryanrhughes and others added 2 commits November 17, 2026 20:33
fc-match answers with its nearest font when a family is missing. On a
machine with Noto fonts and no Liberation, as CI is, the stand-in for
Google Fonts handed out a Noto file under Liberation's name, so the
family the test asked for never loaded and `hype fonts` failed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Saving a template over another builds the new one first and swaps it
in only when it is whole, so a replacement that fails (one that would
build on itself, say) leaves the template it would have replaced. A
picture or font that cannot be copied fails the save.

A slot closed on its opening line no longer swallows the line after it.

Definitions and vocabularies asked for again stay among the recent ones
kept, and a presentation checks that its own are still held before it
reuses a cached palette, so looking at many templates cannot leave an
open presentation without its components.

Save As takes the presentation's fonts/ and templates/ along with its
pictures and videos. A gallery redraws when any of its pictures
changes. Placing an image drops its layout, which a placed image cannot
have. The Google Fonts list is fetched without holding the lock the
window reads the cached list under, so a slow connection no longer
stops the editor.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Comment thread src/templates.cpp Resolved
Comment thread src/deck.cpp Resolved
Comment thread src/fonts.cpp Resolved
ryanrhughes and others added 2 commits November 17, 2026 20:44
Template saves of one name take turns, across processes, and each makes
its new entry under a name of its own. A save that stopped half-way is
put right by the next: the template it had set aside takes its name
back, and what it had half made is cleared away.

An export worker is handed the vocabulary its palette names, as it is
handed the template's text, so it keeps the snapshot the editor gave it
instead of reading the look again from disk.

A font download that needs the Google Fonts list while it is being
fetched waits for it, rather than going on without the family's
weights. The window searches the list it has and never asks for one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A <Video> that a <Define> brings is the slide's video: the slide is
laid out to find it, so the editor plays it and PowerPoint embeds it,
where before only a video written on the slide itself was found.

Whatever a component layout sets over its video stays over it while it
plays. The slide is drawn again with the video cut out of it, keeping
only the video's own box, and that picture is laid over the player in
the window and over the movie in PowerPoint. This follows a report and
a patch from Joshua Goossen on the pull request.

PowerPoint is told where a video sits in the title, split and caption
layouts, as it is for a component layout, so the movie no longer plays
across the text beside it.

A plain ![](picture.png) slide finds its picture in the template's
images when the presentation has none of that name, as components do,
so a slide copied from a template keeps its picture. Videos still play
only from the presentation's own folder.

The definitions a presentation draws with, and those of the template
previews it has handed to the window, are held past the limit on how
many are kept, until the presentation closes or the preview is remade.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Comment thread src/blocks.cpp Resolved
Comment thread src/renderer.cpp Resolved
ryanrhughes and others added 3 commits November 17, 2026 21:29
A definition may write the page or the title into its video's props, so
the cache of videos found by laying slides out is keyed by them too:
two slides that read alike no longer share the first one's clip.

The window watches the pictures a presentation takes from its template,
those in the template's images and any deeper one a plain slide names,
so a picture changed there redraws the slide that shows it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The editor kept one slide's media for as long as the slide's text and
template stayed the same, so moving between two slides that read alike,
whose definition names its video by the page, kept playing the first
one's clip. The page is part of what it keeps the media by.

A picture kept deep in the template's folders is watched once a slide
names it. The watches now catch up half a second after an edit, so one
named after the presentation was opened is watched too.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The video a slide's components bring was kept by the slide's text, its
template's definitions, and its page and title. A slide is laid out
with more than that: the frame the presentation names wraps it and may
bring the video, and what other templates define decides what is drawn
through. The cache is keyed by the whole palette, as the cache of a
slide's pictures is, and the editor keeps a slide's media by its
definitions and the count of pages too.

Co-Authored-By: Claude Fable 5.2 <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.

2 participants