I have a vexing problem, and I am sorry I cannot easily provide a reprex of the issue. I have created a quarto website for my course. In that project I have created a table with some columns that have fontawesome icons that will link to either pages within the website or external links. Basically, something like this
tibble(
words = c("a", "b", "c"),
fa = "['<i class='fa-solid fa-video'></i>'](./path/to_doc.qmd)") %>%
gt() %>%
fmt_markdown(columns = c(fa)) %>%
cols_label(
words = md("<i class='far fa-calendar'></i>")
)
But it will not render with the fontawesome icons. It worked with Rmarkdown in years past. Also, it seems I was able to render it at one time, but that behavior stopped. So I do think something is wrong with the code necessarily, but with how my project is set up in some way (organized, defaults, something).
R Markdown and Quarto works a bit differently, especially regarding tables. gt will output some HTML and Quarto will parse this HTML. If you have some Markdown content to be processed you have two solutions
Or to gt a column that Quarto should process as markdown using fmt_markdown() which you are doing
Some questions:
Are you loading fontawesome somewhere in your document to be available in the rendered HTML ? Fontawesome is an external library and it needs to be included for the icon to be found.
Is this expected to have ' around the i tag ? I believe it should be
This does not insert the JS library into the resulting HTML. It just load the fontawesome R library. But you are not using any of the fontawesome function that insert in the doc, so at the end you have no JS lib in the HTML
This worked! I added the code you provided fontawesome::fa_html_dependency() to my script, and all was right again.
Thank you SO much for taking the time and having the patience to help me!
Is there a reason why I didn't need this line of code in the previous versions of my document and website (Rmarkdown)? I am just curious for my own learning.