| css_files <- c(css_files, "--css", css_file) | css_files <- c(css_files, "--css", css_file) | ||||
| } | } | ||||
| } | } | ||||
| # rmarkdown::html_document_base( | |||||
| # pandoc_args = c( | |||||
| # css_files, | |||||
| # pandoc_args, | |||||
| # "--template", | |||||
| # system.file("bulma", "bulma.html", package="bulma") | |||||
| # ), | |||||
| # ... | |||||
| # ) | |||||
| deps <- list( | deps <- list( | ||||
| htmltools::htmlDependency( | htmltools::htmlDependency( | ||||
| name = "bulma", | name = "bulma", | ||||
| args = c( | args = c( | ||||
| css_files, | css_files, | ||||
| pandoc_args, | pandoc_args, | ||||
| "--variable", "rmarkdown-will-handle-deps", | |||||
| "--template", | "--template", | ||||
| bulma_file("bulma", "bulma.html") | bulma_file("bulma", "bulma.html") | ||||
| ), | ), | ||||
| clean_supporting = TRUE, | clean_supporting = TRUE, | ||||
| base_format = rmarkdown::html_document_base( | base_format = rmarkdown::html_document_base( | ||||
| self_contained = TRUE, template = NULL, | self_contained = TRUE, template = NULL, | ||||
| pandoc_args = pandoc_args, | |||||
| # pandoc_args = pandoc_args, | |||||
| mathjax = mathjax, | mathjax = mathjax, | ||||
| extra_dependencies = extra_dependencies | extra_dependencies = extra_dependencies | ||||
| ) | ) |
| </script> | </script> | ||||
| $if(toc)$ | $if(toc)$ | ||||
| <script src="gumshoe.js"></script> | |||||
| <script src="vanillajs-scrollspy.min.js"></script> | |||||
| $if(rmarkdown-will-handle-deps)$ | |||||
| $else$ | |||||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/gumshoe/3.5.1/js/gumshoe.min.js"></script> | |||||
| <script src="https://raw.githubusercontent.com/ederssouza/vanillajs-scrollspy/master/dist/vanillajs-scrollspy.min.js"></script> | |||||
| $endif$ | |||||
| <script> | <script> | ||||
| gumshoe.init({activeClass: "has-text-weight-semibold"}); | gumshoe.init({activeClass: "has-text-weight-semibold"}); | ||||
| const toc = document.querySelector('#toc-aside'); | const toc = document.querySelector('#toc-aside'); |
| ### Heading/Number Style | ### Heading/Number Style | ||||
| ```r | ```r | ||||
| bulma_level("Tweets" = 3456, Following = 123, Followers = "456K", Likes = 789, style = "header") | |||||
| bulma_level("Tweets" = 3456, Following = 123, Followers = "456K", Likes = 789, type = "header") | |||||
| ``` | ``` | ||||
| `r bulma_level("Tweets" = 3456, Following = 123, Followers = "456K", Likes = 789, style = "header")` | |||||
| `r bulma_level("Tweets" = 3456, Following = 123, Followers = "456K", Likes = 789, type = "header")` | |||||
| #### Dynamic Level | #### Dynamic Level | ||||
| ```{r} | ```{r} | ||||
| iris_values <- purrr::map(iris, ~ length(unique(.))) | iris_values <- purrr::map(iris, ~ length(unique(.))) | ||||
| bulma_level(iris_values, style = "header") | |||||
| bulma_level(iris_values, type = "header") | |||||
| ``` | ``` | ||||