Hello @anon35020706 welcome to the community!
Unfortunately, right now, collapsible lists can’t contain codeblocks or any other type of info but text.
If you want to collapse other type of content like code blocks and even images, you would have to use collapsible text. I explain how to do this as follows:
To make something collapsible you have to first change the size to any of the H sizes.
Then you can collapse anything that’s underneath it, including code blocks.
As of right now, codeblocks can’t contain H text inside, if you try it will remove the codeblock
The downside of using this instead of collapsible lists is that you are limited to 3 levels (H1, H2 and H3) but you have more freedom to show anything the canvas can offer you like images or multiple columns. You can even show an outline of the content
Here you can find a series of videos that can help you kickstart your wiki journey (assuming this is what you want to accomplish here )
I hope this sheds some light to you question!