hikerpig / gatsby-project-kb

Developing gatsby-theme-kb, a Gatsby theme for publishing Knowledge Base.
https://gatsby-project-kb.vercel.app/
MIT License
62 stars 15 forks source link

Configure location of autogenerated table of contents #2

Closed Neurrone closed 2 years ago

Neurrone commented 3 years ago

I'd like to be able to have the autogenerated table of contents appear in the text itself rather than on the right

hikerpig commented 3 years ago

I think you can achieve this by inserting something like [[TOC]] somewhere in the markdown file, and hide the right TOC completely, for now. Or is it OK for you that I provide an option like tocType: 'topOfContent' | 'rightSide' | false as built-in option?

Neurrone commented 3 years ago

Apologies for the late reply.

What'd be the behaviour for tocType: 'topOfContent'? Would it be rendered just between the h1 for the note title and the actual contents?

hikerpig commented 3 years ago

Apologies for the late reply.

What'd be the behaviour for tocType: 'topOfContent'? Would it be rendered just between the h1 for the note title and the actual contents?

I guess so

hikerpig commented 2 years ago

@Neurrone Sorry for the late response, maybe you had no interest of this anymore. I make a crude version of this feature anyway. The config is slightly different with the disscussion above. See #33 for screenshot and description.

hikerpig commented 2 years ago

This feature is available in v0.8.0