How the section plugin changes the way it stores state tiddlers

$:/plugins/kookma/section

The plugin save state seems to be stored in json tiddlers, take $:/section-editor/state/xxx for example. Whilst this method of storage ensures that the way the tiddler is opened and closed remains consistent once uploaded to the cloud, I don’t think it’s necessary. Because I don’t want to give my github repository a large number of similar change records in advance. I think it should be saved as $:/state/section-editor/xxx so that TiddlyWiki deletes those state tiddlers when it starts.

@Mohammad

Can you help me with this issue?

What I’ve come up with so far is to exclude tiddlers prefixed with $:/section-editor/state/ by means of .gitignore .

It may be interesting for you that the state tiddlers were $:/state/section-editor/...
I have received several request to make them consistent! so I changed the state tiddlers naming rule.

For you, the quick answer is to hack the plugin and set the state tiddler name prefix.

Thanks. I changed the $:/plugins/kookma/section/macros/definition code of the plugin.Here is the changed section.

<!-- state and temporary tiddlers -->
\define stateTid() $:/state/section-editor/state/$(source)$
\define editTid()  $:/state/section-editor/content/$(source)$/$(counter)$ 
\define foldstatusTid()  $:/temp/section-editor/foldstate/$(source)$/$(counter)$ 

But I think the plugin can provide two ways of saving. One to save as a json tiddler and one to save as a state tiddler. the former would cater for those who need to be consistent. And the latter can satisfy those who don’t need to be consistent like me. The way to do it is to set a prefix tiddler to store whether the prefix is $:/state/section-editor/ or $:/section-editor/state/. But I’m not familiar enough with TiddlyWiki to know how to tweak it in depth.

Thank you very much for your help, I’ll take another look at how to implement this way when I get a chance.