Anchors for Streams

Hello All,

I made this little plugin as a companion for streams for a particular workflow I wanted to use.

$__plugins_xyvir_anchors-for-streams.json (5.3 KB)

The idea is you make a ‘template’ node stream with all of your top-level headers; maybe this is like an example assignment or document or something with pre-defined headers. Then you use the provided ‘anchor’ button to anchor the headers.

Now if you clone this node stream and double-click on any of the anchors, they will ‘spawn’ sibling clones in your ‘currently-viewed’ nodestream even though all the individual ‘anchored’ nodes are technically trancsluded from the original.

The other advantage is that anchor-spawns are automatically tagged with the alphanumeric content of the anchor itself so you have a way to cross reference sections across
your filled templates via these tags.

Just be careful not to indent these siblings or they will ‘glom on’ to the transcluded anchor tiddler which isn’t really the intent. (I plan to make an update eventually that will prevent anchored nodes from being indented)

I also added it to the edition I’m working on at

https://lithic.uk

If you wanna check out the demo there.

I’d love any feedback and hopefully this could help anyone looking for a similar streams workflow.

-Xyvir

2 Likes

Hi @Xyvir thanks for your contribution but some gentle feedback is the language you use to describe this is not easy to read. I know how to use streams and have no idea what;

  • “Top level-headers”
  • Then predefined headers?
  • What are the anchors
  • anchor-spawns
  • alphanumeric content of the anchor itself

Then I follow the link and all it see is stuff about lith (interesting idea) but far from straitforward.

That’s valid, I was going to make a demo wiki with Anchors and vanilla Streams and a bit better info on its intended use, but it turns out Anchors’ overlay elements are broken and only work in my lithic edition as I would desire (likely due to me using markdown by default and that adding another html element into the mix) .

So I’m going to pause advertising it as a standalone plugin for now :sweat:

if by anchors you are referring to html anchors and internal links I did further the science of this with an LLM and a plugin to generate a tiddler based toc, I can share.

interestingly it is a widget that defers until a tiddler is rendered and only then given you choice of CSS selectors uniquely identifies the elements and generates a toc to them. Amazing really.

It foreshadows a new and interesting code pattern.

This led me to another plugin that allows one to toggle the open attribute on the html details tag and multiple on the select widget.

1 Like

No “anchors” was just a somewhat arbitrary term I decided for the workflow I wanted to use.

Basically you make a nodestream tiddler that will act as your template, you fill it with nodes acting as “headings” and don’t indent any of the nodes. IE:

LabReportTemplate

  • Intro
  • Equipment
  • Procedure
  • Results

Then you click the “anchor” view toolbutton (which just postpends the text {{||$:/anchor}} to all of the above nodes)

Then you clone the template and rename it, like LabReport1.

Transcluding the $/:anchor tiddler prevents those nodes from being edited in streams via double-clicking; instead when double-clicking a new sibling-node is added after the “anchored” one in the current (copied) node stream. Additionally the new sibling-node has a tag added that matches the content of the ‘anchored’ node. Ie the node created “from” the anchored one is tagged “intro”.

Then you can repeat this procedure by cloning LabReportTemplate for LabReport2, etc etc.

Does this help explain the workflow I was shooting for?

Just let me know.

1 Like