Просмотр исходного кода

Add hero_button to template YAML options

master
Garrick Aden-Buie 7 лет назад
Родитель
Сommit
0af71d128a
3 измененных файлов: 11 добавлений и 4 удалений
  1. +7
    -1
      R/bulma_document.R
  2. +1
    -1
      inst/bulma/bulma.html
  3. +3
    -2
      tests/manual/layout/level/bulma_layout_level.Rmd

+ 7
- 1
R/bulma_document.R Просмотреть файл

@@ -1,6 +1,12 @@
#' Bulma Document Renderer
#'
#' TODO Document YAML options here.
#' @section YAML options:
#' You can pass additional options to the underlying template via the `bulma`
#' YAML item. The following options can be specified there.
#' \itemize{
#' \item{`hero`: Classes applied to the hero containing the title}
#' \item{`hero_button`: Classes applied to the `header_links` buttons}
#' }
#'
#' @inheritDotParams rmarkdown::html_document_base
#' @export

+ 1
- 1
inst/bulma/bulma.html Просмотреть файл

@@ -70,7 +70,7 @@ $if(date)$
$endif$
$if(header-links)$
$for(header-links)$
<a class="button is-primary is-inverted is-outlined" href="$header-links.url$">$header-links.name$</a>
<a class="button $if(bulma.hero_button)$$for(bulma.hero_button)$$bulma.hero_button$$sep$ $endfor$$else$is-primary is-inverted is-outlined$endif$" href="$header-links.url$">$header-links.name$</a>
$endfor$
$endif$ <!-- header-links -->
</div>

+ 3
- 2
tests/manual/layout/level/bulma_layout_level.Rmd Просмотреть файл

@@ -12,14 +12,15 @@ author:
extra:
- "Second Affiliation"
- "Very Cool Guy"
date: '`r strftime(Sys.time(), "%F %T")`'
date: '`r strftime(Sys.time(), "%A, %B %e, %Y")`'
header-links:
- name: Github
url: https://github.com/gerkelab
- name: Home
url: https://gerkelab.com
bulma:
hero: ["info", "bold"]
hero: ["dark"]
hero_button: ["is-secondary"]
output: bulma::bulma_document
editor_options:
chunk_output_type: console

Загрузка…
Отмена
Сохранить