tingerrr / hydra

A typst package for displaying the active section in the page header or footer.
MIT License
26 stars 3 forks source link

Allow alternate active selection #13

Closed tingerrr closed 4 months ago

tingerrr commented 6 months ago

Some users have expressed the desire to select the last heading on the current page over what hydra currently considers the active element, if one exists.

freundTech commented 4 months ago

Do you have any plans for how the API for that should look?

I would like to try implementing this (actually, I already implemented this functionally without hydra, but I would like to switch to using hydra to simplify my template. I would just have to integrate my code into hydra).

tingerrr commented 4 months ago

I'm unsure, at best it would simply be a parameter once can switch like hydra(latex: true) (using a bikesheddy name here because I can't think of one) and the function does the rest, but when I looked at it, I didn't find a nice way to change the internal behavior to match.

I've pushed a commit form that attempt that allows disabling the ancestor scoping.

If you find a way to fit this into the API neatly, then go ahead!