touying-typ / touying

Touying is a powerful package for creating presentation slides in Typst.
https://touying-typ.github.io/
MIT License
620 stars 15 forks source link

Proposal: custom types for touying #33

Open Beiri22 opened 5 months ago

Beiri22 commented 5 months ago

Hi,

you did an impressive job to make the OOP work in typst. I wonder if the touying syntax would become easier once typst implements custom types? Have you had a look at the blog post?

OrangeX4 commented 5 months ago

Related blog link: https://laurmaedje.github.io/posts/types-and-context/

I've looked into the blog about custom types, and I'm also considering how to apply it to touying. I haven't delved deeply into it yet, but depending on the specific implementation of types and fields, custom types can always be beneficial for touying. In the worst case, we can also use them to customize the styles of headers and footers, allowing users to conveniently customize the headers and footers for themes, or even replace them entirely. In the best case, we can explore how to store "global variables" within a field of a custom type in touying, such as saving handout-mode to a field of type touying-slide. Depending on the specific implementation, perhaps touying's OOP may no longer be necessary, which would be a significant (and breaking) update. However, I think a few things are likely to remain unchanged: the #pause implementation based on traversal and reconstruction, as well as the syntax for #show: slides and dividing slides based on headings.

Beiri22 commented 5 months ago

As far as I remember, custom types are not number one priority right now, but once available I am looking forward to seeing them in action here 😀