Skip to content

Commit ceaaf9a

Browse files
pjt222claude
andcommitted
fix(docs): eliminate two-chunk pattern in Quarto gallery API tabs
Merge eval:false display chunks with echo:false render chunks so that the code users see is the code that actually produces the output. Removes 27 redundant chunks across 6 gallery files, fixes Quick Start in index.qmd, and reveals render_puzzle_preview() in getting-started.qmd. Net effect: -355 lines, 0 echo:false in API panel-tabs, all output- producing code is now evaluated and visible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4886874 commit ceaaf9a

8 files changed

Lines changed: 5 additions & 355 deletions

File tree

quarto/gallery/concentric.qmd

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,8 @@ print(make_conc_rings(2) + make_conc_rings(3) + make_conc_rings(4))
4242

4343
## API
4444

45-
```{r}
46-
#| label: fig-conc-rings-api-code
47-
#| eval: false
48-
# API with varying ring counts
49-
result <- generate_puzzle(
50-
type = "concentric",
51-
grid = c(3), # Number of rings
52-
size = c(200), # Diameter in mm
53-
seed = 42
54-
)
55-
render_puzzle_preview(result)
56-
```
57-
5845
```{r}
5946
#| label: fig-conc-rings-api
60-
#| echo: false
6147
6248
# Generate ring previews in a grid
6349
rings <- c(2, 3, 4)
@@ -207,23 +193,8 @@ print((make_conc_palette("viridis") + make_conc_palette("magma") + make_conc_pal
207193

208194
## API
209195

210-
```{r}
211-
#| label: fig-conc-palettes-api-code
212-
#| eval: false
213-
# API with fill_palette for colored fills
214-
result <- generate_puzzle(
215-
type = "concentric",
216-
grid = c(3),
217-
size = c(200),
218-
seed = 42,
219-
fill_palette = "viridis" # Options: viridis, magma, plasma, inferno, cividis, turbo
220-
)
221-
render_puzzle_preview(result)
222-
```
223-
224196
```{r}
225197
#| label: fig-conc-palettes-api
226-
#| echo: false
227198
228199
# Generate all palette previews and combine into a grid
229200
palettes <- c("viridis", "magma", "plasma", "inferno", "cividis", "turbo")
@@ -268,7 +239,6 @@ print(make_direction_plot("forward") + make_direction_plot("reverse"))
268239

269240
```{r}
270241
#| label: fig-conc-direction-api
271-
#| echo: false
272242
273243
directions <- c("forward", "reverse")
274244
items <- lapply(directions, function(dir) {
@@ -307,23 +277,8 @@ print(make_conc_offset(0) + make_conc_offset(5) + make_conc_offset(10) + make_co
307277

308278
## API
309279

310-
```{r}
311-
#| label: fig-conc-offset-api-code
312-
#| eval: false
313-
# API with offset for piece separation
314-
result <- generate_puzzle(
315-
type = "concentric",
316-
grid = c(3),
317-
size = c(200),
318-
offset = 10, # Separation in mm
319-
seed = 42
320-
)
321-
render_puzzle_preview(result)
322-
```
323-
324280
```{r}
325281
#| label: fig-conc-offset-api
326-
#| echo: false
327282
328283
# Generate offset previews in a grid
329284
offsets <- c(0, 5, 10, 15)

quarto/gallery/hexagonal.qmd

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -235,25 +235,8 @@ print((make_hex_palette("viridis") + make_hex_palette("magma") + make_hex_palett
235235

236236
## API
237237

238-
```{r}
239-
#| label: fig-hex-palettes-api-code
240-
#| eval: false
241-
# API with fill_palette for colored fills
242-
result <- generate_puzzle(
243-
type = "hexagonal",
244-
grid = c(3),
245-
size = c(200),
246-
seed = 42,
247-
do_warp = TRUE,
248-
do_trunc = TRUE,
249-
fill_palette = "viridis" # Options: viridis, magma, plasma, inferno, cividis, turbo
250-
)
251-
render_puzzle_preview(result)
252-
```
253-
254238
```{r}
255239
#| label: fig-hex-palettes-api
256-
#| echo: false
257240
258241
# Generate all palette previews and combine into a grid
259242
palettes <- c("viridis", "magma", "plasma", "inferno", "cividis", "turbo")
@@ -298,7 +281,6 @@ print(make_direction_plot("forward") + make_direction_plot("reverse"))
298281

299282
```{r}
300283
#| label: fig-hex-direction-api
301-
#| echo: false
302284
303285
directions <- c("forward", "reverse")
304286
items <- lapply(directions, function(dir) {
@@ -337,25 +319,8 @@ print(make_hex_offset(0) + make_hex_offset(5) + make_hex_offset(10) + make_hex_o
337319

338320
## API
339321

340-
```{r}
341-
#| label: fig-hex-offset-api-code
342-
#| eval: false
343-
# API with offset for piece separation
344-
result <- generate_puzzle(
345-
type = "hexagonal",
346-
grid = c(3),
347-
size = c(200),
348-
seed = 42,
349-
do_warp = TRUE,
350-
do_trunc = TRUE,
351-
offset = 10 # Separation in mm
352-
)
353-
render_puzzle_preview(result)
354-
```
355-
356322
```{r}
357323
#| label: fig-hex-offset-api
358-
#| echo: false
359324
360325
# Generate offset previews in a grid
361326
offsets <- c(0, 5, 10, 15)

quarto/gallery/random.qmd

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,8 @@ print(make_rand_pieces(5) + make_rand_pieces(10) + make_rand_pieces(20))
4242

4343
## API
4444

45-
```{r}
46-
#| label: fig-rand-piece-counts-api-code
47-
#| eval: false
48-
# API with varying piece counts
49-
result <- generate_puzzle(
50-
type = "random",
51-
grid = c(10), # Number of interior points
52-
size = c(200, 200), # height, width in mm
53-
seed = 42
54-
)
55-
render_puzzle_preview(result)
56-
```
57-
5845
```{r}
5946
#| label: fig-rand-piece-counts-api
60-
#| echo: false
6147
6248
# Generate piece count previews in a grid
6349
counts <- c(5, 10, 20)
@@ -101,23 +87,8 @@ make_rand_corners(6, "6 corners") + make_rand_corners(8, "8 corners"))
10187

10288
## API
10389

104-
```{r}
105-
#| label: fig-rand-corners-api-code
106-
#| eval: false
107-
# API with n_corner for piece shape complexity
108-
result <- generate_puzzle(
109-
type = "random",
110-
grid = c(8),
111-
size = c(200, 200),
112-
seed = 42,
113-
n_corner = 5 # 3-8, higher = more complex shapes
114-
)
115-
render_puzzle_preview(result)
116-
```
117-
11890
```{r}
11991
#| label: fig-rand-corners-api
120-
#| echo: false
12192
12293
# Generate corner variation previews in a grid
12394
corners <- c(3, 4, 6, 8)
@@ -158,23 +129,8 @@ print((make_rand_palette("viridis") + make_rand_palette("magma") + make_rand_pal
158129

159130
## API
160131

161-
```{r}
162-
#| label: fig-rand-palettes-api-code
163-
#| eval: false
164-
# API with fill_palette for colored fills
165-
result <- generate_puzzle(
166-
type = "random",
167-
grid = c(10),
168-
size = c(200, 200),
169-
seed = 42,
170-
fill_palette = "viridis" # Options: viridis, magma, plasma, inferno, cividis, turbo
171-
)
172-
render_puzzle_preview(result)
173-
```
174-
175132
```{r}
176133
#| label: fig-rand-palettes-api
177-
#| echo: false
178134
179135
# Generate all palette previews and combine into a grid
180136
palettes <- c("viridis", "magma", "plasma", "inferno", "cividis", "turbo")
@@ -219,7 +175,6 @@ print(make_direction_plot("forward") + make_direction_plot("reverse"))
219175

220176
```{r}
221177
#| label: fig-rand-direction-api
222-
#| echo: false
223178
224179
directions <- c("forward", "reverse")
225180
items <- lapply(directions, function(dir) {
@@ -258,23 +213,8 @@ print(make_rand_offset(0) + make_rand_offset(5) + make_rand_offset(10) + make_ra
258213

259214
## API
260215

261-
```{r}
262-
#| label: fig-rand-offset-api-code
263-
#| eval: false
264-
# API with offset for piece separation
265-
result <- generate_puzzle(
266-
type = "random",
267-
grid = c(9),
268-
size = c(200, 200),
269-
offset = 10, # Separation in mm
270-
seed = 42
271-
)
272-
render_puzzle_preview(result)
273-
```
274-
275216
```{r}
276217
#| label: fig-rand-offset-api
277-
#| echo: false
278218
279219
# Generate offset previews in a grid
280220
offsets <- c(0, 5, 10, 20)
@@ -316,22 +256,8 @@ print(make_rand_seed(1) + make_rand_seed(42) + make_rand_seed(123) + make_rand_s
316256

317257
## API
318258

319-
```{r}
320-
#| label: fig-rand-seeds-api-code
321-
#| eval: false
322-
# API with different seeds for unique patterns
323-
result <- generate_puzzle(
324-
type = "random",
325-
grid = c(8),
326-
size = c(200, 200),
327-
seed = 42 # Change seed for different patterns
328-
)
329-
render_puzzle_preview(result)
330-
```
331-
332259
```{r}
333260
#| label: fig-rand-seeds-api
334-
#| echo: false
335261
336262
# Generate seed variation previews in a grid
337263
seeds <- c(1, 42, 123, 999)

quarto/gallery/rectangular.qmd

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,8 @@ print((make_palette_plot("viridis") + make_palette_plot("magma") + make_palette_
135135

136136
## API
137137

138-
```{r}
139-
#| label: fig-rect-palettes-api-code
140-
#| eval: false
141-
# API with fill_palette for colored fills
142-
result <- generate_puzzle(
143-
type = "rectangular",
144-
grid = c(3, 4),
145-
size = c(300, 400),
146-
seed = 42,
147-
fill_palette = "viridis" # Options: viridis, magma, plasma, inferno, cividis, turbo
148-
)
149-
render_puzzle_preview(result)
150-
```
151-
152138
```{r}
153139
#| label: fig-rect-palettes-api
154-
#| echo: false
155140
156141
# Generate all palette previews and combine into a grid
157142
palettes <- c("viridis", "magma", "plasma", "inferno", "cividis", "turbo")
@@ -196,7 +181,6 @@ print(make_direction_plot("forward") + make_direction_plot("reverse"))
196181

197182
```{r}
198183
#| label: fig-rect-direction-api
199-
#| echo: false
200184
201185
directions <- c("forward", "reverse")
202186
items <- lapply(directions, function(dir) {
@@ -238,24 +222,8 @@ print(make_offset_plot(0) + make_offset_plot(5) + make_offset_plot(10) + make_of
238222

239223
## API
240224

241-
```{r}
242-
#| label: fig-rect-offset-api-code
243-
#| eval: false
244-
# API with offset for piece separation
245-
result <- generate_puzzle(
246-
type = "rectangular",
247-
grid = c(3, 3),
248-
size = c(300, 300),
249-
offset = 10, # Separation in mm
250-
seed = 42,
251-
fill_palette = "plasma"
252-
)
253-
render_puzzle_preview(result)
254-
```
255-
256225
```{r}
257226
#| label: fig-rect-offset-api
258-
#| echo: false
259227
260228
# Generate offset previews in a grid
261229
offsets <- c(0, 5, 10, 20)

0 commit comments

Comments
 (0)