Vuepress: allow markdown.toc.includeLevel override for specific pages

Created on 17 Jun 2018  路  5Comments  路  Source: vuejs/vuepress


Bug report



My Page is structured with a lot of headlines, separating sections. I want so specify ony this one page to have a detailed rendered table of contents. I would not setup these detailed level for the complete project documentation. See attached example.

Version

$ npx vuepress --version
0.10.1

Steps to reproduce

---
sidebarDepth: 2
markdown:
  toc:
    includeLevel:
      - 2
      - 3
      - 4
---

# My Page

[[toc]]

## Headline A

### Headline A1
#### A first

### Headline A2
#### A second

### Headline A3
#### A third

## Headline B

### Headline B1
#### B first

### Headline B2
#### B second

### Headline B3
#### B third

What is expected?

[[toc]] should respect page configuration for markdown.toc.includeLevel and all headlines should be rendered trought the table of contents for this page, in my example.

:octocat: https://vuepress.vuejs.org/config/#markdown-toc

What is actually happening?

markdown.toc.includeLevel is being ignored in documents Front Matter. I can only setup includeLevel globally in config.js

Other relevant information

  • Your OS: Mac OS X 10.13.5
  • Node.js version: v9.10.1
  • Browser version: Chrome v67
  • Is this a global or local install? local
  • Which package manager did you use for the install? npm
feature request

Most helpful comment

I would love this feature too ...

All 5 comments

Please use config.js to set markdown config since all markdown configurations are for global, not for a particular page.

BTW, please have a closer look to the documentation, Thank you.

@ulivz Thank you for making this clear. I've checked the documentation carefully and just was wondered because for example sidebarDepth can also be set for a particular page. And this is very useful, of course.

Anyway, you are fast in responding and closing issues. In my eyes, it's first a bug (because it's not explicitly described) and maybe can transform into a discussion about how valuable this is for the future and product. 鉁岋笍馃尰

+1

I would love this feature too ...

Fixed due to #1375.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kid1412621 picture kid1412621  路  3Comments

herrbischoff picture herrbischoff  路  3Comments

gaomd picture gaomd  路  3Comments

shaodahong picture shaodahong  路  3Comments

tinchox5 picture tinchox5  路  3Comments