jensmtg / obsidian-diagrams-net

This repository contains a plugin for Obsidian for inserting and editing diagrams.net (previously draw.io) diagrams.
MIT License
96 stars 14 forks source link

The plugin should allow configuration so that the attachment is included within the folder where the note is inserted and not in the root folder #3

Open dlholdefer opened 2 years ago

dlholdefer commented 2 years ago

The plugin is excellent. However, I'm having the following problem:

As a rule, it saves the file in the following location: Attachments/Diagram.svg

However, it creates the "Attachments" folder in the root and not inside the current folder (where the note is being prepared).

Also, it always saves as "Diagram.svg" causing the files to overlap. Ideally, by default, the plugin would automatically increment the name. Example: Diagram1.svg, Diagram2.svg, Diagram3.svg, Diagram4.svg, etc.

Therefore, I kindly request two updates:

1) The possibility of configuring the plugin so that the attachment is included within the folder where the note is inserted and not in the root folder;

2) That the diagram is saved with automatic name increment or that the inclusion of a specific name by the user is mandatory, avoiding conflict between two files with the same name.

Thank you very much. The Plugin is a 10!

jensmtg commented 2 years ago

Thanks for the comment! Regarding your points:

  1. I understand this request, and will look into adding this setting for a future version.
  2. It is allready default behaviour for the plugin to increment names (it uses the obsidian API vault.getAvailablePathForAttachments function, which increments names if necessary). If you experience that this is not the case that is a bug I'm not able to reproduce. What version of obsidian on what system are you using?)