Closed silverfoxdoc closed 6 months ago
Right, that usage is currently not implemented (it also wont work like that for R Markdown documents). An immediate fix to get that working is to include the path to the file in the function, as you note, like this:
---
title: "reprex"
format: pdf
---
```{r}
#| label: libraries
library(wordcountaddin)
Word Count: r wordcountaddin:::word_count('my_reprex.qmd')
Quarto enables you to weave together content and executable code into a finished document.
Which gives this output:
<img width="461" alt="image" src="https://github.com/benmarwick/wordcountaddin/assets/1262179/d583199c-49ee-47ba-8ad2-d622ae755b76">
word_count() doesn't currently work with quarto documents when it is used inline, see reprex below. It does however give a word count if the same qmd document is passed to it directly though
word_count("reprex.qmd")
Gives this error:
Is this fixable?
Word Count:
r wordcountaddin:::word_count()
Quarto
Quarto enables you to weave together content and executable code into a finished document.