Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize custom functions in template #54

Open
mintyfrankie opened this issue Aug 11, 2024 · 0 comments
Open

Minimize custom functions in template #54

mintyfrankie opened this issue Aug 11, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mintyfrankie
Copy link
Owner

mintyfrankie commented Aug 11, 2024

Due to current Typst constraint, one still has to include some custom hacky functions in the template files. For example, in cy.typ when importing:

#import "@preview/brilliant-cv:2.1.0": cv
#let metadata = toml("./metadata.toml")
#let import-modules(modules, lang: metadata.language) = {
  for module in modules {
    include {
      "modules_" + lang + "/" + module + ".typ"
    }
  }
}

Instead of an ideal way:

#import "@preview/brilliant-cv:2.1.0": cv

This involves several files:

  • the cv.typ and letter.typ
  • every module file having to add something like #let cv-section = cv-section.with(metadata: metadata)

This involves two technical issues:

  • The path handling mechanism not being mature and stable
  • The code evaluation and execution issue

More to update in this thread, and we will see how to tackle them with Typst's upgrades.

@mintyfrankie mintyfrankie converted this from a draft issue Aug 11, 2024
@mintyfrankie mintyfrankie added the enhancement New feature or request label Aug 11, 2024
@mintyfrankie mintyfrankie self-assigned this Aug 11, 2024
@mintyfrankie mintyfrankie added this to the v2.1.0 milestone Aug 11, 2024
@mintyfrankie mintyfrankie linked a pull request Aug 11, 2024 that will close this issue
@mintyfrankie mintyfrankie removed a link to a pull request Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Short Term
Development

No branches or pull requests

1 participant