heading() 渲染带锚点的标题:点击文本跳转到锚点,悬停/聚焦时出现 ghost
复制按钮,复制 #<id> 链接。
heading(2, '安装', { id: 'installation' });heading(3, '从源码安装', { id: 'from-source' });heading(3, '从仓库安装', { id: 'from-registry' });data-cpd-step 标记
heading(2, '创建账号', { id: 'create-account', step: true });level1–6
标题层级(第一个参数)。
textstring
标题文本(第二个参数)。
idstring
锚点 id——复制链接按钮也使用它。
stepboolean
标记为 Plumest TOC 阶数项(
data-cpd-step)。- 锚点链接为
href="#<id>";复制按钮复制location.origin + pathname + #<id>绝对地址。 step标题在文章内渲染阶数徽标,并在 Plumest TOC 中显示编号徽章。