typst-community / guidelines

A guideline document for Typst package and template development.
Creative Commons Attribution Share Alike 4.0 International
1 stars 2 forks source link

Add api section about interoperabilty #6

Closed tingerrr closed 6 days ago

tingerrr commented 1 month ago

This PR adds a section to the API part which explains different kinds of considerations to take to make a package API more interoperable.

Right now, this mainly contains a section about state, counter and label keys.

I think there's more to be researched and said, I want to look at polylux, touying and tablex for their cetz integration, as well as fletcher for its extension of cetz and escape hatch mechanism. All of these are good examples of interoperability that is not yet written down here.

Jollywatt commented 1 month ago

This is a good idea. I would suggest adding a concrete point about exports: try to always ensure non-trivial functions defined in you package are exported somehow, ideally via submodules.

For example, I'm currently reworking fletcher to fully support cetz coordinates, which would be much, much harder if cetz didn't export all its utility functions in util and coordinate submodules.

tingerrr commented 1 month ago

I'll take a look at this as well, it's definitely something I do too.