Skip to content

Conversation

@jreades
Copy link

@jreades jreades commented Dec 16, 2023

First time writing Lua and first time tweaking a Quarto extension, but I wanted the ability to specify a color for a fontawesome icon and believe I've done it. Extension seems to run without a problem on my system (Quarto version 1.3.450 on a M2 Mac running Sonoma 14.2) so here's a pull request that is hopefully fairly easy to parse.

Color is supported in a few ways:

  • If you use a name like 'red' or 'green' then that will (presumably) only work in TeX
  • Hexadecimal seems to work in both
  • RGB triplets seem to work in both (haven't tried with an alpha blend, that probably doesn't)
    • If the triplets are in the range 0..1 and you generate HTML then they'll be converted to 0..255
    • If the triplets are in the range 0..255 and you generate TeX then they'll be converted to 0..1

Examples in example.qmd.

@cscheid
Copy link
Contributor

cscheid commented Dec 18, 2023

Thanks for the PR. We've had similar requests in the past and we haven't merged them because they were only implemented in HTML. We have a number of features in Quarto that are only supported in HTML and PDF, so I think this might be good enough coverage for us right now. @dragonstyle what do you think?

@cscheid
Copy link
Contributor

cscheid commented Dec 18, 2023

And I apologize, our PR template should have described it: we also need you to accept, sign and submit a CLA (https://github.com/quarto-dev/quarto-cli/blob/main/.github/pull_request_template.md)

@dragonstyle
Copy link

Seems good to me, esp for an extension!

@jreades
Copy link
Author

jreades commented Dec 18, 2023

Signed individual contributor license sent in to 'jj'. Apologies if I missed the PR template: while I broadly know how PRs work I've never really had to make use them so I didn't know what to look out for in terms of project-specific practices.

Noticed something in the info about udpating the changelog: is that something separate, I wasn't sure where to look for that? I did increment the version for the extension in the YAML file but, again, that might not have been the right way to do this so feel free to correct as needed. I also don't know if you have test cases that need writing to reflect this change or if the changes to the example.qmd file are enough.

jon

@cscheid
Copy link
Contributor

cscheid commented Dec 18, 2023

Apologies if I missed the PR template

No need, you didn't miss anything! It's just that some folks are not willing or able to sign CLAs, and it feels bad for them to do the work before knowing that it can't be incorporated.

@mcanouil
Copy link
Contributor

mcanouil commented Jan 30, 2024

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants