How can I exclude part of a heading from the outline?

Hi! Does anyone know if there’s a way to exclude part of a heading from the generated outline? (I know that to exclude the whole thing, you can just use heading(outlined: false)).

Something like this:
image

The following is a way to do it by creating a “ghost” heading but it’s obviously not very nice nor reproducible:

#outline()
#place(hide[= hey])
#heading(outlined: false)[hey (test)]

And here’s how you could do it in LaTeX AFAICT:

\documentclass{article}
\begin{document}
    \tableofcontents
    \subsection[hey]{hey (test)}
\end{document}

You could work around this by using a lower level heading (like 5th level or however deep your document goes and doing something like this

#outline(depth: 4)

Obviously, you need to create a new header with a level below 4 for this to work, but then you’d have a header that would be bookmarked in the PDF but not visible in the outline

Hello @cAtte and welcome!
You might like to read the following topics:

I think some of the answers there might help you

There’s no direct support for this currently but it has been discussed a lot, see the GitHub issues here and here and the linked PRs.

thanks everyone! that first issue seems pretty relevant