- '+N(e.children)+"
diff --git a/docs/more-pages.md b/docs/more-pages.md
index 59ceb33de..dbe2e7f9c 100644
--- a/docs/more-pages.md
+++ b/docs/more-pages.md
@@ -68,3 +68,25 @@ A custom sidebar can also automatically generate a table of contents by setting
```
+
+## Ignoring Subheaders
+
+When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
+
+```markdown
+# Getting Started
+
+## Header {docsify-ignore}
+This header won't appear in the sidebar table of contents.
+```
+
+To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
+
+```markdown
+# Getting Started {docsify-ignore-all}
+
+## Header
+This header won't appear in the sidebar table of contents.
+```
+
+Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
diff --git a/lib/docsify.js b/lib/docsify.js
index 7b60b40fb..e76a23f10 100644
--- a/lib/docsify.js
+++ b/lib/docsify.js
@@ -2992,10 +2992,24 @@ markdown.update = function () {
* @link https://github.com/chjj/marked#overriding-renderer-methods
*/
renderer.heading = function (text, level) {
+ var nextToc = { level: level, title: text };
+
+ if (/{docsify-ignore}/g.test(text)) {
+ text = text.replace('{docsify-ignore}','');
+ nextToc.title = text;
+ nextToc.ignoreSubHeading = true;
+ }
+
+ if (/{docsify-ignore-all}/g.test(text)) {
+ text = text.replace('{docsify-ignore-all}','');
+ nextToc.title = text;
+ nextToc.ignoreAllSubs = true;
+ }
+
var slug = slugify(text);
var url = toURL(currentPath, { id: slug });
-
- toc.push({ level: level, slug: url, title: text });
+ nextToc.slug = url;
+ toc.push(nextToc);
return ("
'+t.slice(5).trim()+"
"}function I(e){return""}function z(e,t){return t={exports:{}},e(t,t.exports),t.exports}function H(e,t){var n=[],r={};return e.forEach(function(e){var i=e.level||1,a=i-1;i>t||(r[a]?r[a].children=(r[a].children||[]).concat(e):n.push(e),r[i]=e)}),n}function R(e){if("string"!=typeof e)return"";var t=e.toLowerCase().trim().replace(/<[^>\d]+>/g,"").replace(Ue,"").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^(\d)/,"_$1"),n=De[t];return n=De.hasOwnProperty(t)?n+1:0,De[t]=n,n&&(t=t+"-"+n),t}function W(e,t){return'"+a(e.message+"",!0)+"";throw e}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:l,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:l,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:l,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=s(p.item,"gm")(/bull/g,p.bullet)(),p.list=s(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=s(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=s(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/
'+(n?e:a(e,!0))+"\n
\n":""+(n?e:a(e,!0))+"\n
"},r.prototype.blockquote=function(e){return"\n"+e+"\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return"
"+e+"
\n"},r.prototype.table=function(e,t){return""+e+"
"},r.prototype.br=function(){return this.options.xhtml?"