-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.qmd
More file actions
353 lines (220 loc) · 7.07 KB
/
example.qmd
File metadata and controls
353 lines (220 loc) · 7.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
---
title: "Remember Extension for Quarto"
subtitle: "Quarto Extension"
author:
- name: "Mickaël CANOUIL, _Ph.D._"
orcid: "0000-0002-3396-4549"
url: "https://mickael.canouil.fr"
format:
html:
output-file: index
toc: true
theme:
light: cosmo
dark: cyborg
revealjs:
output-file: example-revealjs
shift-heading-level-by: -1
format-links:
- html
- revealjs
embed-resources: true
engine: markdown
filters:
- remember
---
This extension provides automatic navigation position saving and restoration for both HTML documents and Reveal.js presentations.
## Installation
```bash
quarto add mcanouil/[email protected]
```
This will install the extension under the `_extensions` subdirectory.
If you're using version control, you will want to check in this directory.
## Usage
:::: {.content-visible unless-format="revealjs"}
To enable navigation tracking for HTML pages:
```yaml
---
title: "My Document"
format: html
filters:
- remember
---
```
:::
:::: {.content-visible when-format="revealjs"}
To enable slide position tracking for presentations:
```yaml
---
title: "My Presentation"
format: revealjs
filters:
- remember
---
```
:::
## Testing the Extension
:::: {.content-visible unless-format="revealjs"}
1. Scroll down to Section 5 or beyond.
2. Close this browser tab or navigate away.
3. Return to this page.
4. You should see a prompt asking if you want to resume where you were.
5. Click **Yes** to restore your position, or **No** to start at the top.
:::
:::: {.content-visible when-format="revealjs"}
1. Navigate through several slides using arrow keys or clicking.
2. Close the browser tab.
3. Reopen this presentation.
4. You should see a prompt asking if you want to resume from your last slide.
5. Click **Yes** to jump to your last position, or **No** to start at the beginning.
:::
## How It Works
:::: {.content-visible unless-format="revealjs"}
The extension tracks your scroll position and hash anchors as you navigate the page.
When you return, it prompts you to resume from where you left off.
:::
:::: {.content-visible when-format="revealjs"}
The extension tracks your slide position as you navigate through the presentation.
When you return, it prompts you to resume from your last viewed slide.
:::
All data is stored locally in your browser.
Nothing is sent to external servers.
## Features
- **Automatic Tracking:** Positions saved as you navigate.
- **Smart Prompts:** Only shows when there's a meaningful position to restore.
- **User Choice:** Always asks permission before restoring position.
- **Page-Specific:** Each page tracked separately.
- **Time-Aware:** Shows when you last visited.
- **Keyboard Support:** Tab, Enter, and Escape keys work.
- **Responsive:** Works on desktop, tablet, and mobile.
- **Dark Mode:** Adapts to your colour scheme preference.
## Section 1: Welcome
This is the first section of the demonstration.
:::: {.content-visible unless-format="revealjs"}
Scroll past this section to test the extension's scroll position tracking.
:::
:::: {.content-visible when-format="revealjs"}
Navigate to the next slides to test the extension's slide tracking.
:::
The extension will remember your position and offer to restore it when you return.
## Section 2: Demonstration
:::: {.content-visible unless-format="revealjs"}
Continue scrolling through the sections.
The extension tracks your vertical scroll position automatically.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
Use arrow keys or click to navigate through slides.
The extension tracks which slide you're viewing.
:::
Try closing and reopening this page to see the prompt appear.
## Section 3: Position Tracking
:::: {.content-visible unless-format="revealjs"}
The extension monitors your scroll position and navigation.
All tracking happens automatically.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
The extension monitors your slide position.
All tracking happens automatically.
:::
No user action required.
## Section 4: User Experience
When you return, a modal prompt appears with:
- Title: "Resume Navigation?"
- Message showing when you last visited.
- Buttons: "Yes" to restore or "No" to start fresh.
:::: {.content-visible unless-format="revealjs"}
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
Keyboard users can press Escape to dismiss the prompt.
## Section 5: Privacy
All position data is stored locally in your browser.
No cookies, no external requests, no tracking.
:::: {.content-visible unless-format="revealjs"}
Data persists until you clear browser storage or decline the prompt.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
Data persists until you clear browser storage or decline the prompt.
:::
Your privacy is protected.
## Section 6: Accessibility
The modal prompt supports keyboard navigation:
- Tab between buttons.
- Enter to select.
- Escape to close.
:::: {.content-visible unless-format="revealjs"}
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
## Section 7: Responsive Design
The modal adapts to different screen sizes.
:::: {.content-visible unless-format="revealjs"}
Works on desktop, tablet, and mobile devices.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
Works on all devices.
:::
## Section 8: Dark Mode
The extension adapts to your system colour scheme.
:::: {.content-visible unless-format="revealjs"}
Try switching your system theme to see the modal adapt.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
Light and dark themes are supported.
:::
## Section 9: Limitations
:::: {.content-visible unless-format="revealjs"}
- Works with HTML and Reveal.js formats only.
- Requires browser local storage.
- Position tracked per URL.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
- Works with HTML and Reveal.js formats only.
- Requires browser local storage.
- Position tracked per URL.
:::
## Section 10: Testing Tips
:::: {.content-visible unless-format="revealjs"}
To test the extension:
1. Scroll to different sections.
2. Refresh the page.
3. Test both "Yes" and "No" options.
Vestibulum ante ipsum primis.
:::
:::: {.content-visible when-format="revealjs"}
To test the extension:
1. Navigate through multiple slides.
2. Close and reopen the presentation.
3. Test both "Yes" and "No" options.
:::
## Section 11: Final Remarks
:::: {.content-visible unless-format="revealjs"}
Try scrolling here, refreshing the page, and observe the prompt.
:::: {style="color: #b22222; font-style: italic;"}
{{< lipsum 1 >}}
:::
:::
:::: {.content-visible when-format="revealjs"}
Navigate back through the slides to test the position tracking.
:::
**Thank you for trying the Remember extension!**