Comments (5)
Which means I may have wasted your time somewhat here.
Time is not wasted. Always happy to help, and I think I should warn and ignore or error differently than it is today when not in rmarkdown.
If I can figure out a minimal reprex for this failure I'll post it as an issue for {rmarkdown} directly.
Yes please do. There may already be some threads with rendering in iteration. It is possible that this is safer to wrap the render() call with callr so that it happens in background fresh session for each iteration.
from fontawesome.
Current implementation does not support knitr::knit()
directly. If you try with rmarkdown::render()
, this is working right ?
The method would need to be adjusted but currently markdown output is not supported to include icons.
knitr::knit()
-ing a Rmd will output to .md
file - there is no hint on the output format. (The YAML header you provide in Rmd is for rmarkdown)
Not sure what we should output in that case. We handle gfm
format by including svg but no other markdown variant is supported, and no icon will be included.
Can you tell more about your use case for knitr::knit()
instead of rmarkdown::render()
? What would be your expected output in the markdown file ?
from fontawesome.
My use case for knitr::knit()
is an edge case.
I have many .Rmd to programmatically run, a fair few of these have issues that prevent rmarkdown::render()
from working. Those are harder to diagnose/fix. I looked at knitr::knit()
as an alternative as fewer .Rmd failed in that direction, and the issue turned out to be this which I could diagnose and turn into a reprex.
Here's a real-world example of an .Rmd with this issue
---
title: "Untitled"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(fontawesome)
colours_ggplot2_components <- as.list(setNames(ggpomological:::pomological_palette[1:5], c("aesthetics", "geoms", "scales", "guides", "themes")))
```
- `r fa(name = "ruler-combined", fill = colours_ggplot2_components$aesthetics)` <span style='color:`r colours_ggplot2_components$aesthetics`'>Aesthetics</span>
- `r fa(name = "shapes", fill = colours_ggplot2_components$geoms)` <span style='color:`r colours_ggplot2_components$geoms`'>Geoms</span>
- `r fa(name = "balance-scale", fill = colours_ggplot2_components$scales)` <span style='color:`r colours_ggplot2_components$scales`'>Scales</span>
- `r fa(name = "tags", fill = colours_ggplot2_components$guides)` <span style='color:`r colours_ggplot2_components$guides`'>Guides</span>
- `r fa(name = "paint-roller", fill = colours_ggplot2_components$themes)` <span style='color:`r colours_ggplot2_components$themes`'>Theme</span>
When rmarkdown::render()
is used the output looks like this
from fontawesome.
Yes currently fontawesome will only output some icons when used with rmarkdown. When using knit()
on a .Rmd
the output is an .md
file and we can't assume by default that icons should be included with HTML output in mind in a later step.
What would you expect as content in the result from your knitr::knit()
step ? What is your workflow for those special Rmd files ?
I would prefer to fix the issue why those files don't support rmarkdown::render()
. rmarkdown will do a lot of default setting for knitr so you can"t expect to have the same type of output by calling knitr::knit()
yourself. But you may already know that 😅
Regarding this issue, I am currently thinking of correctly ignoring the icons when an output format is not defined (meaning rmarkdown / Pandoc is not used).
Inline chunk does not take options so I am not sure we could make a special behavior.
I am really interested of what output your wish as a result of knitr::knit("my.Rmd")
from fontawesome.
Ah, I didn't already know this. I inherited a script that was attempting to do knitr::knit()
and pushed on with that without really thinking that I was generating .md
files instead of what the YAML specified the output format as.
Which means I may have wasted your time somewhat here. The issues I was having with rmarkdown::render()
only appear when I'm attempting to purrr::walk()
over a collection of .Rmd files and weren't connected {fontawesome}
. If I can figure out a minimal reprex for this failure I'll post it as an issue for {rmarkdown}
directly.
from fontawesome.
Related Issues (20)
- pandoc error 4compatibility.woff2: withBinaryFile: does not exist (No such file or directory) HOT 1
- Vertical alignment HOT 1
- Release fontawesome 0.5.0
- [Bug] fa has conflict with {omsvg} package
- Release fontawesome 0.5.1
- Release fontawesome 0.5.2
- `fa_i()` shouldn't have `aria-label` with `role="presentation"`
- When `title` is provided, `fa()` should set `a11y="sem"`
- Allow percent `%` symbol for css unit (`parse_length_unit()`)
- Browser warning with "Glyph bbox was incorrect"
- Include fontawesome beta version 6 icons HOT 2
- Add an article in pkgdown website to show all the possible icon available with the embeded version HOT 4
- FontAwesome licensing woes HOT 1
- Examples missing from the pkgdown website homepage HOT 1
- Release fontawesome 0.3.0
- {fontawesome} doesn't recognize aliases (though they render just fine) HOT 4
- Verify FA - Turn off globally HOT 3
- Release fontawesome 0.4.0
- An error occurs when compiling pandoc. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fontawesome.