Skip to content

✨ Standardize the components and theme creation API #44

@BattleCh1cken

Description

@BattleCh1cken

It might be a good idea to standardize the user facing component API so that we can guarantee component compatibility across themes.

I propose we do this with some sort of component constructor function. Here's an example:

// themes/linear/components/pro-con.typ
#let pro-con = make-pro-con((pros, cons)) => {

  table(
    // ...
  )
})

The make-pro-con function can just return another function that then gets assigned to the pro-con variable.

This would guarantee cohesion without need for more in depth code review, and would also allow the make-pro-con function to parse the arguments first, allowing for error handling. This might also help us close #28 , since it would allow us to handle incorrectly passed arguments in once place, instead of on a per-component basis.

The end goal would be to make switching themes guarantee to work without compiler errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions