Using the development-branch of the TOC plugin, there is a filter called tocify, which I use like this:
TWIG
{% set toc = page.content|tocify %}
{% include 'partials/toc_default.html.twig' %}
Within {% block content %}, but {{ dump(toc) }} returns nothing. Does anyone have an example of returning the HTML-output from the TOC plugin in a template? I'd like to use it in a sidebar, rather than in the content itself through [TOC].