Thinking through a plugin and the excise dropdown

122 views
Skip to first unread message

David Gifford

unread,
Jul 14, 2021, 9:19:47 AM7/14/21
to TiddlyWiki

Hi everyone

Yesterday I teased a modest macro that has the capability of turning TiddlyWiki into an outliner. https://groups.google.com/g/tiddlywiki/c/gCp5ONBxFXg (first half)

I am thinking about packaging it as a plugin called Subsume, but one item seems to call for attention.

If I could add this macro as a new option for the excise dropdown, not as a macro but as a macrocall, that would allow users to excise text and turn it into a link/slider in the present tiddler instead of transcluding it or linking it.

But two things hold me back:
1. After playing with the excise dropdown tiddler for a while I am still not sure how it works or how to add another dropdown option to it.
2. Even if I knew how to do that, this would mean that my plugin would need to change some core tiddlers. And this would make it un-future-proof.

What chance is there of eventually having the excise dropdown be as easy to add options to via tags, as, say, the pagecontrol buttons and sidebar tabs? Maybe my macrocall is not the only way people might want to customize excising.

And, does anyone know how to tweak the excise set of tiddlers as it stands so that I could insert a named macrocall of the tiddler instead of a transclusion, macro or link?

(In case any of you are wondering, I need macrocall instead of a normal macro to avoid the <p> that causes extra spacing above and below macros)

Blessings, Dave

David Gifford

unread,
Jul 14, 2021, 9:20:35 AM7/14/21
to TiddlyWiki
haha I meant the first half of the Youtube video linked to in that post...

springer

unread,
Jul 14, 2021, 9:29:35 AM7/14/21
to TiddlyWiki
David,

I'm so sorry to have just replied on your OTHER thread, requesting this very development, before reading this one! I'll go delete that, and put the guts of that message below...

I'm thinking of a variant on "excise selected text into a new tiddler" that could take selected text, port it to a new tiddler (prompting for title, or defaulting to first line), and leave a corresponding details macro neatly in place of where the excised text is? This would be tremendously helpful in editing "overgrown" tiddlers (or paragraph sequences pasted in from elsewhere) and bringing a project closer to the ideal of tiddlers-as-smallest-useful-bits.

For what it's worth, I'm with Saq in hoping to invoke it with <<det "Component Idea">> -- much better for readability, sharing with newbies, etc., and would hope for the editor button to work that way as well.

I wish I had time to tinker with these things myself so that I could offer tribute in the form of useful work, rather than chiming in as a backseat driver!

-Springer

David Gifford

unread,
Jul 14, 2021, 9:37:43 AM7/14/21
to TiddlyWiki
So that's why I couldn't post a reply, you had just deleted your post! Here is what I was replying:

Hi springer,

1. I don't know if I updated the teaser version, but in the main file I am tinkering with, selecting text and clicking the ted button does wrap the text.

2. I literally just posted a question about having ted (which I am planning to call Subsume) be another option the excise button dropdown. Then saw your post.

3. I agree that is cleaner in EDIT to have it be double angle brackets. But that forces double spacing, and I think it is much cleaner and flexible in VIEW mode to allow users to have them singlespaced. And I doubt Jeremy would allow tweaking to macros to eliminate the <p> that is the culprit here. It would not be backwards compatible and could cause all kinds of problems. I could have a second button to render it as double angle brackets , I suppose. You CAN currently invoke it with  double angle brackets by typing it.

Dave

TW Tones

unread,
Jul 14, 2021, 8:33:13 PM7/14/21
to TiddlyWiki
David,

Surely the best way is to clone the excise toolbar button and add your variation to it. Then in the editor toolbar buttons settings they can choose if your or the default excise is visible or hidden behind the more drop down.
This way you will not be modifying any core code.

I have otherwise not looked at this thread in more detail, I hope to later.

Tones
Message has been deleted

springer

unread,
Jul 15, 2021, 11:26:35 AM7/15/21
to TiddlyWiki
David,

Yes, I did see that your edit-mode [det] button would take the selected text and treat it as the name of the tiddler (the one to be displayed within the details "pocket"). This is ideal for the situation where the other tiddler already exists. For my writing and editing process, by contrast, I'm almost always finding that the thing I want to tuck into a details "pocket" is initially right there in the same tiddler. 

In fact, prior to seeing your solution, I had been looking forward to trying to reverse-engineer a variant of the excise button that dovetails with telmiger's details widget (rather than transcluding or linking), though I would be terribly slow at the work.

And despite being very fond of telmiger's details plugin with all of its css flexibility, I do see advantages in your model, including the elegance of typing (and reading) <<det "FAQ">>, plus the subtle built-in asterisk-link to go straight to the tiddler in question. 

Still, one other feature/option that may be of interest (based on spending lots of time working with <$details> widgets, which allows summary to be specified as a parameter): ability to prefer the caption (or some other specifiable field), as the preferred summary text, defaulting to title only if caption is unavailable. 

On your site, this tweaked variant seems to get the macro to show caption (as summary) if it exists, and to default to title if not:

\relink det tid
\define det(tid:"") <details><summary><$transclude tiddler="$tid$" field="caption"><$view tiddler="$tid$" field="title"/></$transclude>&nbsp;<$link to="$tid$">*</$link></summary><span class="indent1"><span class="tidgraybk"><$transclude tiddler="$tid$" field="text" mode="block"/></span></span></details>

-Springer

[Sorry for blinking you all with a post-delete-repost; I found a small typo in the macro, which should be fixed now.]

springer

unread,
Jul 15, 2021, 11:47:53 AM7/15/21
to TiddlyWiki
David,

I'm playing with using the existing excise button with "macro" option (specifying your det macro), and I'm not yet seeing how your complaint about extra <p> tags works. That is, I'm getting results that look just like your more baroque macrocalls. 

In other words, editing the home outline tiddler at your site, if I replace

<$macrocall $name=det tid="Failures of commentaries"/>

with

<<det "Failures of commentaries">>

I see no difference in how the result displays, either collapsed or expanded. Could you clarify what the problem is?

-Springer

On Wednesday, July 14, 2021 at 9:19:47 AM UTC-4 David Gifford wrote:

David Gifford

unread,
Jul 15, 2021, 12:49:25 PM7/15/21
to tiddl...@googlegroups.com
Hi springer

<<det "Failures of commentaries">>
<<det "Failures of commentaries">>

Results in an empty line between the details elements of the two macros. (in other words "double-spaced")

<$macrocall $name=det tid="Failures of commentaries"/>
<$macrocall $name=det tid="Failures of commentaries"/>

Results in them displaying with no empty line. ("single-spaced")



--
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/AlGwKXAUQzc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/07d428b7-2754-4fa5-a3e6-8104db222423n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages