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

Ignore lines that start with #660

Open
gerroon opened this issue Feb 10, 2024 · 10 comments
Open

Ignore lines that start with #660

gerroon opened this issue Feb 10, 2024 · 10 comments

Comments

@gerroon
Copy link

gerroon commented Feb 10, 2024

What problem does it solve?

Hi

It would be useful if Sleek can ignore lines start with certain words/characters etc that can be defined in the settings. This can help with being able to add more information, commenting integration with other apps. For instance I want to be able to have yaml frontmatter at the top of the todo.txt file, currently that would look sucky in Sleek. But if the user can define a set of words/characters to ignore lines. words etc Sleek can just show the relevant todo info as usual

How does the user interface change to accommodate this request?

The interfcae would not chage, but the user would need a way to define ignore patterns in some kind of setting.

@ransome1
Copy link
Owner

@gerroon since I don't consider this a self explanatory feature for the average sleek user, I would propose a setting on config file level. Something like excludeLineStartsWith: "//"

I cannot think of a good attribute name ...

@gerroon
Copy link
Author

gerroon commented Feb 10, 2024

That would do it for real. Thanks for considering it.

ransome1 added a commit that referenced this issue Feb 11, 2024
…f of concept for human friendly dates in the UI (#609). Added a setting, which helps to hide todos by prepending a prefix to the beginning of the line (#660).
@ransome1
Copy link
Owner

@gerroon you can find this function in the latest pre-release: https://github.com/ransome1/sleek/releases/tag/v2.0.10-rc.1

In your config you will find a new setting called excludeLinesWithPrefix. Per default it is set to null and has no effect.

If you for instance add a string like this excludeLinesWithPrefix: "##", each line which starts with ##, should be skipped during the parsing process. Feel free to give it a try.

@gerroon
Copy link
Author

gerroon commented Feb 11, 2024

Thanks, however I am not seeing that new setting in the config file. It did not look like it added it after I ran the updated version.

@ransome1
Copy link
Owner

It's possible that the migration tool will only add it on non rc version. You can just add the option manually to the config.json.

@gerroon
Copy link
Author

gerroon commented Feb 11, 2024

Thanks, I think it works.

@gerroon
Copy link
Author

gerroon commented Feb 11, 2024

Btw would it accept multiple prefix types?

@ransome1
Copy link
Owner

Right now it only accepts a single string, but it can be build in a way, that it would accept an array:

"excludeLinesWithPrefix": [
	"##",
	"//"
]

If this helps, I can change the behavior in the next pre-release.

@gerroon
Copy link
Author

gerroon commented Feb 12, 2024

That would be awesome Thank you. Thanks for implementing it.

ransome1 added a commit that referenced this issue Feb 23, 2024
…f of concept for human friendly dates in the UI (#609). Added a setting, which helps to hide todos by prepending a prefix to the beginning of the line (#660).
ransome1 added a commit that referenced this issue Feb 23, 2024
…f of concept for human friendly dates in the UI (#609). Added a setting, which helps to hide todos by prepending a prefix to the beginning of the line (#660).
ransome1 added a commit that referenced this issue Feb 23, 2024
…f of concept for human friendly dates in the UI (#609). Added a setting, which helps to hide todos by prepending a prefix to the beginning of the line (#660).
ransome1 added a commit that referenced this issue Feb 23, 2024
…f of concept for human friendly dates in the UI (#609). Added a setting, which helps to hide todos by prepending a prefix to the beginning of the line (#660).
@ransome1
Copy link
Owner

@gerroon the array approach can be tested in the latest pre-release: https://github.com/ransome1/sleek/releases/tag/v2.0.10-rc.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants