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 configuration for what it means to be 'empty' #44

Open
ee-usgs opened this issue Mar 14, 2024 · 3 comments
Open

Add configuration for what it means to be 'empty' #44

ee-usgs opened this issue Mar 14, 2024 · 3 comments

Comments

@ee-usgs
Copy link

ee-usgs commented Mar 14, 2024

I have lots of effectively empty daily notes 'Daily notes' plugin. That plug allows a template to be used when it creates a new notes, so those files are not exactly empty - they have the contents of that template.

For Daily Notes from a template, it might be nice to have an option that says, 'If a file matches this template and has no other content, consider it empty'. More generally, perhaps the simplest/most flexible way to do that is to have a regex expression that, if it matches the entire contents of the file, causes the file to be considered empty.

@husjon
Copy link
Owner

husjon commented Mar 16, 2024

I've been having a think about this issue for the last few days and I'm unfortunately not able to come up with a good solution.

Here are the problems I'm facing:

  1. The difference between the actual template and the pattern needed to match the file will be different, hence you need to maintain it twice (this also depends on if you're using the built-in template engine or for example the Templater plugin).
  2. Regular expressions are expensive operations, since we're talking about rather big patterns over quite a few files (as in the entire vault) this can result in really long run times.

I will leave the issue open in case I or someone else comes up with something, but I cannot guarantee a quick implementation.

What could help is if you could give an example of the template you use and just a dummy example of a filled out daily note (no personal details etc).
This would at least give me something to look into and benchmark.

@klemmster
Copy link

I'm facing the same issue.
This is my template right now:

# Plan
- [ ] 
# Notes
 
# Standup
- [ ] 

@husjon
Copy link
Owner

husjon commented May 27, 2024

It is however important to realize that the user themselves will have to maintain their own regular expression patterns because of the vast amount of different templates out there.

As I am in the process of rewriting the plugin and will be adding support for finding attachments which are used in Admonition code blocks using regular expressions, this might make this feature possible as well.

For now I will not add the issue to the v1.0.0 milestone but I'll definitely keep it in mind.

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

3 participants