浏览代码

Add hero_button to template YAML options

master
父节点
当前提交
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

正在加载...
取消
保存