-
Notifications
You must be signed in to change notification settings - Fork 390
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
Parametric packaging? (e.g., replicating @iconify-json/<icon-set>
from Iconify's NPM packages)
#1101
Comments
Hello! To answer your questions:
#import "@preview/iconify-academicons:1.2.8": academicons
#academicons.arxiv i. You don't have to write to temporary files (which Typst can't do anyways), you can pass a SVG string to Also, we have some naming guidelines, so unless you are the owner of iconify, the package names you used in your example won't be accepted. |
Thanks for your quick reply! 🙂 Re: (1) – sweet. I hadn't considered turning Re: (2) – hmm... I'll need to look over how I was trying to use Re: (3) – definitely understood. 👍 I'll poke around and figure out which icon sets make the most sense to package and a less impactful update schedule. Re: naming – I'm not the owner, but I wonder if obtaining permission from Iconify would allow for the naming to maintained? (i.e., Would written permission suffice? Does the package need to come from Iconify's GitHub org? etc.) There might be another route, to avoid bloating the git-based package registry. Iconify has an API that can be queried for SVG code – though this would require that users have a constant network connection (at least when requesting "un-cached" icons). I don't know what Typst's view on constant network connectivity is, though. (Btw, for "un-cached" icons – I'm really referring to icons which are placed in However, to pull this API-route approach off, it seems like I'd need to write the extension in Rust then compile it to WASM? This seems like an undocumented capability (or perhaps even an unsupported one). I'm basing this conclusion off the implementation of the |
I would prefer to have the package(s) be part of the iconify GitHub org, because once the name is reserved they won't be able to claim it back if you can't personally maintain it anymore. Having it in the org makes it clear that other people own the package as well, and can submit new versions. Using the API would not work, as Typst doesn't let you access network, not even through a WebAssembly plugin (they are quite limited in what they can do, there is no file system API either for instance). |
Circling back – after chatting with the primary maintainer of Iconify. Looks like there's no getting permission to use Iconify. (c.f. this discord message – for details on joining this Discord (Anthony Fu's), see here). Would using the name |
Okay, thank you for keeping me updated.
|
Regarding the name, I have an idea: Typstonomicon (a wordplay on Necronomicon, like Cryptonomicon). It has Typst, icon and the connotation of a grand book/grimoire (icons sometimes do look magical/alchemical). |
That’s wonderful! I was going to make a package for the Phosphor Icons (I intended to name it 15P, |
Description
Not quite an issue, more-so a feature request. I'm in the middle of porting https://github.com/iconify/icon-sets to Typst so we can have our pick of SVG icons (without needing them as fonts 🎉)!
Iconify has a really slick layout (mostly for tree-shaking, if I understand correctly) where users can install an icon-set's JSON to support it (rather than having to install all 150+ icon sets, which turns in to something like 200K+ icons).
I'm not sure that Typst has/needs tree-shaking the way that web-oriented projects do, but the full package I've built (https://github.com/jmuchovej/typst-iconify) is north of 1GB because it has almost all the icons included.
There's two packaging strategies I can think of for the
typst-iconify
project:typst-iconify
just packages up the entire Iconify library (200K+ icons, relevant JSON/SVGs is ~950MB as of 15 Oct 2024).typst-iconify
has some kind setup like...@preview/iconify
(core library) and users can add@preview/iconify-{iconset}
where{iconset}
might beacademicons
,carbon
,catppuccin
,fa
(font awesome), etc.(1) is by far the most straightforward, but it introduces some critical problems:
typst-iconify
is stable, I suspect that the icon sets will update far more frequently than the core package code – having some way to separate these concerns would be ideal – however I'm not sure how. (It appears that@iconify-json/{iconset}
essentially installs the correspondingJSON
file in a shared directory that other@iconify/...
tools know how to access. (If Typst supports similarly, I'd be more than happy to explore that, I just don't know where/if that's possible.)In the current packaging approach, where everything is namedspaced under
@preview/...
I don't think this avoids the patch-version explosion (though it could still cause significant version explosion because the icon sets appear to be upgraded pretty regularly).So, this leads me to my questions:
academicons
JSON files that@preview/iconify
knows how to parse to some shared location?@preview/iconify
dynamically loads SVG data, the packaged code in@preview/iconify-academicons
will be an SVG string, butimage
requires a file-path.The text was updated successfully, but these errors were encountered: