So, to preface this, one of the features I’m a pretty big fan of in other applications is the ability to collapse headers, and while there are other methods available to do this, I find myself using the built in wikitext formatting to define headers even when I’m not writing a tiddler, just because of how efficient it is to do so.
So, that’s why using divs, or macros isn’t really something I want to do, as I don’t think I will be satisified with that in the long run. Its also just one feature I’m looking for, so having multi-feature plugins isn’t really preferred because it feels like I’m installing things I don’t have any use for along side it…
So my question is, in more experienced users opinions, how difficult would it be to modify or clone the $:/core/modules/widgets/element.js tiddler in such a way to change the behavior of the header wikitext formatting to wrap around text if it under it?
My plan is instead of just the header being wrapping in <h1-6>
elements, instead the header would be wrapped in a details disclosure summary element, and generate the closing details tag after whatever text is underneath the header, as long as it isn’t more than one line break away.
for example, original formatting would be:
!!! Hello There
"""
How are you?
"""
resulting in:
<h3>Hello There</h3>
<p>
How are you?
</p>
And revised formatting result would be:
<details>
<summary class="h3">Hello There</summary>
<p>
How are you?
</p>
</details>
(I can easily make a .h3 css class to match the defaults of what an h3 element renders as both by mozilla standards and by tiddlywiki’s vanilla stylesheet, so that is implied with the summary class.)
I was looking at how other javascript tiddlers handle similar functionality and thought of the bullet wkitext, but i guess even that doesn’t really apply the same, since what I am aiming for could technically count as turning an inline element into a block element, no? Edit: please ignore this part, I was thinking something waay different, what I meant to put is “a single element into an element with children elements inside it.”
On this note about how difficult it might be, if it is something that is out of my own skill range, I would be happy to open a bounty of sorts for the development of it, but TBH I’m not entirely sure how bounties are meant to work with the community as of right now, we’ve had so few that it’s a bit vague haha
Anyways, to get back on point, any insight would be appreciated!