Now if there were an easy way to customize the excise options for transclusions

With all this exciting stuff about transclusions, I wonder if it isn’t time to revisit the excise button.

Currently there is no easy way to add custom excise methods. If there is a transclusion + template combination that a user uses all the time, it should be easy to create a custom excise method so it gets added to the options in the excise button panel.

One great example would be to have an excise method that excises as {{Excised content's tiddler title||Editlink}} where Editlink does what @EricShulman has it do here.

Not the solution (yet) that you’re looking for, but I’ve been slowly hacking away at the excerpt code, including adding a Stroll-style backlink tool:

image

2 Likes

@DaveGifford I have being thinking along those lines as well but my idea is to leave the excise tool alone and create an insert template tool like the ctrl-L link editor toolbar button. Giving '{{ selection|| template }}`, where you can search for the template.

  • To assist I thought about setting the default template name.
  • This makes me wonder if this default template were available to the excise tool?
    • That is we have a tool to select a template and have a check box to use it in one or more existing tools.
  • Have you looked at the macro version of the excise tool?, perhaps we could select from a set of macros (in a list) or have a similar mechanisium for link and transclusion “templates”?

@Mark_S It looks like you are building an impresive version of the excise tool, can I suggest you leave the default one in place and make yours an additional button?. There is value keeping the standard tools in place at the same time you extend them. I hope you get to publish this.

@DaveGifford and @Mark_S it seems to be we should look at Dave’s idea and extend it.

And extend this to;

With all this exciting stuff about transclusions, I wonder if it isn’t time to revisit the tools we have for transclusions button.

What I am suggesting is we step back and take a broader look at tools to assist with the use of templates and for that matter other innovations in TiddlyWiki 5.3.0+ as we could add some substantial features with small tweaks.

  • Sure lest start with excise and templates, buit with a view to the future.
1 Like

I added a trans/template option.

image

If you want to try what I have so far. As always, be sure to have a backup. After importing, you will need to reload. You shouldn’t have to panic even if it throws a RSOE, since the excision code isn’t invoked until you click on the excise button. So you should be able to go in and delete

  • $:/core/modules/editor/operations/text/excise.js
  • $:/core/ui/EditorToolbar/excise-dropdown

To get back to the standard excise engine.

Recommended that you add a note to your front page about the excision code being overwritten, in case of changes during updates. My test with 5.3.0 worked OK. I’ve included a TransTemplate tiddler in case you don’t have your own template handy to try.

A quick explanation of the other options. You can use a poorly named Tiddler ExcisionTemplate (I plan to make this configurable). You can borrow (prefix) text, fields, and tags from it. This is handy if you’re doing a series of excisions where you want similar text. The “link to here” option puts a link at the top of the excerpt linking back to the original tiddler. The intention was if you wanted to divide an existing tiddler into multiple tiddlers linked together in a fashion similar to Stroll. The “Get title from first line” option allows you to title the new excerpt with the first line of text from the excerpt. It strips off exclamation marks at the start of text – this makes it easy to chunk header sections.

TransTemplate.json (212 Bytes)
excision-code-2023-07-05.json (8.0 KB)

2 Likes

Thanks Mark! I will try your trans template later on or tomorrow. Looks very promising. I would be using it mainly on a file to produce statics, so I won’t need to include the warning. Blessings!

Hi Mark,

Hey that is cool! The trans template option works great. And I figured out the x from template items. Nice!

Two questions:

  1. will you add a way to quickly delete all the state tiddlers that accumulate? I can do that myself with the filter tab in advanced search, but I thought it worth mentioning that those get produced. Or…do those state tiddlers need to stay put?

  2. Does “combo L/T” mean “combination of link and transclusion” ? It doesn’t look like you finished that option. Or at least after I tried it out, only the title appears as text in the tiddler from which I did the excision. I would be interested in seeing an update if you finish that.

Well, it is handy to not have to re-check all the boxes, especially if you’re doing a series of excisions that are almost the same.

That’s the idea, and no, it isn’t finished because I guess I don’t find it as necessary as I thought I would. I was also wondering whether a drop-box is as useful as just a series of checkboxes. With a series of checkboxes, you could mix and match whether you wanted a transclusion, macro, link, etc. Of course, then the screen is more cluttered.

Here’s an update with the combo feature in place. There’s just so many ways someone might want this.

excision-code-2023-07-09.json (8.4 KB)

@Mark_S thanks for sharing, I am playing with the functionality now.

I would like to suggest you dont replace the existing excise button, just create a new button and user can hide the old one if they want. Then there are no problems if the core changes.

I can give more feedback to refine it if you want?

ahhh okay. Never mind. I was imagining something like a transclusion template where the link is visible as a symbol somewhere, over top of, and off to the side of, the transclusion, so one could see the transclusion but also click to edit it. Someone gave me something like that last autumn, and do you think I can find it now? It became the inspiration for my draggy experiment around last November (see here). The link off to the side, in addition to functioning to open to edit, also functioned to drag transclusions up and down the tiddler in which they were transcuded.

It seems like you could already do that with the TransTemplate feature. Just have to come up with the right transclusion. I imagine involving a bit of CSS to float the link. But that’s getting away from the immediate task at hand – excision.

It’s not really a problem yet, what with a user base of two. Or maybe 1.5. Right now, if you don’t want to interfere with the core, you can just delete the two overridden core tiddlers and presto, the shadow tiddlers are back. But yeah, if interest develops, there should be someway to toggle the new button in/out. But I think having two excision buttons would be confusing.

There’s a lot workflows that an advanced excision tool could facilitate, so I’m open to suggestions … if they’re not too difficult :wink: