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

Can section information be added to tasks? #4

Open
wsnjh007 opened this issue Oct 11, 2024 · 17 comments
Open

Can section information be added to tasks? #4

wsnjh007 opened this issue Oct 11, 2024 · 17 comments
Assignees
Labels
enhancement New feature or request

Comments

@wsnjh007
Copy link

Hello,

Thank you so much for your continuous maintenance of this project!

I have a request, and though I’ve tried modifying the code myself, my limited abilities have prevented me from achieving the desired result.

Here’s my use case: I like to break down projects in Obsidian, for example, dividing a project into "Preparation Phase," "Execution Phase," and "Review Phase." In my documents, I often use headers like "### Preparation Phase," "### Execution Phase," and "### Review Phase" to separate sections. Under these headers, I write the corresponding tasks. At the same time, in Todoist, I organize tasks into sections like "Preparation Phase," "Execution Phase," and "Review Phase" for better management.

My specific request: Is it possible for Obsidian to recognize tasks with the #tdsync tag and identify which "###" (h3) header they are under, such as "### Preparation Phase," and then set that header as the section name in Todoist, syncing it to Todoist as the section?

I’m really looking forward to your further updates! 💐

您好,很感谢您对这个项目的持续维护!
我有个需求,自己也尝试过修改代码,但是能力有限,实现不了。
我的使用场景:我喜欢在obsidian中对项目进行拆解书写,比如会将项目分为:准备阶段、执行阶段、回顾阶段。一帮在文档中会使用“### 准备阶段”、“### 执行阶段”、“### 回顾阶段”等标题作为区分,然后在这些标题下面进行任务书写。同时也会在Todoist中设置“准备阶段、执行阶段、回顾阶段”等版块进行分类管理。
具体需求:能否在obsidian中识别带有#tdysnc标签的任务内容,所在的哪个带有“###”的h3标题下,如“### 准备阶段”,将这个标题设置为Todoist的版块名称,并同步到Todoist,
非常期待您的进一步更新!💐

@eudennis
Copy link
Owner

To be sure that I got it right, the h3 header is within Obsidian but not on the task line itself, correct?

I was planning to add the Todoist section support at some point in the near future, but if you're looking for to read the header above the task to define the section, I believe will be much more complex.

The plugin works today by reading through the strings on the line; trying to read something outside the line makes it very hard. But I might take a look.

@eudennis eudennis self-assigned this Oct 16, 2024
@eudennis eudennis added the enhancement New feature or request label Oct 16, 2024
@eudennis
Copy link
Owner

This one is much more complex as it seems, so is on my list but not something that will be ready soon tbh

@wsnjh007
Copy link
Author

To be sure that I got it right, the h3 header is within Obsidian but not on the task line itself, correct?

I was planning to add the Todoist section support at some point in the near future, but if you're looking for to read the header above the task to define the section, I believe will be much more complex.

The plugin works today by reading through the strings on the line; trying to read something outside the line makes it very hard. But I might take a look.

Yes, the h3 header is in Obsidian, and the idea is to get the section information by reading the h3 header above the task.

You could first try to implement this feature by reading a special string within the task line. However, if it can be achieved by reading the h3 header above the task, that would be ideal. It feels more natural for writing and would help keep the layout in Obsidian similar to Todoist.

I will patiently wait for your update, and I’m very grateful for your generous contribution!

@eudennis
Copy link
Owner

@wsnjh007 I've just pushed v0.4.0 to releases. It included support for "Section" using triple slash (///project_name) if you want to try. However, there are some limitations. The REST API from Todoist doesn't seem to support updates, so you can only create a task with a section. It doesn't seem to support adding a section to an existing task—at least I didn't figure it out yet.

Also, I'm not sure about the /// yet; I might change it for another symbol someday.

@wsnjh007
Copy link
Author

@wsnjh007 I've just pushed v0.4.0 to releases. It included support for "Section" using triple slash (///project_name) if you want to try. However, there are some limitations. The REST API from Todoist doesn't seem to support updates, so you can only create a task with a section. It doesn't seem to support adding a section to an existing task—at least I didn't figure it out yet.

Also, I'm not sure about the /// yet; I might change it for another symbol someday.

Okay, I'll give it a try and provide feedback if there are any issues. Thanks!

@wsnjh007
Copy link
Author

@wsnjh007 I've just pushed v0.4.0 to releases. It included support for "Section" using triple slash (///project_name) if you want to try. However, there are some limitations. The REST API from Todoist doesn't seem to support updates, so you can only create a task with a section. It doesn't seem to support adding a section to an existing task—at least I didn't figure it out yet.

Also, I'm not sure about the /// yet; I might change it for another symbol someday.

I tried it out and found an issue: "///project_name" works for English but not for Chinese. I haven't tested other languages yet.

@eudennis
Copy link
Owner

Hmm, sorry for that. I believe the issue must be on the REGEX, which, for now, looks just like Latin characters. Let me take a look, it should be an easy fix.

@eudennis
Copy link
Owner

@wsnjh007 I've pushed 0.4.1, and the regex "should work", but I didn't work very well with my Todoist - but I believe is because my default language doesn't work very well. Can you just give a try?

@wsnjh007
Copy link
Author

@wsnjh007 I've pushed 0.4.1, and the regex "should work", but I didn't work very well with my Todoist - but I believe is because my default language doesn't work very well. Can you just give a try?

I just tested it, and there are still issues with Chinese support. When I input "- [ ] ///版块1 test1 #tdsync", the generated task name is "版块1 test1" without any section information; when I input "- [ ] ///section test2 #tdsync", the generated task name is "test2" with the section information as "section"; when I input "- [ ] ///section版块 test3", the generated task name is "版块 test3" with the section information as "section".

@eudennis
Copy link
Owner

k, thanks for checking and sorry for the confusion. Those are tricky regex rules; I will give them another try today.

@wsnjh007
Copy link
Author

k, thanks for checking and sorry for the confusion. Those are tricky regex rules; I will give them another try today.

翻译如下:

Is it possible to identify the content between "///" and "///"?

@eudennis
Copy link
Owner

Within the same line? Yes.
On multiple lines? Much more complex.

Just to let you know, I've fixed the issue above, but haven't pushed the updates yet, I still need to work on some other bugs to push all together

@wsnjh007
Copy link
Author

Within the same line? Yes. On multiple lines? Much more complex.

Just to let you know, I've fixed the issue above, but haven't pushed the updates yet, I still need to work on some other bugs to push all together

Yes, within the same line. Thanks for the update.

@eudennis
Copy link
Owner

I've pushed 0.4.2 to Github, I've tested with "///版块1 test1" and worked fine. About doing something like: "///版块1///" is something that I can try later because there would be more changes on the regex for this.

@wsnjh007
Copy link
Author

I've pushed 0.4.2 to Github, I've tested with "///版块1 test1" and worked fine. About doing something like: "///版块1///" is something that I can try later because there would be more changes on the regex for this.

Thank you for the update. I just tested it, and it has indeed improved. However, there is a new issue: when I enter "- [ ] ///版块1 test1 #tdsync" in Obsidian, the section information in Todoist is correctly set as "版块1," but the task name remains "版块1 test1" without removing "版块1" from the task name.

@eudennis
Copy link
Owner

Yes, I'm aware of that. I was still thinking about how to handle that; I just wanted to be sure the main feature was working. I will still refine it.

@wsnjh007
Copy link
Author

Yes, I'm aware of that. I was still thinking about how to handle that; I just wanted to be sure the main feature was working. I will still refine it.

Come on👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants