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

Add option to use regex on file path instead of folder templates #974

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

harmtemolder
Copy link
Contributor

@harmtemolder harmtemolder commented Dec 29, 2022

As discussed in #471 the current folder templates do not cover all use cases. Having the option to use regex on the file path of a new file instead should give advanced users the flexibility they seek.

I've kept the folder templates option intact, letting a user pick between the two. Their toggles are linked, so enabling one will disable the other.

I've also updated the docs to match the current layout of the settings window.

And I made two minor changes to .gitignore:

  • Exclude package-lock.json, because I don't think we need to lock versions, do we?
  • Include .vscode/settings.json, to allow for synching of workspace settings between our VSCodes, specifically editor.defaultFormatter, so that all of use Prettier (and thus the included .prettierrc.json)

@harmtemolder
Copy link
Contributor Author

n=1 of course, but I've been using these changes without any hick-ups since December

@quanru
Copy link

quanru commented Jul 12, 2023

Is it possible to merge with the main branch?

@harmtemolder
Copy link
Contributor Author

Is it possible to merge with the main branch?

We would need @SilentVoid13 for that

@AB1908
Copy link
Collaborator

AB1908 commented Jul 14, 2023

Exclude package.json, because I don't think we need to lock versions, do we?

We do actually. It's still useful to pin APIs to specific obsidian versions. There's also scripts and dependencies in there that we'd like to keep updated. Finally, I think Obsidian itself needs the version info in it to install properly.

@quanru
Copy link

quanru commented Jul 14, 2023

Could you remove the changes to .gitignore and vscode configuration, or have a separate MR, so that this feature can be merged faster? @harmtemolder

@harmtemolder
Copy link
Contributor Author

Sorry about that. I see that I wrote package.json, but I actually excluded package-lock.json, not package.json. I'll remove .vscode/settings.json

@vzcrab
Copy link

vzcrab commented Sep 14, 2023

Excuse me, Does the PR have made any new progress?

@harmtemolder
Copy link
Contributor Author

The PR was finished a year ago, but I see there are now conflicts because of changes made to the plugin in the time since then. I (or someone else) would need to resolve those before @SilentVoid13 would be able to merge the PR.

@SilentVoid13 Are you interested in merging this PR? If so, I'll take the time to resolve the conflicts

@Zachatoo
Copy link
Collaborator

I am interested in seeing this functionality added. If you resolve the conflicts and remove the unrelated changes (such as updating the .gitignore file) then I will be happy to pull this down to test and merge it if it works on my end.

Ideally, we'd also add unit tests for this, but I don't think it's strictly required, as long as the existing tests still pass.

@harmtemolder
Copy link
Contributor Author

@Zachatoo I've solved all conflicts, built and tested with the file regex templates I use in my vault. Those work as expected. Could you explicitly test that this does not break any existing folder templates somebody might be using?

I've never written unit tests in TypeScript, but adding those for this functionality sounds like a good idea. Let me know how I can help with that.

Copy link
Collaborator

@Zachatoo Zachatoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harmtemolder Thanks for making those changes! PR looks a lot cleaner. Automated tests are passing and existing folder templates functionality appears to be working still.

There were some changes from #1468 that will result in a UX conflict, but I can resolve that after I merge this before the release.

@Zachatoo Zachatoo merged commit c7d62f4 into SilentVoid13:master Oct 1, 2024
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

Successfully merging this pull request may close these issues.

5 participants