Include table of contents in flexdashboard

不想你离开。 提交于 2020-02-20 06:06:32

问题


I would like to include a table of contents in my flexdashboard document.

Exactly like the table of contents we can see in the documentation : http://rmarkdown.rstudio.com/flexdashboard/using.html

I have tried to add toc:true as in a classical RMarkdown document but it does not seem to work.

---
title: "Reporting"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: scroll
    toc: true
---


# Page1

Row
-----------------------------------------------------------------------

## chap1

### chart 1

```{r cars1, echo=FALSE}
plot(pressure)
```


### chart 2
```{r cars2, echo=FALSE}
plot(pressure)
```

Row
-----------------------------------------------------------------------

## chap2

### chart 3
```{r pressure, echo=FALSE}
plot(pressure)
```

# Page 2

Row
-----------------------------------------------------------------------

### p2 chap 1
```{r test}
plot(pressure)
```


Row
-----------------------------------------------------------------------
### p2 graph2

```{r test2, echo=FALSE}
plot(pressure)
```

In this example, I would like to see in Page 1 a table of contents containing two lines : chap1 and chap2. In Page 2 I don't need a table of contents.

How can I do that ?

Thank you.

来源:https://stackoverflow.com/questions/45962767/include-table-of-contents-in-flexdashboard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!