-
-
Notifications
You must be signed in to change notification settings - Fork 979
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
Insure fontawesome V4 compatibility in navbar #1994
Conversation
Adding fas by default will break V4 compatibility. New handling will be : - Use fill prefix + name for V5+ - support V4 fa + name if passed - Still add deprecated fa prefix if no prefix is passed for V4 compatibility
@cderv A small request: would you be able to add a bullet to |
I already added the NEWS for previous change b71f9b0 and yes I'll add one here - usually I do that before merging but I should do earlier to not forget maybe. Thanks ! |
@jdblischak I may rethink this in the future (and it is part of why this is not merged). |
@cderv Thanks for the update. My current workaround is to explicitly add the "fab" prefix for rmarkdown >= 2.6. Will this continue to work even if you add the feature to automatically add "fab"? My reading of your description in #2042 is that "if needed" means my workaround will continue to work.
|
Yes if a prefix is added I believe we should not touch it and leave as-is. But this also would mean if we follow this road that you may not need this workaround anymore as that it what rmarkdown would do for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I tend to merge this PR for now instead of waiting for the fontawesome package to get rid of its heavy dependencies. BTW, depending on a completely new CRAN package means its binaries won't be available for older versions of R, which could be a trouble for Windows users, so I'd wait for even longer before we use fontawesome in rmarkdown (perhaps after three or five new versions of R have been released).
Anyway, I'll let you decide on this one. Thanks!
I'll merge this as this is an expected fix and I do not know when I'll work on adding direct fontawesome package support. Thanks @yihui. |
* rstudio_origin/master: (90 commits) start the next version CRAN release v2.9 fix rstudio#2163: do not normalize web paths in the css argument of html output formats (rstudio#2164) Add a css file for future tests Restore previous shiny theme when run() exits (rstudio#2160) Correct name in workflow file Add a workflow to test Pandoc nighly (rstudio#2153) bslib 0.2.5.1 is now on CRAN use `stop2()` from knitr internal instead of `stop(..., call. = FALSE)` (rstudio#2152) 74e2f2f changed the error message, and a test relies on the content of this message (it probably shouldn't be so specific) tweak wording Support 'href' dependencies (rstudio#2151) Loop correctly on splitted file by file_scope function (rstudio#2150) update snapshot file following change in test name in a8aad75 amend 84ff469: clarify the meaning of fig_crop = 'auto' in the doc Add the position of the last character (rstudio#2146) don't put the checklist in the comment since it is required Fix for lost encoding in shiny_prerendered_html. (rstudio#2140) Insure fontawesome V4 compatibility in navbar (rstudio#1994) fix rstudio#2043: replace parse(text) with xfun::parse_only() to avoid hanging the R session when the input is empty ...
Merge remote-tracking branch 'rstudio_origin/master' into jg-devel * rstudio_origin/master: (64 commits) start the next version CRAN release v2.9 fix rstudio#2163: do not normalize web paths in the css argument of html output formats (rstudio#2164) Add a css file for future tests Restore previous shiny theme when run() exits (rstudio#2160) Correct name in workflow file Add a workflow to test Pandoc nighly (rstudio#2153) bslib 0.2.5.1 is now on CRAN use `stop2()` from knitr internal instead of `stop(..., call. = FALSE)` (rstudio#2152) 74e2f2f changed the error message, and a test relies on the content of this message (it probably shouldn't be so specific) tweak wording Support 'href' dependencies (rstudio#2151) Loop correctly on splitted file by file_scope function (rstudio#2150) update snapshot file following change in test name in a8aad75 amend 84ff469: clarify the meaning of fig_crop = 'auto' in the doc Add the position of the last character (rstudio#2146) don't put the checklist in the comment since it is required Fix for lost encoding in shiny_prerendered_html. (rstudio#2140) Insure fontawesome V4 compatibility in navbar (rstudio#1994) fix rstudio#2043: replace parse(text) with xfun::parse_only() to avoid hanging the R session when the input is empty ... # Conflicts: # DESCRIPTION # R/html_dependencies.R
Merge remote-tracking branch 'rstudio_origin/master' into minimal-tree-fix * rstudio_origin/master: (223 commits) start the next version CRAN release v2.9 fix rstudio#2163: do not normalize web paths in the css argument of html output formats (rstudio#2164) Add a css file for future tests Restore previous shiny theme when run() exits (rstudio#2160) Correct name in workflow file Add a workflow to test Pandoc nighly (rstudio#2153) bslib 0.2.5.1 is now on CRAN use `stop2()` from knitr internal instead of `stop(..., call. = FALSE)` (rstudio#2152) 74e2f2f changed the error message, and a test relies on the content of this message (it probably shouldn't be so specific) tweak wording Support 'href' dependencies (rstudio#2151) Loop correctly on splitted file by file_scope function (rstudio#2150) update snapshot file following change in test name in a8aad75 amend 84ff469: clarify the meaning of fig_crop = 'auto' in the doc Add the position of the last character (rstudio#2146) don't put the checklist in the comment since it is required Fix for lost encoding in shiny_prerendered_html. (rstudio#2140) Insure fontawesome V4 compatibility in navbar (rstudio#1994) fix rstudio#2043: replace parse(text) with xfun::parse_only() to avoid hanging the R session when the input is empty ... # Conflicts: # DESCRIPTION # NEWS.md # R/html_dependencies.R
This aims to fix #1991. The issue is that
fas
is now the default prefix instead of deprecatedfa
prefix, so we used that in #1967. However, rmarkdown was previously taking care of addingfa
prefix to icon in navbar.And it was working because fontawesome as shims for V4 compatibility (in v4-shims.css). For example, this was working:
because
fa
was added leading tofa fa-github
which is taking care of by the V4 shims compatibility layer.Our change would lead to add
fas
in this case, leading tofas fa-github
which is wrong as it should befab fa-github
As we don't really have a way to know if
fas
orfab
should be added without parsing the list of icons, I think it is enough we no more add any prefix in icon in navbar for fontawesome 5.This means :
fab fa-r-project
(original issue in Support for Font Awesome 5 glyphs in navbar #1554)fa-<iconname>
will always be prefixed withfa
(fa fa-<iconname>
) notfas
. This will insure V4 compatibility. All the more because it seems that in V5,fa
can still be used even if the default isfas
now.fa fa-<iconname>
directly, don't duplicate the prefix and keep it that way.I think this should be good now.