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

Plugin folder name should match plugin id in manifest.json #153

Open
SashaKryzh opened this issue Oct 14, 2024 · 6 comments
Open

Plugin folder name should match plugin id in manifest.json #153

SashaKryzh opened this issue Oct 14, 2024 · 6 comments

Comments

@SashaKryzh
Copy link
Contributor

For Obsidian to work correctly, the folder name in .obsidian/plugins must match the id in manifest.json. Without this, methods such as onExternalSettingsChange won't be called. However, this requirement isn't mentioned anywhere in the Obsidian documentation (neither on the Manifest page nor the onExternalSettingsChange page).

Why this is a problem:

  • Many people name their GitHub repositories with the word "obsidian" for organizational purposes, but Obsidian discourages including "obsidian" in the id. So, if such a repository is cloned, onExternalSettingsChange won't work.
  • The Build a plugin guide doesn't include a "rename folder" step, so new developers like me struggle to understand why methods such as onExternalSettingsChange don't work (Discord question).

Solutions:

  1. Update the documentation to include a "rename folder" step in the Build a Plugin guide and add this information to the Manifest and onExternalSettingsChange pages.
  2. Alternatively, changes could be made to Obsidian's code to address this issue, but that seems more complex and unnecessary.
@SashaKryzh
Copy link
Contributor Author

Should I create a PR to update the docs?

@sigrunixia
Copy link
Contributor

Should I create a PR to update the docs?

It would be helpful if you could at least get the foundations started. Joethei just go back from vacation and is catching up on plugin reviews, and my focus is on the main help docs for this week at least. :)

@SashaKryzh
Copy link
Contributor Author

Should I create a PR to update the docs?

It would be helpful if you could at least get the foundations started. Joethei just go back from vacation and is catching up on plugin reviews, and my focus is on the main help docs for this week at least. :)

I created a PR that addresses "Build a plugin" and "Manifest" pages. I think it would be good to also add this info to onExternalSettingsChange documentation.

@sigrunixia
Copy link
Contributor

Should I create a PR to update the docs?

It would be helpful if you could at least get the foundations started. Joethei just go back from vacation and is catching up on plugin reviews, and my focus is on the main help docs for this week at least. :)

I created a PR that addresses "Build a plugin" and "Manifest" pages. I think it would be good to also add this info to onExternalSettingsChange documentation.

To confirm, this is roughly the part that you think should be added to onExternalSettingsChange?

Note

For local development, the id should match the plugin's folder name; otherwise some methods, such as onExternalSettingsChange, won't be called.

@SashaKryzh
Copy link
Contributor Author

SashaKryzh commented Oct 22, 2024

To confirm, this is roughly the part that you think should be added to onExternalSettingsChange?

Note

For local development, the id should match the plugin's folder name; otherwise some methods, such as onExternalSettingsChange, won't be called.

Yes. When it didn’t work for me, the first page I opened was the onExternalSettingsChange documentation.

Maybe something like this: For local development, the id in the manifest.json should match the plugin's folder name; otherwise, this method won't be called.

@sigrunixia
Copy link
Contributor

sigrunixia commented Oct 22, 2024

Got it, I'll add it to my batch of changes this evening as your PR was already merged. :)

Edit: Joethei will handle this actually and get something added. <3

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

2 participants