Code Monkey home page Code Monkey logo

Comments (10)

ozntel avatar ozntel commented on June 5, 2024

To be honest, I didn't understand what you mean exactly

from file-tree-alternative.

Mara-Li avatar Mara-Li commented on June 5, 2024

Folder Note is a plugin from xpgo, and there is a rewrite from AidenLx.

The purpose of the plugin is to "link" note to a folder. When you click on the folder, a note appear. Moreover, the synced file is hidden in the explorer.

It will be good to have a similar thing with file tree, to open a note with same name of the folder directly after open a folder, and hide the note in the file.

from file-tree-alternative.

ozntel avatar ozntel commented on June 5, 2024

I am afraid it will be hard.

I would need to have access to the main function of the plugin you mentioned from the window objects so that I can add an event handler click + ctrl to trigger.

@aidenlx would you be able to give access to the main function triggered by the click + ctrl event so that I can add to the file-tree-alternative plugin?

zsviczian did something like that for the oz-image-in-editor plugin when we implemented excalidraw drawings into editor. You can see our discussion below:

ozntel/oz-image-in-editor-obsidian#15 (comment)

from file-tree-alternative.

aidenlx avatar aidenlx commented on June 5, 2024

Actually, I've added an event listener to titleInnerEl (div.nav-folder-title-content) in here, and the event handler is here. What it does is essentially loop through TFolder's children/parent to see if any file matches the rule of folder note.
I don't have time to read your code yet so I may not be about to add support to this myself, but feel free to contribute anyway :)

from file-tree-alternative.

Mara-Li avatar Mara-Li commented on June 5, 2024

Any idea if it will be implemented ? It's the only thing that stop me to using this plugin :(

from file-tree-alternative.

ozntel avatar ozntel commented on June 5, 2024

If Aiden manages to make available the function, which I can trigger with a custom event, I can implement but I need to have this available in window object.

@aidenlx I see that the trigger requires your plugin as an argument, which I can not provide from my side. If you create any custom function, which only requires objects from Obsidian's API (like TFile, TFolder for which folder note needs to be opened or app etc) and push this function to window object, I can check if your plugin is loaded and then trigger this custom function from window to open the folder note once the certain event happens (like ctrl + click or context menu in file tree). You don't need to read anything from file tree alternative but just give me an access to your plugin with a small function :)

@Mara-Li I will close this issue for the moment but I will work on it once such function is available for me.

from file-tree-alternative.

aidenlx avatar aidenlx commented on June 5, 2024

oh good news here, I've separate the api from folder note plugin and migrate them to folder-note-core, you should be able to use npm i -D @aidenlx/folder-note-core to use api, you can check README for details of how to use API, and here are all functions exposed in the API: https://github.com/aidenlx/folder-note-core/blob/master/src/typings/api.ts

btw if you are using built-in file-menu to trigger context menu, you won't need to do anything to have quick actions to manipulate folder notes working.

I haven't got time to come up with a full API docs, so let me know if there is any questions regarding to API usage.

from file-tree-alternative.

ozntel avatar ozntel commented on June 5, 2024

btw if you are using built-in file-menu to trigger context menu, you won't need to do anything to have quick actions to manipulate folder notes working.

Yeah, actually I use built-in file-menu:

app.workspace.trigger('file-menu', folderMenu, folder, 'file-explorer');

To be honest, I have never used Folder Note, that's why I didn't know that you have added a menu item :)

@Mara-Li I installed Aiden's plugin and it actually shows the menu item:

But I don't have an idea how it supposed to work.

from file-tree-alternative.

aidenlx avatar aidenlx commented on June 5, 2024

@Mara-Li maybe you should list those features you need the most from the patched file explorer by folder note plugin.

I've opened a new feature request in folder-note-core repo for a folder menu option to open folder notes, meanwhile, if you need to implement "click folder title to open folder note, elsewhere to collapse folder", here are the code that might be helpful: https://github.com/aidenlx/alx-folder-note/blob/517c55e1836ec40ca924125ec0f7fa69f6a4263e/src/modules/click-handler.ts#L29-L52

from file-tree-alternative.

ozntel avatar ozntel commented on June 5, 2024

@Mara-Li -

I just implemented the same functionality what Folder Note Plugin provides.

If there is a note for a folder, the plugin will have an arrow on the right side of the folder so that you can easily identify which folders have its notes.

It is capable of working standalone (no need to have folder note core installed) but checks if Folder note Core is enabled anyway to not duplicate "Create/Delete Folder Note" buttons in the context menu.

Single Click will open the file list for the folder, "Click + Shift" will open the folder note in the active pane.

You need to enable first from the plugin settings to use it.

Let me know if there is any issue.

from file-tree-alternative.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.