rmarkdown-在site.yml中指定输出主题会删除导航栏

时间:2019-02-09 07:46:18

标签: r r-markdown

我试图将输出主题设置为一个位置,而不是将其放置在每个rmarkdown文件的yaml标头中。所以我尝试了:

name: "casualties"
output_dir: "injuries"


navbar:
  left:
    - text: "Casualties"
      href: index.html
    - text: "Casualty map"
      href: casualtymap.html
    - text: "Frequently asked questions"
      href: faqs.html

output: 
    prettydoc::html_pretty:
          theme: cayman
          highlight: github

然后每个页面都有

---
title: "page title"
---

,但导航栏不出现。如果我删除了输出信息,那就可以了。有办法做到这一点吗?

编辑: 根据Anthon的评论,我从bookdown guide中的示例中提取了缩进,发现:

使用prettydoc不会显示导航栏:

name: "Casualties"

navbar:
  left:
    - text: "Casualties"
      href: index.html
    - text: "Casualty map"
      href: casualtymap.html
    - text: "Frequently asked questions"
      href: faqs.html

output_dir: "injuries"

output: 
  prettydoc::html_pretty:
    theme: cayman
    highlight: github

但是如果我不使用prettydoc,则会显示导航栏:

name: "Casualties"

navbar:
  left:
    - text: "Casualties"
      href: index.html
    - text: "Casualty map"
      href: casualtymap.html
    - text: "Frequently asked questions"
      href: faqs.html

output_dir: "injuries"

output:
  html_document:
    theme: cosmo
    highlight: textmate

0 个答案:

没有答案