-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export logic.typ
for counter/state access
#206
Comments
What would be the usecase of having access to these states and counters? |
Sure, my preferred slide numbering format is A workaround is for users to define their own |
Hmm I see. How about having #toolbox.current-subslide // opaque content
#toolbox.with-subslide(s => 3 + s * 4) ? Then it's still read-only access (which I would prefer) and at least your use case is covered. |
IMO write access isn't too bad... It can just be clearly stated in the docs that it's undefined/forbidden behavior. Otherwise, to access multiple properties at once with functions, you have to do #toolbox.with-slide(s => {
toolbox.with-subslide(sub => {
toolbox.with-repeats(r => [
Slide #s.(#sub of #r)
])
})
}) It seems easier from UX/DX perspective to just provision counter access directly. Edit: The simple example above works with just Edit 2: You could also have a "read-only" counter that's constantly updated by business logic that combines slide + subslide in true counter fashion: #let slide-subslide = counter("exposed")
// Handled internally by polylux, so even when user manually overrides the value, it has no effect by the next slide
#slide-subslide.update((1,2))
// User then has more "counter-y" freedoms
#context slide-subslide.display("1a") |
I think I like your last idea of those derived counters 👍🏼 Feel free to start a PR. |
In my slide template (which is designed as a wrapper around polylux), there are some slides I don't want to count towards the total number of slides. These are section separators and backup slides. In previous versions of polylux, I implemented this by manipulating the counters in logic.typ. |
It would be nice to provide direct access to the slide counter, subslide, etc. However, since
logic.typ
isn't exported from the main entrypoint or toolbox, the counters are not accessible.Toolbox only provides
content
versions of the first and last slides, and no way to access the currentrepetitions
valueThe text was updated successfully, but these errors were encountered: