Skip to content

Commit 0ee5511

Browse files
committed
Document moving cells
1 parent 5e8b936 commit 0ee5511

File tree

6 files changed

+105
-0
lines changed

6 files changed

+105
-0
lines changed

src/assets/img/compress_videos.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# Script to compress .mov files to .mp4 using ffmpeg and replace them in-place
4+
# Usage: ./compress_videos.sh file1.mov file2.mov file3.mov ...
5+
6+
set -e # Exit on any error
7+
8+
if [ $# -eq 0 ]; then
9+
echo "Usage: $0 <mov_file1> [mov_file2] [mov_file3] ..."
10+
echo "Example: $0 \"selecting cells.mov\" \"dragging cells.mov\""
11+
exit 1
12+
fi
13+
14+
for mov_file in "$@"; do
15+
if [ ! -f "$mov_file" ]; then
16+
echo "Warning: File '$mov_file' does not exist, skipping..."
17+
continue
18+
fi
19+
20+
# Check if it's a .mov file
21+
if [[ ! "$mov_file" =~ \.mov$ ]]; then
22+
echo "Warning: '$mov_file' is not a .mov file, skipping..."
23+
continue
24+
fi
25+
26+
echo "Processing: $mov_file"
27+
28+
# Generate temporary output filename
29+
temp_output="${mov_file%.mov}_temp.mp4"
30+
final_output="${mov_file%.mov}.mp4"
31+
32+
# Run ffmpeg conversion
33+
if ffmpeg -i "$mov_file" -vcodec libx264 -crf 28 -preset medium -pix_fmt yuv420p -y "$temp_output"; then
34+
# Move temp file to final location and remove original
35+
mv "$temp_output" "$final_output"
36+
rm "$mov_file"
37+
echo "✓ Converted '$mov_file' to '$final_output'"
38+
39+
# Print dimensions of the converted video
40+
dimensions=$(ffprobe -v quiet -print_format json -show_streams "$final_output" | grep -E '"width"|"height"' | tr -d ' ",' | cut -d: -f2)
41+
width=$(echo "$dimensions" | head -n1)
42+
height=$(echo "$dimensions" | tail -n1)
43+
echo " Dimensions: ${width}×${height} pixels"
44+
else
45+
echo "✗ Failed to convert '$mov_file'"
46+
# Clean up temp file if it exists
47+
[ -f "$temp_output" ] && rm "$temp_output"
48+
fi
49+
done
50+
51+
echo "Done!"

src/assets/img/dragging cells.mp4

97.6 KB
Binary file not shown.
220 KB
Binary file not shown.
96.4 KB
Binary file not shown.

src/assets/img/selecting cells.mp4

60.5 KB
Binary file not shown.

src/en/docs/moving-cells.jlmd

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: "🔃 Selecting and moving cells"
3+
description: "How to move cells in Pluto"
4+
tags: ["docs", "editor"]
5+
layout: "md.jlmd"
6+
order: 20
7+
---
8+
9+
# Moving a single cell
10+
Pluto allows you to place your cells in **any order**. You can do this by dragging the cell from the left shoulder. A bold line shows where the cell will be moved to.
11+
12+
13+
<video alt="Moving a cell by dragging the left shoulder" style="aspect-ratio: 520/568; max-width: 100%;" src="$(root_url)/assets/img/dragging cells.mp4" controls="controls" muted="muted" loop="loop"></video>
14+
15+
16+
!!! tip
17+
Pluto's reactivity means that you can put cells in **any order**, and they will still execute correctly based on the dependencies between cells. This means that you can place cells in the order that makes the most sense for your story, which is not always the order that makes the most sense for the computer.
18+
19+
For example, you can first tell your story using Markdown cells and plots, and then add a section `# Appendix` with package imports, helper functions and more.
20+
21+
22+
# Selecting cells
23+
You can select multiple cells, which is useful for moving them together. To select cells, **click between two cells and drag to make a selection**.
24+
25+
<video alt="Selecting cells by clicking between two cells and dragging" style="aspect-ratio: 520/568; max-width: 100%;" src="$(root_url)/assets/img/selecting cells.mp4" controls="controls" muted="muted" loop="loop"></video>
26+
27+
> 💡 If your window is wide enough, you can also use the **right margin** to start a selection:
28+
>
29+
> <video alt="Selecting cells by clicking on the right margin and dragging" style="aspect-ratio: 707/467; max-width: 100%;" src="$(root_url)/assets/img/selecting cells by right margin.mp4" controls="controls" muted="muted" loop="loop"></video>
30+
31+
32+
33+
34+
## Moving multiple cells
35+
You can move multiple cells by **Selecting multiple cells** and then dragging one of them.
36+
37+
38+
39+
## Copying cells
40+
If you press <kbd>Ctrl</kbd>+<kbd>C</kbd> (or <kbd>Cmd</kbd><kbd>C</kbd> on Mac) while cells are selected, you can copy them to the clipboard. You can paste these cells in a notebook, or as plain text in another application.
41+
42+
43+
## More actions
44+
While multiple cells are selected, you can apply various actions to them simultaneously: moving, copying, deleting, folding and un-folding.
45+
46+
47+
48+
49+
# Moving between notebooks
50+
You can also move cells between different notebooks. To do this, [open two notebooks in two different windows](https://plutojl.org/en/docs/launch-pluto/), and place them side-by-side. You can now **drag cells between the two notebooks**, and they will be copied to the other notebook.
51+
52+
53+
<video alt="Moving cells between notebooks by dragging them between two open notebooks" style="aspect-ratio: 1038/624; max-width: 100%;" src="$(root_url)/assets/img/moving cells between notebooks.mp4" controls="controls" muted="muted" loop="loop"></video>
54+

0 commit comments

Comments
 (0)