Skip to content
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

Could one set formatting preferences for a whole Rmd? #4

Open
maelle opened this issue Mar 22, 2020 · 3 comments
Open

Could one set formatting preferences for a whole Rmd? #4

maelle opened this issue Mar 22, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@maelle
Copy link

maelle commented Mar 22, 2020

This is either my reading the docs wrong or asking for a feature. 🙏

Say I want all the backgrounds to be blue, at the moment if I follow correctly I need to set the argument value in each flair()/txt_style() call. Would it be possible/valuable to add a mechanism to set a theme/set of options for a document?

For instance there could be an option,

options(flair.style = list(background = "pink", color = "CornflowerBlue"))

and then in

https://github.com/kbodwin/flair/blob/566453d0c1cf26183d969f4c9f774a174f2d5b3a/R/txt_style.R#L46

list(...) could be combined with getOptions("flair.style", NULL)?

@kbodwin
Copy link
Collaborator

kbodwin commented Mar 22, 2020

I LOVE this idea.

I'll try to implement it later this week. :)

@kbodwin
Copy link
Collaborator

kbodwin commented Mar 22, 2020

An intermediate solutions is to save your options as a list manually, and pass that in every time. Not quite as elegant as your idea.

my_opts <- list(background = "pink", color = "CornflowerBlue")
decorate("a_chunk") %>% flair("iris", my_opts)

@maelle
Copy link
Author

maelle commented Mar 22, 2020

but still quite handy, thank you!

@kbodwin kbodwin added the enhancement New feature or request label Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants