Giter Site home page Giter Site logo

不支持toc about dumi-theme-antd HOT 4 CLOSED

kuangpf avatar kuangpf commented on June 6, 2024
不支持toc

from dumi-theme-antd.

Comments (4)

KuangPF avatar KuangPF commented on June 6, 2024

用了一个简单的模板内容:

---
nav:
  title: 指南
  order: 1
group:
  title: 基础
  order: 1
title: 快速上手
---

## 第一个例子
这是一个最简单的 Ant Design 组件的在线 codesandbox 演示。

### 使用组件
直接用下面的代码替换 index.js 的内容,用 React 的方式直接使用 antd 组件。


### 探索更多组件用法
你可以在组件页面的左侧菜单查看组件列表,比如 Alert 组件,组件文档中提供了各类演示,最下方有组件 API 文档可以查阅。在代码演示部分找到第一个例子,点击右下角的图标展开代码。

## 按需加载
antd 默认支持基于 ES modules 的 tree shaking,直接引入 import { Button } from 'antd'; 就会有按需加载的效果。

你看下标题是不是二级(##)以及三级(###),另外排除下是否有 css 样式覆盖了 toc 样式,可以审查下 tocWrapper 元素
展示如下:
toc
toc-style

如果还是没有解决问题,提供一个最小复现仓库。

from dumi-theme-antd.

geektcp avatar geektcp commented on June 6, 2024

@KuangPF nice, 参考你的模板是有效的,问题可以解决。
不过bug是存在的。根源在于这个模板的toc不识别单个#,3个###这样的标题,
markdown文档是必须第一个标题是2个##开头的md文档才有右侧的toc出现。
而且开头的toc属性无效。

bug示例如下:

---
nav:
  title: te1st1111
  order: 1
toc: content
demo: 
  tocDepth: 4
group:
  title: group1
  order: 1
title: xxxx
---

# First
something1

### title2

something2


### user guide3

coment


####  xxxx
ssffff


### user guide2

coment

from dumi-theme-antd.

KuangPF avatar KuangPF commented on June 6, 2024

一级(#)会直接被识别为页面标题,所以就不在 toc 里了

from dumi-theme-antd.

geektcp avatar geektcp commented on June 6, 2024

一级(#)会直接被识别为页面标题,所以就不在 toc 里了

good, 辛苦。

from dumi-theme-antd.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.