Skip to content

Commit ce2bcd5

Browse files
Light2Darkcubic-dev-ai[bot]Copilot
authored
Add slides documentation and video (#9464)
## 📝 Summary <!-- If this PR closes any issues, list them here by number (e.g., Closes #123). Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> <img width="779" height="758" alt="image" src="https://github.com/user-attachments/assets/f222f914-46f7-41ef-a035-4d5f21ea9790" /> Added docs for the new feature. Also fixed a bug when trying to run docs locally. ## 📋 Pre-Review Checklist <!-- These checks need to be completed before a PR is reviewed --> - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [] Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it. - [] Video or media evidence is provided for any visual changes (optional). <!-- PR is more likely to be merged if evidence is provided for changes made --> ## ✅ Merge Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] Documentation has been updated where applicable, including docstrings for API changes. - [ ] Tests have been added for the changes made. --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent d60be6f commit ce2bcd5

5 files changed

Lines changed: 56 additions & 5 deletions

File tree

docs/_static/docs-slides-view.mp4

2.54 MB
Binary file not shown.

docs/guides/apps.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,19 @@ Enable the grid editor in the app preview, via a dropdown:
8080

8181
If you prefer a slideshow-like experience, you can use the slides layout. Enable the slides layout in the app preview, via the same dropdown as above.
8282

83-
Unlike the grid layout, the slides are much less customizable:
83+
<video muted controls loop playsinline width="100%" src="/_static/docs-slides-view.mp4" aria-label="Video showing the slides layout editor">
84+
</video>
85+
86+
#### Features
87+
88+
- A slide minimap on the left where you can drag and drop slides to rearrange them.
89+
- A config sidebar on the right where you can configure the type of each slide.
90+
- Edit code and run cells by clicking the Code toggle or using the keyboard shortcut `C`.
91+
- Powered by [reveal.js](https://revealjs.com/), so you can use most of its features like keyboard shortcuts, navigation, etc.
92+
93+
#### Notes
8494

8595
- The order of the slides is determined by the order of the cells in the notebook.
86-
- The slides do not support drag-and-drop rearrangement or resizing.
87-
- All outputs are shown and all code is hidden.
8896
- For PDF export, use `marimo export pdf notebook.py --as=slides --raster-server=live` for slide-style output with better capture compatibility.
8997

9098
If you need more control over the layout, please file an issue on [GitHub](https://github.com/marimo-team/marimo/issues),

docs/guides/lint_rules/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lint Rules
22

3-
<!-- Autogenerated! Please edit scripts/generate_lint_docs.py instead --!>
3+
<!-- Autogenerated! Please edit scripts/generate_lint_docs.py instead -->
44

55
marimo includes a linter that helps you write better notebooks. The linter checks for various issues that could prevent your notebook from running correctly or cause confusion.
66

frontend/src/components/slides/slide-form.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CookieIcon,
99
PanelRightCloseIcon,
1010
PanelRightOpenIcon,
11+
KeyboardIcon,
1112
} from "lucide-react";
1213
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
1314
import {
@@ -28,6 +29,7 @@ import type {
2829
import { useState } from "react";
2930
import { Tooltip } from "../ui/tooltip";
3031
import { Button } from "../ui/button";
32+
import { Kbd } from "../ui/kbd";
3133
import type { RuntimeCell } from "@/core/cells/types";
3234

3335
export const DEFAULT_SLIDE_TYPE: SlideType = "slide";
@@ -132,10 +134,51 @@ const SlidesForm = ({
132134
<TabsContent value="deck" className="mt-0 flex-1">
133135
<DeckConfigForm layout={layout} setLayout={setLayout} />
134136
</TabsContent>
137+
<hr />
138+
<KeyboardTips />
135139
</Tabs>
136140
);
137141
};
138142

143+
const KEYBOARD_TIPS: { keys: string[]; description: string }[] = [
144+
{ keys: ["F"], description: "Enter fullscreen" },
145+
{ keys: ["C"], description: "Toggle code editor" },
146+
];
147+
148+
const KEYBOARD_SHORTCUTS_URL =
149+
"https://vlaaad.github.io/reveal/keyboard-shortcuts";
150+
151+
const KeyboardTips = () => {
152+
return (
153+
<div className="flex flex-col gap-2 text-xs text-muted-foreground">
154+
<div className="flex items-center gap-1.5 font-medium text-foreground/80">
155+
<KeyboardIcon className="h-3.5 w-3.5" />
156+
<span>Shortcuts</span>
157+
</div>
158+
<ul className="flex flex-col gap-1.5">
159+
{KEYBOARD_TIPS.map(({ keys, description }) => (
160+
<li key={description} className="flex items-center justify-between">
161+
<span>{description}</span>
162+
<span className="flex gap-1">
163+
{keys.map((key) => (
164+
<Kbd key={key}>{key}</Kbd>
165+
))}
166+
</span>
167+
</li>
168+
))}
169+
</ul>
170+
<a
171+
href={KEYBOARD_SHORTCUTS_URL}
172+
target="_blank"
173+
rel="noopener noreferrer"
174+
className="text-link hover:underline"
175+
>
176+
See all shortcuts
177+
</a>
178+
</div>
179+
);
180+
};
181+
139182
const SlideConfigForm = ({
140183
layout,
141184
setLayout,

scripts/generate_lint_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def generate_main_index_page(rules_by_severity: dict[Severity, list[dict[str, An
274274
"""Generate the main lint rules index page."""
275275
content = """# Lint Rules
276276
277-
<!-- Autogenerated! Please edit scripts/generate_lint_docs.py instead --!>
277+
<!-- Autogenerated! Please edit scripts/generate_lint_docs.py instead -->
278278
279279
marimo includes a linter that helps you write better notebooks. The linter checks for various issues that could prevent your notebook from running correctly or cause confusion.
280280

0 commit comments

Comments
 (0)