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

[Feature Request] Option to Also Rename Tag Pages Instead of Just the Aliases #129

Open
rx-chris opened this issue Mar 30, 2024 · 3 comments

Comments

@rx-chris
Copy link

rx-chris commented Mar 30, 2024

The current issue

  • Renaming a tag currently only renames the alias of a tag page but not the name of the tag page markdown file.
  • I understand that this to avoid file naming conflicts when renaming multiple different tags into the same tag name, since we cannot have multiple markdown files with the same name.

Proposed Solution

  • First check if a markdown file already exist in the vault with the same name
  • If there is a name conflict for the new tag name, simply append a number to the end of each renamed tag page.
  • e.g When we rename 3 different tags to the same name such as #new-tag-name, the corresponding tag pages can also be renamed accordingly to "new-tag-name.md" , "new-tag-name (1).md", "new-tag-name (2).md".
  • We can then go ahead to manage or delete the multiple tag pages accordingly.
@pjeby
Copy link
Owner

pjeby commented Mar 30, 2024

Automatic renaming is not really an option since tag pages can literally be named anything and placed anywhere in the vault. It might be reasonable to add extra text to the rename warnings to indicate how tag pages will be affected though, and suggest people make those changes prior to renaming the tags.

@rx-chris
Copy link
Author

Well I do get it and the truth is, I also really like the flexibility of Tag Pages being able to be named anything and I believe that this should not change. That being said, I noticed that there is also a default naming convention that is currently used by Tag Wrangler when you create a new Tag Page using its context menu. I am following that default naming convention at the moment which is why I am suggesting an OPTIONAL setting that can be toggled on/off the Tag Wrangler settings:

  • If turned on, Tag Pages will be renamed according to the default naming convention set by Tag Wrangler (and deals with naming conflicts using the solution that I proposed above)
  • and if turned off, users can implement their own scripts to rename their Tag Pages according to it's respective aliases if need be.
  • We could even go a step further to include name formatting settings for Tag Pages which is similar to the "Date Format" setting using in "Daily Notes" core plugin.
    • e.g if we specify a format such as "{{TAG}} tag note" in the setting, all Tag Pages will by default add a " tag note" suffix when being created or renamed using Tag Wrangler.

Well, It might be a little ambitious at this point, considering Tag Wrangler does not yet implement any settings at the moment.

Personally, I plan to write a macro script using the QuickAdd API to rename my Tag Pages to match my renamed tags anyway but I thought it would makes sense to include this as a feature since Tag Wrangler is already implementing its own default naming convention for Tag Pages.

@pjeby
Copy link
Owner

pjeby commented Mar 31, 2024

More than a little, yes. I think the most likely scenario here is that I add events to announce the renaming of tags, so that another plugin could handle this. TW already issues events for tag page creation, so a dedicated "tag page name manager" plugin or macro set could handle maintaining a naming convention for tag pages, or even merge tag pages when their tags merge.

I will look into adding more events when I work on TW again, as well as adding more info to the rename warning.

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