1.1.13 • Published 2 months ago
@mingchyuanko/docsify-plugin-page-toc v1.1.13
docsify-plugin-page-toc
A docsify plugin to display ToC for each page.
Usage notes
Markdown file
- Do not skip heading levels:
always start from
<h1>
, followed by<h2>
and so on. - Avoid using multiple
<h1>
elements on one page. A page should generally have a single<h1>
element that describes the content of the page.
Stylesheet
<!-- head -->
<link rel="stylesheet" href="https://unpkg.com/@mingchyuanko/docsify-plugin-page-toc/dist/toc.css">
The browser's width must be wider than 1200px.
Otherwise, you need to download the CSS file and remove the following code:
@media screen and (max-width: 1200px) {
/* … */
}
Script
<!-- body -->
<script src="https://unpkg.com/@mingchyuanko/docsify-plugin-page-toc/dist/toc.min.js"></script>
Configure docsify-plugin-page-toc
<script>
window.$docsify = {
toc: {
title: 'Table of Contents',
headings: 'h2, h3, h4, h5, h6',
},
};
</script>