quarto-ext / fontawesome

Use Font Awesome icons in HTML and PDF documents.
MIT License
105 stars 10 forks source link

Support typst #31

Open cscheid opened 1 year ago

cscheid commented 1 year ago

We got a question on out typst talk today about typst support for icons. This extension should support it. There's typst code for fontawesome here: https://github.com/matchy233/typst-chi-cv-template/blob/main/fontawesome.typ

We should make this all work.

cderv commented 1 year ago

Related issue on typst to follow

Someone made a typst library for it for now: https://github.com/duskmoon314/typst-fontawesome (it is findable in search list at https://typst.app/docs/packages/). They have nice syntax and lots of icons it seems: https://typst.app/project/rQwGUWt5p33vrsb_uNPR9F

I just learnt about this experimental package repo: https://github.com/typst/packages Really cool to see all this available!

elipousson commented 8 months ago

I made some progress on this but I'm not very familiar with Lua so I think I may still be missing some issues. I was able to implement support for relative sizes (e.g. "2xs" to "2xl"), limited support for groups ("brands" group only), and colored fill.

Unfortunately, while these all work for inline shortcodes—the shortcodes in the table from the example don't render as expected. In addition, the shortcode errors when used with LaTeX sizes ("tiny" to "Huge") and the literal sizes for HTML ("1x" to "10x"). The latter issues seem solvable (I'm just unsure how) but the first issue has me stumped. The shortcode also worked in tables before I implemented the group parameter!

Tips or suggestions of changes to try are welcome.

elipousson commented 7 months ago

I just made a few updates to the PR:

Literal sizes for HTML ("1x" to "10x") are still not handled well and color-handling could be improved but it is coming together. No rush to review @cscheid but just wanted to make sure you saw this existed.

cscheid commented 7 months ago

@elipousson we're a bit swamped right now as you have noticed. I'll get to it when I can.