Excerpting sections of text

Hi,

I’ve been using Tobias’s excerpt macro to pull out significant sections of a tiddler so they can be displayed elsewhere.

This works really well but what I’ve realised, is that rather than actually extracting the text, it just gives this impression by using CSS to hide the text surrounding the extraction.

This means that large blocks of text are being duplicated causing unnecessary bloating.

I was wondering if anyone is using an alternative?

Thanks
Jon

Is that causing you some measurable harm? Do the tiddlers with <<excerpts ...>> take a long time to load?

I ask because this is not causing bloating in your stored version, only in memory usage. If it’s not causing you problems, then I think it’s safe to ignore.

If it is causing problems, then I think a fix would involve a significant rewrite. We’d somehow have to parse out the macro syntax and capture its internals. Maybe this would be trivial, but I don’t know offhand how to do that.

1 Like

Hi Scott,

No apparent harm, but I think the bloating is real.

The excerpted text snippets are displayed in a separate ‘Excerpt’ tiddler.

When I removed the visibility:hidden; from the macro, then the surrounding text of the excerpt is also displayed in the Excerpt tiddler.

So it looks like the whole tiddler is duplicated and then the css hides everything other than the excerpt.

I’m only a novice, though, so I could be completely wrong and I hope I am as I’d prefer to keep using the macro (but not if it’s doing this)

What you’re seeing is accurate. But if you edit the tiddler that shows the excerpts you will find that in includes only "<<excerpts …>>`. All the content is not copied over and stored; it is simply rendered in more than one place. That does increase memory usage; it’s conceivable that in some really large wiki, it would throw you over some memory threshold, but that’s extremely unlikely; TiddlyWiki would probably have other serious problems long before this became an issue. But is shouldn’t cause any bloating in storage.

Ah, I see.

The magic of TW!

Many thanks
Jon

1 Like