Table of Contents for HTML Version


#1

The table of contents that StackEdit produces I consider to be one of it’s great value adds though I noticed that the TOC for the PDF version goes to more levels than the HTML version. Any chance you might get the HTML version to go one more level deep?


#2

Indeed, you can:

  1. Copy the “Styled HTML with TOC” into a new template
  2. Replace {{#tocToHtml files.0.content.toc 2}}{{/tocToHtml}} with {{#tocToHtml files.0.content.toc 3}}{{/tocToHtml}}, or remove the number to have a full depth TOC

#3

Awesome! Most appreciated.


#4

Benoit, the TOC in StakEdit looks marvelous with indents and size differences and this is reflected in the PDF version. Any chance this could also be replicated in the Styled HTML version of the document?


#5

I have the same question.


#6

Same question from me.
Possibly create my own css?


#7

I used a bit of a brute force approach.

Downloaded https://stackedit.io/style.css locally.
Added this at the bottom

.stackedit__toc ul ul{
	padding-left: 15px;
}

Then referenced the local version of the .css file.

If that helps.


#8

Has this code changed recently? I’m looking at the code for “Styled HTML with TOC” and can’t find {{#tocToHtml files.0.content.toc 2}}{{/tocToHtml}}.

In fact the only occurrence of “toc” is inside:

<body class="stackedit">
  <div class="stackedit__left">
    <div class="stackedit__toc">

Like @systemswiki, I would also like the HTML version’s TOC to go one more level deep but can’t find the code to modify. Hope there’s a new solution. Thanks.