silverbullet
silverbullet copied to clipboard
[TOC] Configuration options
Enable TOC configuration in SETTINGS
:
- In which panel to appear (default:
preface
, but also supportlhs
andrhs
) - At what # of headers the TOC should be enabled
Note: the configuration of where the panel should appear should be client specific. For one, I’d like it to be different on my phone (top), iPad and desktop (maybe right or left), so rather than putting it in SETTINGS this needs to be stored using clientStore
and be configured with a command.
Second: the logic about whether the TOC should appear at all likely also has to be different. When the TOC renders on the left or right, and you switch between pages, there will be a significant content jump between page switches if it’s not persistently there.
It would also be nice to be able to disable the TOC on some pages, either with a frontmatter flag or some inline directive. (Mediawiki provides a __NOTOC__
.)
It would also be nice to be able to disable the TOC on some pages, either with a frontmatter flag or some inline directive. (Mediawiki provides a
__NOTOC__
.)
I also think it would be a good idea to be able to disable plugins (TOC, Linked Mentions...) for specific pages.
I'm using this to disable toc on some pages
---
description: Adds a Table of Contents to pages
tags: template
hooks.top:
where: toc != false
And then I just add toc=false to the front mater of pages where I want it diabled
Sorry, I'm a newbie. Where do you put this:
description: Adds a Table of Contents to pages
tags: template
hooks.top:
where: touch != false
In SETTINGS?
Very thanks!
in your silverbullet instance you should open the Library/Core/Widget/Table of Contents
using the template picker
and replace this line
where: 'true'
with
where: toc != false
and now in any page that you do not want the table of contents widget you just need to add to frontmatter a prop like
---
toc: false
---
I'm using a docker compose, which after making the change I restarted it. I think I'm doing something wrong because it doesn't work for me. Thank you for your time.
At some point somebody mistyped "toc" as "touch". Just use "toc" everywhere so toc != false
Unrelated: are you using an outdated Firefox by any chance? Looking at your screenshot it looks like FF earlier than 121. I'd upgrade if you can to not have the weird button placement.
This work fine!! 🙂
At some point somebody mistyped "toc" as "touch". Just use "toc" everywhere so
toc != false
But, how hide frontmatter section?
Very thanks!