giuspen / cherrytree

cherrytree
https://www.giuspen.net/cherrytree/
Other
3.37k stars 459 forks source link

Create multiple nodes from a list of node names in the clipboard #2258

Closed emecas closed 1 year ago

emecas commented 1 year ago

I'm always frustrated when I have to perform repetitive tasks manually.

I wondering if a dynamic creation of multiple nodes from a list of node names in the clipboard would be possible, using each line in the list as a node name, in addition using tabs or spaces to represent the tree levels .

Sample List:

Nodes
    1
        1.1
        1.2
    2
    3
    4
    5
    6
        6.1
        6.2
        6.3
        6.4

Result:

image

giuspen commented 1 year ago

Also asked in https://github.com/giuspen/cherrytree/issues/1551 I'll have a thought, If it's quick enough to implement maybe I'll squeeze it into the next version

emecas commented 1 year ago

Also asked in #1551 I'll have a thought, If it's quick enough to implement maybe I'll squeeze it into the next version

Thank you @giuspen for the quick response, I look for a similar feature request before submitting this issue, with not success 😲 🤐 , thank you for bringing #1551 here, I believe managing this as an import option is also a valid way and maybe cleaner approach than the clipboard.

giuspen commented 1 year ago

This has been implemented and will be in 0.99.56 but if you can test it already building from the current source code would be useful. File->Import->From Indented List File The file syntax is very simple, the indentation can be of multiple of one spaces or multiple of one tab, example:

1
2
 2.1
  2.1.1
  2.1.2
 2.2
3
emecas commented 1 year ago

This has been implemented and will be in 0.99.56 but if you can test it already building from the current source code would be useful. File->Import->From Indented List File The file syntax is very simple, the indentation can be of multiple of one spaces or multiple of one tab, example:

1
2
 2.1
  2.1.1
  2.1.2
 2.2
3

Thank you sir!!! I will make time for testing soon!!!

emecas commented 1 year ago

Tested with spaces and tabs. It is working properly, same in the root tree as in the selected node.

Just casually, while testing I noticed that for consecutive imports, nodes with same name are created as new nodes. It was not a clear requirement, but I am now wondering if any of the existent alternatives to import in the main menu has the option to [decide] merge/replace existent nodes?

giuspen commented 1 year ago

It is tricky to consider two nodes with the same name as the same, there's much more than the name, there's the position in the tree and then CherryTree supports also subsequent nodes with the same name (in fact a unique numeric id is used per node).