just-the-docs icon indicating copy to clipboard operation
just-the-docs copied to clipboard

Table of Contents always appears below content

Open organismzero opened this issue 5 years ago • 1 comments

Describe the bug Documentation states that the Table of Contents should appear within the content where you use {:toc}, however this isn't happening. No ToC appears there, instead it always appears at the bottom of the content.

This actually makes sense, because looking at the default.html file, that's exactly where the ToC is placed (immediately following the content). But it doesn't use {:toc}. In fact, it looks like {:toc} doesn't do anything at all.

To Reproduce Steps to reproduce the behavior:

  1. Install just-the-docs
  2. Create a page with child pages
  3. See error

Expected behavior Table of Contents should appear within the content where you use {:toc}, however this isn't happening. No ToC appears there, instead it always appears at the bottom of the content.

Screenshots

Screen Shot 2020-09-18 at 01 50 25 - Screen Shot 2020-09-18 at 01 57 46

Desktop:

  • OS: macOS
  • Browser: Firefox
  • Version: 80

Additional context I have tried this using these pages on my existing install with just-the-docs and a completely fresh one with just this page. Same problem.

organismzero avatar Sep 17 '20 16:09 organismzero

I've realised that this appears to actually be caused by me using intermediary pages in a way other than intended.

The way the theme works, intermediary pages appear not to be intended to also hold actual content of their own. So if a page has child pages, the template "TOC" is used which technically appears after the content. If there is also content on this page, with headings, there will be a TOC at the top of the content and a "TOC" at the bottom.

I've adapted how I'm using it to account for this. But it would be nice if it supported having content on intermediary pages too :)

organismzero avatar Sep 17 '20 23:09 organismzero

Going to close this for now due to inactivity. That being said, happy to consider a feature request in a new issue, etc. or if there are other thoughts!

mattxwang avatar Dec 21 '22 22:12 mattxwang