Recent searches


No recent searches

Nicholas Smolney's Avatar

Nicholas Smolney

Joined Apr 15, 2021

·

Last activity Oct 27, 2021

Following

0

Followers

0

Total activity

5

Votes

0

Subscriptions

3

ACTIVITY OVERVIEW

Latest activity by Nicholas Smolney

Nicholas Smolney commented,

Community comment Discussion - Tips and best practices from the community

and if anyone else is interested, I made a small addition to my css file to indent for subsequent levels

 

.toc ul{
padding-left: 20px;
}

View comment · Posted May 25, 2018 · Nicholas Smolney

0

Followers

0

Votes

0

Comments


Nicholas Smolney commented,

Community comment Discussion - Tips and best practices from the community

Hey Dave, see below for how I addressed this:

Basically the code didn't account for the case when your next heading is going back a level (current_level < previous_level), so I added that case and added an array to keep track of the previous levels.

/*** Table of contents code ***/
var $headers = $('.article-body h1');

if ($headers.length > 0) {
var $toc = $('

');
var $firstUl = $('

View comment · Posted May 25, 2018 · Nicholas Smolney

0

Followers

0

Votes

0

Comments