Skip to content

Commit fac97c4

Browse files
Merge pull request #185 from rxt1077/main
Fix deprecation warnings
2 parents 4b374be + 3013c59 commit fac97c4

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

logic.typ

+16-16
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@
249249
#let pause = {
250250
// We need two separate `locate`s because `repetitions` needs to be updated
251251
// using the new value of `pause-counter`.
252-
locate( loc => {
253-
if not handout-mode.at(loc) {
252+
context {
253+
if not handout-mode.get() {
254254
pause-counter.step()
255255
}
256-
})
257-
locate( loc => {
258-
repetitions.update(rep => calc.max(rep, pause-counter.at(loc).first() + 1))
259-
})
256+
}
257+
context {
258+
repetitions.update(rep => calc.max(rep, pause-counter.get().first() + 1))
259+
}
260260
}
261261

262262
#let paused-content(body) = locate( loc => {
@@ -271,24 +271,24 @@
271271
})
272272

273273
#let polylux-slide(body) = {
274-
locate( loc => {
275-
if logical-slide.at(loc).first() > 0 {
274+
context {
275+
if logical-slide.get().first() > 0 {
276276
pagebreak(weak: true)
277277
}
278-
})
278+
}
279279
logical-slide.step()
280280
subslide.update(1)
281281
repetitions.update(1)
282282
pause-counter.update(0)
283283

284284
// Having this here is a bit unfortunate concerning separation of concerns
285285
// but I'm not comfortable with logic depending on pdfpc...
286-
let pdfpc-slide-markers(curr-subslide) = locate( loc => [
286+
let pdfpc-slide-markers(curr-subslide) = context [
287287
#metadata((t: "NewSlide")) <pdfpc>
288-
#metadata((t: "Idx", v: counter(page).at(loc).first() - 1)) <pdfpc>
288+
#metadata((t: "Idx", v: counter(page).get().first() - 1)) <pdfpc>
289289
#metadata((t: "Overlay", v: curr-subslide - 1)) <pdfpc>
290-
#metadata((t: "LogicalSlide", v: logical-slide.at(loc).first())) <pdfpc>
291-
])
290+
#metadata((t: "LogicalSlide", v: logical-slide.get().first())) <pdfpc>
291+
]
292292

293293
pdfpc-slide-markers(1)
294294

@@ -297,8 +297,8 @@
297297
subslide.step()
298298
set heading(outlined: false)
299299

300-
locate( loc => {
301-
let reps = repetitions.at(loc).first()
300+
context {
301+
let reps = repetitions.get().first()
302302
for curr-subslide in range(2, reps + 1) {
303303
pause-counter.update(0)
304304
pagebreak(weak: true)
@@ -308,5 +308,5 @@
308308
body
309309
subslide.step()
310310
}
311-
})
311+
}
312312
}

utils/utils.typ

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@
1212
})
1313
})
1414

15-
#let current-section = locate( loc => {
16-
let sections = sections-state.at(loc)
15+
#let current-section = context {
16+
let sections = sections-state.get()
1717
if sections.len() > 0 {
1818
sections.last().body
1919
} else {
2020
[]
2121
}
22-
})
22+
}
2323

24-
#let polylux-outline(enum-args: (:), padding: 0pt) = locate( loc => {
25-
let sections = sections-state.final(loc)
24+
#let polylux-outline(enum-args: (:), padding: 0pt) = context {
25+
let sections = sections-state.final()
2626
pad(padding, enum(
2727
..enum-args,
2828
..sections.map(section => link(section.loc, section.body))
2929
))
30-
})
30+
}
3131

3232

3333
// PROGRESS
3434

35-
#let polylux-progress(ratio-to-content) = locate( loc => {
36-
let ratio = logic.logical-slide.at(loc).first() / logic.logical-slide.final(loc).first()
35+
#let polylux-progress(ratio-to-content) = context {
36+
let ratio = logic.logical-slide.get().first() / logic.logical-slide.final().first()
3737
ratio-to-content(ratio)
38-
})
38+
}
3939

40-
#let last-slide-number = locate(loc => logic.logical-slide.final(loc).first())
40+
#let last-slide-number = context { logic.logical-slide.final().first() }
4141

4242

4343
// HEIGHT FITTING

0 commit comments

Comments
 (0)