andreasKroepelin / polylux

A package for creating slides in Typst
https://polylux.dev/book
MIT License
1.18k stars 55 forks source link

Section helpers not usable for "private" themes #61

Closed JKRhb closed 1 year ago

JKRhb commented 1 year ago

First of all, thank you for contributing this amazing package :)

Trying to create a custom theme that is not going to be contributed to polylux itself, I am facing the problem that I cannot access the helper functions for defining sections and retrieving the current one (i.e., #helpers.register-section() and #helpers.current-section). Would it be possible to also export these via polylux.typ?

andreasKroepelin commented 1 year ago

I always assumed it is exported! Looks like I misunderstood how Typst's import works. Thanks for pointing that out!

andreasKroepelin commented 1 year ago

Okay so it is fixed on main now in this repository... I'm unsure if I should try to get @preview:polylux-0.2.0 updated (technically the API changed now, though) or if I should create a new patch-version 0.2.1. In the latter case, I would wait a little to see if more issues come up.

andreasKroepelin commented 1 year ago

Btw, even if you don't want to contribute your theme to polylux, I'd love to see a screen shot when you're done, just as an inspiration :)

andreasKroepelin commented 1 year ago

I found a hacky workaround that works with the version currently published! All themes import logic and helpers as modules so you can, for example use themes.simple.logic and themes.simple.helpers. Better than nothing, I guess :)

JKRhb commented 1 year ago

I found a hacky workaround that works with the version currently published! All themes import logic and helpers as modules so you can, for example use themes.simple.logic and themes.simple.helpers. Better than nothing, I guess :)

Thank you, that works quite well for now! :) I am currently porting the theme (which is specific to the University I am working at) to the published version of the polylux package, once I am done I will post a link :)

TheZoq2 commented 1 year ago

I found a hacky workaround that works with the version currently published! All themes import logic and helpers as modules so you can, for example use themes.simple.logic and themes.simple.helpers. Better than nothing, I guess :)

This works for me, except themes.simple does not import helpers. themes.clean. works though

andreasKroepelin commented 1 year ago

Good catch, thanks! I hope to publish a new release soon(ish), then this will be solved anyways.