Mohammad,
I believe the best approach to this, starts like this below;
I have not worked through the total solution yet.
I may also point out there are some solutions similar to what you ask already out there. I will share if I find them.
<$wikify name=TestHeadings text={{TestHeadings}} output=html>
<$text text=<<TestHeadings>>/>
</$wikify>
Where TestHeadings is your example tiddler. We get this result;
<p>This is first part</p><h1 class="">Heading 1</h1><p>This is the upper middle part</p><h2 class="">Heading 2</h2><p>This is the lower middle part</p><h1 class="">Heading 3</h1><p>This is the last part</p>
I think TT and others have already published the regex to now parse this html result to divide the content as you would like. This approach has the advantage of allowing you to parse the result not only the text field (pre-render) even the output of list widgets and macros.
This should allow you to generate sub tiddlers, and perhaps an ultimate solution could be made by using concepts from the excise editor toolbar
$:/core/ui/EditorToolbar/excise
$:/core/ui/EditorToolbar/excise-dropdown
<$action-sendmessage
$message="tm-edit-text-operation"
$param="excise"
title={{$config-title$/new-title}}
type={{$config-title$/type}}
macro={{$config-title$/macro-title}}
tagnew={{$config-title$/tagnew}}
/>
I think ultimately I am moving towards a set of solutions that operate on post rendered content to close what I see are substantial gaps . However don’t expect this soon, it is more part of a strategic direction for me.
My first related tool was to take a snapshot of a tiddler as HTML, then display that, so it need not be re-rendered, important for tiddlers with a lot of processing for which you do not need to see immediate updates.
snapshot.json (6.2 KB)