Section Editor Plugin: First Stable Release

thx Mohammad! atleast now i know the issues on my end (not surprised). i’ll play with a little to see if i can get it to do what i want.

what i simply wanted a set of sections that would show up on some tids by default (example - topic has a souce section, summary section, question section, etc; book tid has bio section, mentions section etc.) buttons dont work here, because if i change the base in anyway, i want it to show up on all tids. buttons only copy paste.

i was thinking - it would be wonderful if sections interface could mod other feilds vs just the text. example a section that mods the ‘question’ feild - exactly like it was a text field.

personally, i think its better to put effort elsewhere. the quick space hack you just mentioned works too wonderfully to solve the issue. just maybe put this error possibility in red in the docs ?

To know the logic behind, Section editor applies your change by search-and replace so when it sees to identical sections (header + content) it replace all of them with edited content.

Thanks Mohammad for this! As a long time Leo Editor user, seeing SE opens a lot of possibilities to using “organically” TW as an outliner.

My suggestions were in the same lines as in the message you’re answering now: a tree view for (sub)sections and the possibility to move them along the tree up/down and left/right (promoting/demoting). I don’t know if it could help in the work you have ahead, but maybe just having some arrows icons for such operations even without the whole tree preview, could be a start: left/right would subtract/add “!” characters to the subsection name, while up/down would imply more work to move them above/below the containing tiddler.

Of course, I don’t know implementation details and without them, I don’t know if my suggestion makes sense implementation wise. I was thinking about the minimal user experience for subsections rearrangement.

HTH,

@Offray
The purpose of Section-Editor was to break down a long tiddlers into parts for editing! and I think Section-Editor was successful for that. A more advanced version (part of that on GitHub under development branch) was created by @Sttot and later used and extended by @linonetwo. They are very good at JavaScript and so I assume their version could do what you proposed!

By the way, for outlining, I may suggest the TOC (table of content) by @EricShulman in his great Inside TiddlyWiki — A Guide for Users, Authors, Designers and Developers (tiddlytools.com).

This TOC is wonderful, Eric may have suggestion for re-ordering headings in an outline view

1 Like

Hi @Mohammad,
a tiny idea for your section editor:
You could add a settings-checkbox to decide whether to trigger an autosave after editing a section.
Sometimes I make only tiny corrections to sections and forget to save…

Hi Jan (@JanJo )
Note that Section-Editor uses temporary tiddlers $:/temp/… for editing section. So on edit you actually create a hidden tiddler.

If your Tiddlywiki has autosave enabled, you can make sure they are saved automatically.

You can hack the section-editor to use $:/se-sate instead of $:/temp to keep the intermediate data.

Note that there is a different scenario for Tiddlywiki on Node.JS as $:/temp tiddlers are not saved!

1 Like

Hi @Mohammad I have built a slideshow which is using your section-editor-plugin, perhaps you remember this is my second attempt. This time I combined the sectiont with a mod of the Roman Veselý’ s Krystal-Plugin.

I works quite smooth by for presentations and flashcards on a smartphone but I have some requests to make the plugins work together even better.

For the Plugin, it would be great

  • if text before the first section in a Tiddler had a class that could be addressed by CSS to make it scroll-snap as an own element.
  • if it was possible to transclude and prepend an element that to the se-article whithin the ```
    se-tc-tiddler-body.

So please have a look, I hope my plugin is useful for you too .

Best wishes Jan

Hi @JanJo
I have not worked on the SE code for a while, I need to have a look, but please note the philosophy behind that first text part (I called it preface) was, sometimes users forget to start with a heading and have some extra text before their first heading,… In the first version of SE this caused some errors and I added a code to handle it! So, by design it is recommended to have not such part and start with a heading to be editable!

By the way, open the viewtemplate for single tiddler, I assume I have wrapped that first part in a div, so you can add your own class.

Hi Mohammad,
thanks for considering and looking at the code. Adding a class to the Preface would make things so much easier for me because creating a presentation would take almost no effort. The problem could be solved by adding a ! without title, but ergonomically and typographically, it is nicer to have this preface.

I guess the view template is before the tiddler-body - I would need a part within the se-tiddler-body because it is the body that scrolls.

The tiddler body itself is not displayed instead Cascades is used to display customized content!
I will have a look as soon as I find some time to work on it

1 Like

Hi @JanJo
Would you please have a look at $:/plugins/kookma/section/templates/foreword
You can wrap it in a div like below

<div class="se-foreword"><!-- this is waht you want -->

<!-- display foreword without sectionizing -->
<$transclude tiddler=<<currentSection>> field=title mode="block"/>
</div>

and let me know how it works for you.

1 Like

Hi @Mohammad,
thanks for the hint. I could simply wrap it into a <section “se-section”> and it already works like a charm.
I’ll keep in mind adding the x-tra class but for now that is great
Thanks!

1 Like

Mohammad, I’m arriving late to the Section Editor party! I do think I’ll set this up with some minor projects, and see how it feels.

One counter-intuitive behavior that doesn’t seem to be mentioned in this thread:

After collapsing a section, its own subsections still display. Ideally, when I collapse the details for the first h1 heading, the h2 nested below would disappear, so that the next thing below would be the second h1-level heading (open or closed)

I’m guessing that more accurate outlining / nesting behavior, especially with the editing functions, would be difficult to set up…

One reason I continue to rely on telmiger’s details plugin is that the collapse/expansion of nested details work nicely… But I admit it’s been cumbersome at the authoring and editing phase, so I’d love to convert to your SE solution, if only it handled the nested-element display more intuitively.

-Springer

That is right. The main purpose of section editor as its name says is to be able to break a long tiddler to smaller sections and be able to edit in place. Also create a patch tiddler for smaller tiddlers. So, outlining is not the first purpose.

Each heading creates a section, it does not matter what level it is, so all of them behave the same. But there were discussions (here and GitHub) to add the outlining to section editor. There is a development branch and some people added some features like capability to create an editable section from any html tag, but due to lack of time and interest it is inactive now.

I don’t use details plugin as Shiraz has display on demand feature, but you may use both details plugin + section editor! Each details start with a heading! I think this should work for outlining!

Mohammad, I do understand that you’re using your own display-on-demand feature, and I would assume that your plugins are compatible with other ones, such as telmiger’s details plugin…

Still: Do you recognize the more robust nesting-hierarchy behavior (so that all of h1 level of outline would collapse at once, thus hiding any h2 nested under it), as a feature that could in theory be developed for the Section Editor, or is it not possible because of the nature of the macros you’re using?

-Springer

I think this is in wish list! I think it is possible! but takes time!
In the current status I kept it very simple, the core is like three four small wikitext tiddlers

@Springer if you are desperate for an outliner the alternative is streams of course Streams — on TiddlyWiki 5.2.2

Personally I also;

  • change $:/config/sq/streams/new-node-title to
    • $:/streams/<<stream-root-title>>/<<now "[UTC]YYYY0MM0DD0hh0mm0ssXXX">>
      to hide the subtiddlers which have ugly titles from recent and search
  • Add to that the streams fusion, to merge a stream into a tiddler text field if desired
  • And streams is well designed for hacking and customisation.