Skip to content

iconify:0.4.3#4441

Open
ecstrema wants to merge 1 commit intotypst:mainfrom
ecstrema:iconify-0.4.3
Open

iconify:0.4.3#4441
ecstrema wants to merge 1 commit intotypst:mainfrom
ecstrema:iconify-0.4.3

Conversation

@ecstrema
Copy link

I am submitting

  • a new package
  • an update for a package

Description: Explain what the package does and why it's useful.

Allows to use any icon from icones.js.org.

I have read and followed the submission guidelines and, in particular, I

  • selected a name that isn't the most obvious or canonical name for what the package does
  • added a typst.toml file with all required keys
  • added a README.md with documentation for my package
  • have chosen a license and added a LICENSE file or linked one in my README.md
  • tested my package locally on my system and it worked
  • excluded PDFs or README images, if any, but not the LICENSE
  • ensured that my package is licensed such that users can use and distribute the contents of its template directory without restriction, after modifying them through normal use.

@typst-package-check typst-package-check bot added the new A new package submission. label Mar 26, 2026
@ecstrema
Copy link
Author

All good. The warnings are expected. This bundles all of the icons. It is indeed quite large, but that's expected, since it gives you access to tens of thousands of icons.

@ecstrema
Copy link
Author

I've been told on the discord that the package was too big to be accepted.

I see two ways of condensing it:

  1. bundling only a few well known icon sets. This greatly diminishes the package size. I could pick the 10 most common, which would make the whole bundle ~10MB.
  2. Let the user provide the json with the iconsets it wants and save that in a cache
  3. Make the library provide generator functions: functions that return functions for generating the icon.

Option 1 goes against the whole point of iconify: use any iconset.

Option 2 is less ergonomic, and is hard to implement in typst: You'd have to have impure functions, unless the user gives the icon sets at every invocation. This would need to be done in rust. Or the user would have to wrap the functions in their own wrappers:

#let myicon(..args) = icon(json-icons: json("mdi.json"), ..arg)

#myicon("mdi:home")

Option 3 (like option 2), is ok as long as the document is in a single document. Else, we need to extract it into a shared package, and import it everywhere we need it.

I barely have experience in typst, so I'd like your input on the best way to do it:

  • How do other packages do it?
  • Is there any other way to keep a state, without relying on wasm?
  • I remember reading somewhere that host project files cannot be accessed by the package. Is there a workaround that? A permission in typst.toml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new A new package submission.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant