Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Shared Nodes" [Feature Request] Cloning Nodes #1222 #2657

Open
RFImages opened this issue Feb 18, 2025 · 9 comments
Open

"Shared Nodes" [Feature Request] Cloning Nodes #1222 #2657

RFImages opened this issue Feb 18, 2025 · 9 comments

Comments

@RFImages
Copy link

RFImages commented Feb 18, 2025

@giuspen Thank you for implementing the Cloned Nodes feature described in #1222
However, the request thread was closed without explanation of how to find it and use it.

I have recently found several uses for this but I can't figure out how it works or find instruction on it.

I see "create shared Node" in the "Tree" menu, (is this it?) and I see the tool tip that says "Create a new node, sharing the Same data of the selected node."

But now what? It simply appears to duplicate the selected node, similar to "Duplicate Node" ? I have a shared node now apparently , but no idea what to do with it. can you explain or point me to an explanation? Thank you for all of your hard work, it is time for my monthly donation. I will do that later today.

@gitvectors
Copy link

I have just noticed this new feature. Intrigued about its potential usage.
Experimenting .. if I choose a node I can go to Tree > Create Shared Node and a clone is created.

It seems that the content and properties are synced. Edit one node (Title, Content) and the “cloned” node also changes in step.

Looking at Properties of each node, original and clone, each node has a unique ID, but is part of a group of cloned nodes.

Please suggest how this cloned node feature can be used.

@RFImages
Copy link
Author

RFImages commented Feb 18, 2025

Oh interesting I did not notice that they are synced. I think the intent is to have a single point of reference that can be referred to from many other nodes. In other words if you edit it in one node, the changes will be reflected in other nodes. That is what I understood from the #1222 thread that is now closed.
But I don't understand how to refer to it, or how it is more helpful than just linking to the reference node from various other locations? To include it as a reference from various locations, those locations would all have to have identical text it seems.
Ideally, the other locations would show a window into the shared node, which can be edited from that window anywhere it appears. Hopefully that is how it is implemented, but I don't know how to insert that window.

@gitvectors
Copy link

gitvectors commented Feb 19, 2025

To give you a handle on my current thinking. I have many, many *.ctd documents scattered through my Ubuntu desktop. I can see the need for drawing on (including) standard nodes to include in other nodes but I cannot grasp how to use this node cloning feature. My current line of thought is to leverage Zillix to "vectorise" CherryTree documents. I am playing with that idea now. Another line of thought is to place *.ctd into eXist-DB collections within my desktop in eXist-DB local installation, and not drawing on cloud services. That has worked when I last tried it some time ago. Basically we need a network to leverage an "orchard" or corpus of multiple cherrytrees.

@dbwiz
Copy link

dbwiz commented Feb 26, 2025

I'm hoping to use cloned nodes in documentation. Typically there's some things like a glossary, standard disclaimers or contacts that are repeated across documents. When you structure a node tree as a document you can include the cloned node and have it export to PDF in the given order. The bonus is, when you have multiple documents you can reuse the same cloned node without any effort, and the cloning will let you update say all contact info at the same time across all documents. There's some minimal issues with PDF export that I'd like to feature request at some point to do my shareable documents this way, but that's what I'm intending it for.

@giuspen
Copy link
Owner

giuspen commented Feb 28, 2025

The so called shared node feature has 2 use cases:

  1. when generating exports to html/pdf/etc. of the whole tree and you need some content to be repeated but you don't want just a simple duplication of the node, as otherwise when you modify one then you would have to manually modify all of them. Something like a macro is used in programming
  2. you want an important node to be easily accessible from multiple parts of the tree without going via the bookmarks

Look at the screenshots below of two nodes properties. These 2 nodes are almost identical except from the bottom part where you read "Unique Id" and "Shared Nodes Group", only that gives away that they are part of a shared nodes group.
In this case the database does not have duplicated data and the so called Master of the data is in this case the id 5 (the first in the list of the shared nodes group)

Image

Image

@RFImages
Copy link
Author

@giuspen Thank you maybe I am thinking of a third use case - say I have a table of some sort or other info that would be commonly referenced from other nodes and visible within those other nodes without having to change to the shared node to look at it or edit it.

That was what I thought was the purpose, can this be done as I imagined? If so how? I would expect something like "Insert shared node" in the Right Click/Insert Menu.

@gitvectors
Copy link

Will a quick access to a directory of text snippets (to paste selected snippet into CT node in focus) help?

@giuspen
Copy link
Owner

giuspen commented Mar 1, 2025

@RFImages is what you feel the need to, to see the content of more than one node at the same time? Something like a dual pane support where on the left pane you have one node and on the right you can have another node of the tree? That has been asked before and I am considering to support it

@RFImages
Copy link
Author

RFImages commented Mar 2, 2025

You are reading my mind @giuspen , that was going to be my next request after the Collapsed Headers feature is complete and debugged-( maybe it is in 1.3.0, I have not downlaoded it yet). Tabbed Nodes with dual panes.That would also be very useful! Especially if there was a compare feature between panes as editors likes Notepad++ offer (as a plug in).

But in this case no, I just expected to be able to insert the content of a shared node inside any other node, with a command such as "Insert Shared Node" as if it were pasted there, but that pasted section would be available anywhere else it had been pasted. If edited, it would be edited everywhere it had been pasted (in all nodes that referenced it). It would be helpful for commonly referenced text or tables, code snippets....

As an example, suppose I was coding something and there was a data structure that I reference often. This is something I have recently had to do. I always have to find the code and paste it locally for reference, since I cannot view two nodes at the same time there are mulitple copies distributed through my log. But if I need to edit it, I have to go find the source of the structure. The problem then is I also have to edit all the places I have pasted it or else have many incorrect outdated copies distributed throughout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants