folding editor

370 views
Skip to first unread message

Joe Armstrong

unread,
Jan 3, 2019, 3:36:34 AM1/3/19
to TiddlyWiki


I have a code fragment like this:

{{ChandlerButtons}}
{{ChandlerNow}}
{{ChandlerLater}}
{{ChandlerDone}}

I rather liked this.

Is there a "folding editor" macro - could I write something like:

<<folding-editor "ChandlerButtons">>
<<folding-editor "ChandlerNow">>
<<folding-editor "ChandlerLater">>
<<folding-editor "ChandlerDone">>

Which presents me with a clickable fold to edit the underlying tiddler.

This would be very nice to have :-)

Cheers

/Joe

BurningTreeC

unread,
Jan 3, 2019, 4:44:45 AM1/3/19
to TiddlyWiki
Hey Joe, something like this?

\define folding-editor(tiddler)
<$set name="state" value={{{ [[$:/state/folding-editor/]addsuffix<currentTiddler>addsuffix<__tiddler__>] }}}>
<$reveal stateTitle=<<state>> type="nomatch" text="edit">
<span style="float: right;">
<$button class="tc-btn-invisible" setTitle=<<state>> setTo="edit">{{$:/core/images/edit-button}}</$button>
</span>
<$list filter="[<__tiddler__>is[missing]] [<__tiddler__>!is[missing]!has[text]]">
<<__tiddler__>>
</
$list>
<$transclude tiddler=<<__tiddler__>> mode="block"/>
</$reveal>
<$reveal stateTitle=<<state>> type="match" text="edit">
<span style="float: right;">
<$button class="tc-btn-invisible" setTitle=<<state>> setTo="">{{$:/
core/images/done-button}}</$button>
</span>
<$edit-text class="tc-edit-texteditor" tiddler=<<__tiddler__>> tag="textarea" default="" placeholder={{$:/
language/EditTemplate/Body/Placeholder}}/>
</$reveal>
</
$set>
\end


Joe Armstrong

unread,
Jan 3, 2019, 6:16:31 AM1/3/19
to TiddlyWiki
Wow - that was very clever - I shall study this with interest.

But it's not quite right.

<<fold "Tiddler">>

Should initially display a fancy styled link saying "Tiddler" (just a single line)
When clicked it should unfold in place (ie not in a new tiddler) with the wikiText of Tiddler in an editor so I can
edit it (possibly with a live preview)

It would be very nice if this worked like org-mode in emacs or
the old Occam editor for the transputer (if anybody remembers that :-)

Cheers

/Joe

Watt

unread,
Jan 3, 2019, 7:15:07 AM1/3/19
to TiddlyWiki
Hey Joe, where you going with that ChandlerDone in your hand?' - Hendrix meets The Big Sleep?

This is very nice. It works on TWApp for mobile too. Links, transclusions and list filters created in the edit text also work.

For mobile use can I ask;

1. How to increase the size of the buttons?

2. The title of the tiddler to be created, eg ChandlerDone, is shown before clicking on the edit pen icon that creates it. Is it possible to show it after clicking the 'done' tick as well? (Maybe as a link).

3. The title of the new target tiddler is pre-named in the Macro eg . Is there a way to enter the new title in the text edit window at the point of creation?

4. Clicking done displays the new text in the 'host' tiddler. Is it possible to display the title only, with the edit pen beside it so that the new tiddler can be edited in place if necessary but its contents aren't displayed. (My use case might be different to Joe's - I'm aiming at one home tiddler on a mobile that lists tiddlers created and allows me to edit them without leaving the Home tiddler. If I want to see their full content I click on the edit pen or open the tiddler itself.)

I realise BTC time is a precious commodity so ignore any of these requests if they're too complicated. This Macro is already super useful as it is. Big Thanks to you and Joe.


Joe Armstrong

unread,
Jan 3, 2019, 8:29:27 AM1/3/19
to TiddlyWiki


On Thursday, 3 January 2019 13:15:07 UTC+1, Watt wrote:
Hey Joe, where you going with that ChandlerDone in your hand?' - Hendrix meets The Big Sleep?

I'm doing this to learn the TW - I want to write all the code myself and understand every line
which is why I don't want to use plugins (yet :-)

The next thing to add to Chandler is a calender - I want to cause activities to be added to NOW
on a timer (so I need a change tags to 'chandler' + 'now' at time T) and I currently have no
idea how to do this.




 

This is very nice. It works on TWApp for mobile too. Links, transclusions and list filters created in the edit text also work.

For mobile use can I ask;

1. How to increase the size of the buttons?


Good question - no idea yet - I guess you do view source figure out the css class and modify it
 

2. The title of the tiddler to be created, eg ChandlerDone, is shown before clicking on the edit pen icon that creates it. Is it possible to show it after clicking the 'done' tick as well? (Maybe as a link).


Maybe :-)
 

3. The title of the new target tiddler is pre-named in the Macro eg . Is there a way to enter the new title in the text edit window at the point of creation?


Probably - but since you have to enter it once this seems like an unessential feature
 

4. Clicking done displays the new text in the 'host' tiddler. Is it possible to display the title only, with the edit pen beside it so that the new tiddler can be edited in place if necessary but its contents aren't displayed. (My use case might be different to Joe's - I'm aiming at one home tiddler on a mobile that lists tiddlers created and allows me to edit them without leaving the Home tiddler. If I want to see their full content I click on the edit pen or open the tiddler itself.)

I realise BTC time is a precious commodity so ignore any of these requests if they're too complicated. This Macro is already super useful as it is. Big Thanks to you and Joe.


Glad you liked it - it is actually rather useful - I've set my homepage to Chandler and it's nice to juggle
the Now and Later jobs.

Again my goal is understanding and beautiful code.

I rather like the Chandler Tiddler code

{{ChandlerButtons}}
{{ChandlerNow}}
{{ChandlerLater}}
{{ChandlerDone}}

Using transclusions to structure the code is very nice -- unfortunately the code in the transclusions
is not so beautiful

Cheers

/Joe

 

 

Watt

unread,
Jan 3, 2019, 11:15:02 AM1/3/19
to TiddlyWiki
This any help Joe? I copy pasted it from somewhere on the forum a long time ago, I think it was Mark S. who wrote it. Unlike you I understand less than 20% of what I put into TW so I can't explain anything. Think monkeys with typewriters. You probably know how to do this already but it might help someone else.

<$wikify name=tagvalue text=<<now "DDth MMM YYYY">> >
<$checkbox tag=<<tagvalue>> > tick to add today's date as a tag
</$checkbox>
</$wikify>

Mark S.

unread,
Jan 3, 2019, 1:27:11 PM1/3/19
to TiddlyWiki
Is this a reference to the Chandler PIM project that ceased development in 2008 ?

-- Mark

Joe Armstrong

unread,
Jan 3, 2019, 3:42:04 PM1/3/19
to TiddlyWiki


On Thursday, 3 January 2019 19:27:11 UTC+1, Mark S. wrote:
Is this a reference to the Chandler PIM project that ceased development in 2008 ?

Yes - described here


I'd implemented parts of this in js and a back-end server a few years ago -
it was a very fun project. The design notes are great to read (if you can find them,
they are buried somewhere on the web :-)

/Joe

Joe Armstrong

unread,
Jan 3, 2019, 4:15:36 PM1/3/19
to TiddlyWiki
I see - that was *very* instructive - reading the manual page for CheckboxWidget makes
sense if you play with an example at the same time

At first this looks like gobbledygook.

But a quick experiment with <$checkbox tag="hello"> click to add hello</$checkbox>

reveals what the checkbox does :-)

Once you know what it does you can understand the documentation

Cheers

/Joe






 

tony

unread,
Jan 4, 2019, 1:56:00 AM1/4/19
to TiddlyWiki
Hi Joe,

I don't have an answer to the folding editor but toggling the preview pane (eyelid icon on toolbar or alt-p) allows you to see changes when you edit. 

I really enjoyed your blog post about Chandler and task management triage. Having tried so many different task managers, it is refreshing to see something so clear, simple and well executed. I just dragged in all the chandler tiddlers and set Chandler as a default tiddler on startup. I like that the chandler tasks are not marred by widget code or additional field metadata; everything is handled by tag state changes.

I've already tweaked 
{{ChandlerDone}}
with an archive button and set the date format to a ISO 8601 preference
<<now "YYYY-0MM-0DDT0hh:0mm:0ssTZD">>
so Chandler is really working to focus running tasks. 

I think Chandler is fine as is but if you continue development, here are some calendar links that may be helpful:
Thanks again,
tony

On Thursday, January 3, 2019 at 12:36:34 AM UTC-8, Joe Armstrong wrote:

Joe Armstrong

unread,
Jan 4, 2019, 4:25:19 PM1/4/19
to TiddlyWiki


On Friday, 4 January 2019 07:56:00 UTC+1, tony wrote:
Hi Joe,

I don't have an answer to the folding editor but toggling the preview pane (eyelid icon on toolbar or alt-p) allows you to see changes when you edit. 

I really enjoyed your blog post about Chandler and task management triage. Having tried so many different task managers, it is refreshing to see something so clear, simple and well executed. I just dragged in all the chandler tiddlers and set Chandler as a default tiddler on startup. I like that the chandler tasks are not marred by widget code or additional field metadata; everything is handled by tag state changes.

Thanks - to be honest, I haven't yet understood the widget and macro evaluation mechanisms.
There are loads of example, but I still have to guess what they mean and do many experiments.

The reason I'm trying to do everything without macros and with minimal use of widgets
is that I don't want to obscure what's going on. I want to expose the underlying logic rather than make 
it look "pretty" (prettyfication can come later)

It seems to me you can come a long way with tags and filter operations over tags. The list-links
with a filter is, to me, an embedded query in what is essentially predicate logic - this alone
is very powerful (I was for a long time a Prolog fan, so I think this is like embedding predicate logic in
a html framework with some Javascript to reformat the results and make them pretty).

The dynamic bindings remind me of Alan Boring's ThingLab from the late 70's (See https://en.wikipedia.org/wiki/ThingLab) again very powerful.

I'm slowly understanding the documentation - it seems to me that if you understand how the system works then you can understand the documentation. But if you don't understand how it works the documentation is rather difficult to understand.
 

I've already tweaked 
{{ChandlerDone}}
with an archive button and set the date format to a ISO 8601 preference
<<now "YYYY-0MM-0DDT0hh:0mm:0ssTZD">>
so Chandler is really working to focus running tasks. 


So what does your new ChandlerDone look like? - I'm curious
Thanks - this is added to my "Later" list :-)

Mohammad

unread,
Jan 5, 2019, 12:24:09 AM1/5/19
to TiddlyWiki
Joe
I think the tiddlywiki is a new programming paradigm. Working on top of the JS, CSS, and html, it brings a dynamic scripting language. It can change the way we use HTML. It is a high level scripting compared to JS and much easier.

One problem in spreading Tiddlywiki for more uses and applications in other areas is documentation.
There is little documentation on TW and most of them are not easy to understand. What you said above is correct. For basic usage the learning curve is steep but then you encounter many troubles, that because you can't find a good resource to explains what every element of TW can do for you. Thanks to the kind and helpful people of this forum, without them going beyond the basics is impossible.

I hope documentation can get a higher priority for TW. I am sure then, the development speed will be much more than this.

Mohammad

Thomas Elmiger

unread,
Jan 5, 2019, 6:32:23 PM1/5/19
to TiddlyWiki
Hi Joe,

A while ago – must be a few years now – I went down the same road with the same tasks: learning while building my own todo system.

It will be interesting to see where you end and if/when you will start to integrate solutions from others. For myself there were two parts I left out:
  • checklists within tasks (minimal steps belonging to a task)
  • dealing with timestamps (date and time chooser)
The rest I invented myself I think. And I learned a lot. The hard way. So good luck and all the best for your journey!

Reminder to myself: Update TDN.

Cheers,
Thomas

tony

unread,
Jan 6, 2019, 6:05:02 AM1/6/19
to tiddl...@googlegroups.com
On Friday, January 4, 2019 at 1:25:19 PM UTC-8, Joe Armstrong wrote:

It seems to me you can come a long way with tags and filter operations over tags. 

Indeed! That is why your re-implementation of Chandler is a breath of fresh air.

My needs are simple and expedient. I've moved back to analog with the joys of a fountain pen and paper to more rapidly capture daily tasks.
 
I still believe in a simple hyperlinked plain CamelCased wiki as a repository for my stuff not as a Jira or Trax replacement.  

For me, not every wiki entry is/needs the UI widget baggage polluting the text area since the wiki is not the end product, but a means to externalize memory in plain text.

If tasks and projects are important enough I add them to my TiddlyWiki and then archive to VimWiki which is better cross platform.

Plus I'm intellectually too impatient and lazy to learn more TiddlyWiki tinkering. I'm still learning the command line.

Too much friction leads me to abandonment. [1] 

Chandler provides the convenience of separating actionable items from rest of the wiki. This is why a simple semantic tag, 'chandler' is so powerful. It separates my wiki into actionable and not actionable stuff much like sparse trees and agenda in OrgMode 
 
So what does your new ChandlerDone look like? - I'm curious

Chandler's dashboard reminds me of Korsakov's LinearHomeoscope  where adding another Archive 'pin' to ChandlerDone 'search'

<$button>
<$action-sendmessage $message="tm-add-tag" $param="archive"/>
<$action-sendmessage $message="tm-remove-tag" $param="done"/>
<$action-sendmessage $message="tm-remove-tag" $param="chandler"/>
{{$:/core/images/chevron-left}}archive
</$button>

results in returning the done actionable items back into the broader wiki. 

Essentially in GTD speak back to supporting notes.

And what of tiddlers that need to go back to the Chandler dashboard, like say recurring action items?

We can retag with 'chandler' and 'now'

I added a ChandlerizeButton tagged with
$:/tags/ViewToolbar

as outlined in Customise TiddlyWiki 

<$fieldmangler>
<$button>
<$action-sendmessage $message="tm-remove-tag" $param="archive"/>
<$action-sendmessage $message="tm-add-tag" $param="chandler"/>
<$action-sendmessage $message="tm-add-tag" $param="now"/>
{{$:/core/images/star-filled}}
</$button>
</$fieldmangler>

and added its button title,
{{ChandlerizeButton}}

to position it accordingly in the ViewToolbar

TiddlyWiki's powerful search will recall past archived projects and tasks and I click the star ChandlerizeButton to add it back to the Chandler dashboard set to my Home button.

This allows simple movement of entries in and out of Chandler completing the triage loop and system for me. 

Since there is date stamping [2] for plain text future proofing, a calendar is extra frosting! 

Thanks again, Joe

Best,
tony

[1] The TiddlyWiki Classic (TWC) past was glorious and littered with TiddlyTasks TogglyTagging siglets CycleTags and endless tasting of all this generous group has to offer. Eric L Shulman's TiddlyTools was a fount of tinkering tools, but with great power, comes great responsibility.

Imagine having to maintain this in 5, 10, 20 years?

Over time I found the need to switch back to simplicity like evil org-mode adding deft then finally settled on VimWiki. Investing in time tested tools like bash, emacs and vim has been fruitful plus CodeMirror bindings in TiddlyWiki for vim and emacs means old tricks still work for this old dog.

[2]  I like literal hard coding for future proofing thanks to Riz's date stamp button on my Editor toolbar, I can log entries and recall with simple search inside or outside of TiddlyWiki

Joe Armstrong

unread,
Jan 6, 2019, 3:09:35 PM1/6/19
to TiddlyWiki


On Sunday, 6 January 2019 12:05:02 UTC+1, tony wrote:
On Friday, January 4, 2019 at 1:25:19 PM UTC-8, Joe Armstrong wrote:

It seems to me you can come a long way with tags and filter operations over tags. 

Indeed! That is why your re-implementation of Chandler is a breath of fresh air.

My needs are simple and expedient. I've moved back to analog with the joys of a fountain pen and paper to more rapidly capture daily tasks.

Yes :-)

As regards the automation of simple tasks I've been doing some experiments.

I had some tiddlers tagged 'draft' and 'final' then I made a button to change draft to final -
the problem was that now I could do this operation too quickly - in order to change draft to
final I needed to read what I had written and *think* - the *deliberate* act of adding a new tag and 
removing an old one slowed things down. 

Automating this meant I could do the operation faster than
I could think - also automation added a layer of unnecessary complication - the power of the system
came from the filter operations over tags and not the ability to automate tag manipulation.

Deciding how much to automate is a very tricky problem and needs several rounds of prototyping
to get it right.

Personally I favor the idea of a minimal viable program (see

I'll have to implement the ticket system I described above in the TW :-)

Cheers

/Joe

TonyM

unread,
Jan 7, 2019, 12:30:56 AM1/7/19
to TiddlyWiki
Joe,

I think this could save you automating, build it right into the model.

Have you seen my algorithim that uses date stamps on fields for task management? I think this is a superior method to tags. No need to swap one tag for another.

Eg I have the following fields item-started item-completed item-cancelled item-archived
If at any time I timestamp such a field, not only does it change its status, but I record when it changed status. 
Using the new subfilter operator I define active-task to equal [has[item-started]!has[item-completed]!has[item-cancelled]] - I call this tiddler disposition.
Using this method I can interrogate my tasks in many ways like 
  • active-task started more than a week ago
  • Task closed today
I also have item-strategic item-tactical and item-operational dates. Each representing Monthly, Weekly and Daily
Listing tactical due I just list active-tasks with a item-tactical older than 7 days. When I do a tactical tasks I can just re-stamp it with the current date and it will not list for another week
This allows me to change the review periods without changing any task tiddlers. Eg Tactical review of 2 weeks or 14 days.
These review tiddlers can also have a tiddler disposition as above.

Using this method you could retrofit tools that report how long something was active eg item-completed less item-started
I also allow item-planed-start item-planed-due to be set and can show when they are planned to start and past due

Fields are like a specific tag for which you can store a value.

Anything with Item-archived appears in my references list and discourages deletion.

Joe Armstrong

unread,
Jan 7, 2019, 9:04:28 AM1/7/19
to tiddl...@googlegroups.com
On Mon, Jan 7, 2019 at 6:31 AM TonyM <anthony...@gmail.com> wrote:
Joe,

I think this could save you automating, build it right into the model.

Have you seen my algorithim that uses date stamps on fields for task management? I think this is a superior method to tags. No need to swap one tag for another.

Eg I have the following fields item-started item-completed item-cancelled item-archived
If at any time I timestamp such a field, not only does it change its status, but I record when it changed status. 
Using the new subfilter operator I define active-task to equal [has[item-started]!has[item-completed]!has[item-cancelled]] - I call this tiddler disposition.
Using this method I can interrogate my tasks in many ways like 
  • active-task started more than a week ago
  • Task closed today
I also have item-strategic item-tactical and item-operational dates. Each representing Monthly, Weekly and Daily
Listing tactical due I just list active-tasks with a item-tactical older than 7 days. When I do a tactical tasks I can just re-stamp it with the current date and it will not list for another week
This allows me to change the review periods without changing any task tiddlers. Eg Tactical review of 2 weeks or 14 days.
These review tiddlers can also have a tiddler disposition as above.

Using this method you could retrofit tools that report how long something was active eg item-completed less item-started
I also allow item-planed-start item-planed-due to be set and can show when they are planned to start and past due

Fields are like a specific tag for which you can store a value.

Anything with Item-archived appears in my references list and discourages deletion.



Interesting - I shall have to think about this ... one thing I do a lot is work against deadlines - so things get
to be classified as now when the deadline approaches. I could also guess how long the job takes
so I could add a descriptor

       deliver-on <Date> takes <2 days> tell me <3 weeks> before <Date>

and let these produce appropriate reminders ...

/Joe


 
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/0EkDcX6frpw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f1545f2a-d181-41dc-9aee-f10182dc922e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TonyM

unread,
Jan 7, 2019, 10:41:01 PM1/7/19
to TiddlyWiki
Joe,

For the planning items I still have the aforementioned disposition dates but I include

Planing-start planned start date
Planning-due planed completion date personal target
Planning-end do or die delivery end

Regards
Tony

Reply all
Reply to author
Forward
0 new messages