node-slate icon indicating copy to clipboard operation
node-slate copied to clipboard

Question: I want to have my H2s not be folded by default

Open jdsimcoe opened this issue 9 years ago • 4 comments

Loving node-slate but I want my H2s not to collapse and expand by default, only H3s. How would I go about this?

jdsimcoe avatar Oct 26 '16 23:10 jdsimcoe

I think you'd need to modify source/javascripts/app/_toc.js, but I am not sure exactly how. I realize this is not very helpful 😞

sibartlett avatar Oct 27 '16 00:10 sibartlett

@jdsimcoe might be worth asking in Ruby Slate, as this applies to all versions of Slate using tocify? I had a quick look at the tocify website, but I couldn't see any way to keep the H2s in the TOC but all expanded by default - if that's what you meant?

If you only want H1s and H3s in the TOC you can change source/javascripts/app/_toc.js to have

  var makeToc = function() {
    global.toc = $("#toc").tocify({
      selectors: 'h1, h3',

MikeRalphson avatar Oct 27 '16 06:10 MikeRalphson

@MikeRalphson Yeah I want the H2s in there but everything (except expanded except the H3s)

jdsimcoe avatar Oct 27 '16 15:10 jdsimcoe

Thanks @sibartlett, I'll look into it.

jdsimcoe avatar Oct 27 '16 15:10 jdsimcoe