Questions about modifying hard linebreak wikitext; nested wikitext funcitonality?

So one of the things I’ve come into the habit of doing is turning all of my tiddlers with headers into details disclosures so that the text beneath them can be nested.

It got me wondering, could this be achieved useing wikitext, and if so, existing wikitext?

after a bit of time just working on other things and revisiting the idea, I considered if it might be possible to modify the hard linebreak wikitext to turn into disclosure elements, or collapsible elements if we wanna make custom stuff that isn’t tied to the disclosure html element, and thought, “well you need to wrap where text will be, so have some way to determine where it stops, and you need something to act as the summary text.” and came up with!

"""
Normal linebreak wikitext section!
"""
"""
! collapsible linebreak section!
Normal linebreak wikitext section!
"""

where the text under the previous header would be inside of the disclosure, and if there were a new header, it would create a new one, or, if the header is a sub header, nest underneath it, i.e.

"""
! header 1
Normal linebreak wikitext section

!! subheader 1
disclosure is nested under the other
"""

which would render out as:

<details>
  <summary><h1>header 1</h1></summary>
  <p>Normal linebreak</p>
  <details>
    <summary><h2>header 2</h2></summary>
    <p>disclosure is nested under the other</p>
  </details>
</details>

and, just because of how header elements are styled, you would need anm accompanying stylesheet with something like:

details > summary {
  h1, h2, h3, h4, h5, h6 {
    display: inline;
  }
}

But, I know next to nothing about JavaScript, so I have no idea if this is even possible, let alone what needs to be added to the hardlinebreaks.js tiddler.

So I thought it would be best to ask first, would this even work? (if yes, then down the rabbit hole I go IG lol)

@Justin_H , two possibilities come to mind

  1. Use tabs for the sub text. Clicking the tab will show the subtext but probably not feasible if paragraph lengths of subtext.

  2. Use % IF% %THEN%. %ELSE% statements to hide and show subtext based on the value of a flag that is set by clicking an image, say the disclosure triangle.

Bobj

1 Like

I agree about the first point, the 2nd is curious, I imagine it would work like a button and reveal widget?

Yes except reveal is deprecated and replaced by if then else.

Bobj

Well that is good to know, I’ve gotten into the habit of using $reveal since I’m not used to the odd look of the new if than else syntax.

Sidenote, I keep breaking my wiki, so I don’t think this is something I can just adjust in the tiddler through trial and error like I thought I might be able to do :sweat_smile:

I think I will need to revisit this when I have a bit more know how on JS

TiddlyWiki Classsic had the wiki text +++ for sliders (via a plugin)

They are not a one to one replacement, I fond this unlikely. Reveal allows animation etc…

Huh, the sounds interesting! so how did it handle the header (where the dropdown carot is) and nesting?

From memory, what followed +++ was the title and you clicked to unfold, they were nestable, I think +++ was closed and ++++ open you had to add your own symbol.

Perhaps Search here for discussions on details, sliders for some of the prior discussions.

However things like custom widgets the genesis widget etc… offer a lot of opportunities we did not have previously.

1 Like

For the historically curious…

Documentation is here: TiddlyTools Classic: NestedSlidersPluginInfo
Code is here: TiddlyTools Classic: NestedSlidersPlugin

Note that in TiddlyWiki Classic all plugins were implemented using Javascript code. In this particular instance, NestedSliderPlugin added a custom “formatter” to the TWCore.

-e