Section Editor Plugin: First Stable Release

I did do some hacking of SE today. As I had posted earlier, I didn’t like the fact that when I folded or unfolded a section, it caused the TW dirty indicator to turn red as if something was edited. I found a way to fix this.

In $:/plugins/kookma/section/macros/utility, I edited these two lines:

\define stateTid() $:/section-editor/state/$(source)$
\define foldstatusTid() $:/section-editor/foldstate/$(source)$/$(counter)$

and changed them to:

\define stateTid() $:/state/section-editor/$(source)$
\define foldstatusTid() $:/state/section-editor/foldstate/$(source)$/$(counter)$

This allowed Tiddlywiki to recognize them as true state tiddlers. With this change, I can fold and unfold all day long without changing the dirty indicator. However, if I save, the state is saved.

Great @HistoryBuff - I think this is not the case with TW on Node.JS!
But great for single file TW!

Hello, I just tried this plugin today and it works great!

I noticed that when you have se-type field (enabling the viewtemplate from the plugin to the tiddler) then the text is smaller than usual.

With se-type:
image

Without se-type:
image

I also tried to just call the sectionizeSingleTiddler macro from a new tiddler and text is normal size :

\import $:/plugins/kookma/section/macros/main
<<sectionizeSingleTiddler "Demo Levels">>

displaying:
image

Is this intentional? Is it possible to make it normal size with se-type field? Thanks!

Hi Pak,
This is not Section-Editior, it is Tiddlywiki!
May be one of developers can explain: Why the contented rendered through a user defined viewtemplate is smaller in font size with respect to those displayed by text field!

Hi @Mohammad , thanks for the clarification. It seems not related to Section-Editor indeed. Nevertheless, one nice application of this is we can create a general-purpose sectionizer tool to view and edit a long tiddler where we only want to edit a particular section of it (e.g. changelog, or weekly journals where each day is a section).

Here is the code if anyone is interested:

\import $:/plugins/kookma/section/macros/main

<$vars setid={{{ [[$:/temp/sectionizer]get[targetTid]] }}}>
<div class="w3-small" style="float:right;">
  <$link to=<<setid>>>Target Tiddler</$link> : 
  <$keyboard key="escape" actions='<$action-setfield $tiddler="$:/temp/sectionizer" $field="targetTid" $value=""/>'>
    <$edit-text tiddler="$:/temp/sectionizer" field="targetTid" tag=input default="" placeholder=""/>
  </$keyboard> 
  Recent: <$select tiddler='$:/temp/sectionizer' field="targetTid">
    <$list filter='[!is[system]!sort[modified]limit[10]]'>
      <option >{{!!title}}</option>
    </$list>
  </$select>
</div>

<$macrocall $name=sectionizeSingleTiddler sourceTiddler=<<setid>> />
</$vars>

Thank you for the tip. Without this change, on Node.js there will be lots of physical files $:/section-editor/... on harddrive which I think is not ideal. (I used $:/temp/ in stead of $:/state/ as I don’t care about these states tiddlers. Still works great.

1 Like

Thank you @Pak
I will add this to SE documentation! Very nice example!

I will also submit a ticket in GitHub for font size!

Pak, see the clarification made by Jeremy and Saq on Add "cascade" filter run prefix and use it to control view templates by Jermolene · Pull Request #6168 · Jermolene/TiddlyWiki5 · GitHub

I will push a new update! BUT what they told is valuable as this issue is seen for all who uses custom viewtemplates!

Thanks for the info. That explains why it has the same font size as on the side bar. Looking forward to your next update of the plugin :slight_smile:

Section Editor just got a new update!

  • preview per section
  • adjust font size of sections to meet tiddler body font size and line height

Code and demo

2 Likes

Hi Mohammed, thanks for sections - as you know I am a great fan.
I would like to have a slightly more minimalistic layout, where you omit the up/down arrows
and put the edit/save buttons on hover upon the line. I think for those who want to edit, the line is sign enough that you can unfold the section.
Best wishes Jan

grafik

1 Like

Jan,
SE follows the main editor settings when its editor from settings is set to Use Tiddlywiki main editor So if you hide any button from $:/ControlPanel > Appearance > Editor Toolbars it will be hidden in SE editor toolbar!

However you like to customize SE toolbar differently, then look ta

1 Like

Hi Mohammad,

I guessed that, the proposition was to reduce the space above the editor-toolbar.

1 Like

Ah, okay, I did not noticed the screenshot you attached!

Hi Mohammad,
and there is another little thing:
TW permits to add classes for titles like this:

!.myclass Title with myclass

If would be nice for compatibility if you could add that feature - or make .myclass invisible in the first step.

Good afternoon all. I am a basic user of Tiddlywiki for a couple of months and I am still trying to find the right flavour for my needs. I came across this superbe plugin and installed it in a tiddlywiki I use to test plugins .Unfortunately it is as if nothing was installed: no folding of the sections.
It would be nice to have it working though. Any thoughts of what could be wrong ?

hi @lmgv did you add the se-type field on the tiddlers you wish to enable section editor?
The Mohammad’s tutorial helped me get started Section Editor — create, edit, fold, manage sections

Hi! Thanks. I did add the se-type field, nothing changed.

are you able to view that the plugin is indeed installed? Perhaps the installation didn’t complete correctly?

Plugin is installed (did this via kookma) and shows properly in the plugins list. I have access to the settings.
I forgot to mention that I am using TiddlyDesktop.

This time I used it on a brand new tiddlywiki within FF: it works. Seems TiddlyDesktop is causing the troubles.

1 Like