wesmoncrief / obsidian-todoist-text

MIT License
56 stars 5 forks source link

Support custom task string rendering #5

Open wesmoncrief opened 2 years ago

wesmoncrief commented 2 years ago

for example, it might want to include the project name, or the due date, or labels

wesmoncrief commented 2 years ago

Probably want the settings pane to have some kind of template string, e.g.

- [ ] $$taskName$$ -- $$taskPriority$$ -- $$taskSourceUrl$$
    - $$description$$
ArneNostitz commented 1 year ago

this would be great!

having the possibility to have project names would be a game changer!

wesmoncrief commented 1 year ago

the possibility to have project names

So you'd benefit from having formatting like:

- [ ] $taskName$ - $projectName$ - $taskSource$ 

?

Can you share why that's helpful? I might have expected the common workflow to be more like:

# myProject1
@@queryForMyProject1@@

# myProject2
@@queryForMyProject2@@
ArneNostitz commented 1 year ago

it would be great to format it ... (getting rid of priority for example :) ) and I have some 100 projects (i really extensivly used this also to store info and bucket lists and things to read etc for the past few years .... but i am 100% in obsidian now and canceled my subscription already :) )

so an import of all of that with one replace per project is somehow taking really long. i thought of this option with the projectname in the task more like a workaround ... but yes!!! if there would be a version of "view all, structure by project" and have "# ProjectName" and "## Section Name" as dividers between the tasks would be even better

wesmoncrief commented 1 year ago

I see, so you just need to do this as a one-time operation, right? you don't want to do the full import from every project on a recurring basis.

But yeah it sounds like fundamentally, you need a file that looks like

# myProjectName
@@todoistTextQueryForMyProjectName@@

etc

and you also need to update the settings for this plugin to have a mapping from each @@todoistTextQueryForMyProjectName@@ to the appropriate filter (e.g. #MyProjectName).

Seems like a good ten minutes of mindless copy/pasting.

Or, if you have any basic programming skills, you could probably try writing a very simple script to get all of your project names exported from todoist - https://developer.todoist.com/rest/v2/#projects

Then, you could use excel (or some other scripting logic) to translate that list of project names into the filters part of the settings file for this plugin (which is stored in your vault under .plugins)

ArneNostitz commented 1 year ago

thanks for the tipp - i did a backup from todoist to get all the csv with names of all projects - i copied them in finder and pasted it into VS code - easy to get all the names this way. then with multiline edit i put it in the correct format for your plugin and pasted it into the plugins file. that worked flawless and was done in about 5 mins... great!

but its sadly not working - throwing errors

Screenshot 2023-01-16 at 16 01 25

tried with #projectname and ##projectname - but sadly no luck

wesmoncrief commented 1 year ago

Hmm, can you upload the text for your settings file? Be sure to hide your access token. Also maybe include a screenshot of your network tab in the obsidian debugger to see if it's sending an http request to todoist at all.

On Mon, Jan 16, 2023 at 10:01 AM ArneNostitz @.***> wrote:

thanks for the tipp - i did a backup from todoist to get all the csv with names of all projects - i copied them in finder and pasted it into VS code

  • easy to get all the names this way. then with multiline edit i put it in the correct format for your plugin and pasted it into the plugins file. that worked flawless and was done in about 5 mins... great!

but its sadly not working - throwing errors

[image: Screenshot 2023-01-16 at 16 01 25] https://user-images.githubusercontent.com/16592596/212708495-1e9137fc-9ded-4b47-ad11-67b31f33c96e.png

— Reply to this email directly, view it on GitHub https://github.com/wesmoncrief/obsidian-todoist-text/issues/5#issuecomment-1384184835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEA74N2HSU4XFLSTJ7WGCFLWSVPF3ANCNFSM5OTIQHVA . You are receiving this because you authored the thread.Message ID: @.***>

ArneNostitz commented 1 year ago

{ "settingsVersion": 2, "excludedDirectories": [], "keywordToTodoistQuery": [ { "keyword": "@@TODOIST@@", "todoistQuery": "today|overdue" }, { "keyword": "@@copy@@", "todoistQuery": "#inbox" }, { "keyword": "@@Ad Companies agencies Production@@", "todoistQuery": "##Ad Companies / agencies Production" }, { "keyword": "@@ADA@@", "todoistQuery": "##ADA" }, { "keyword": "@@Alexa Shopping List@@", "todoistQuery": "##Alexa Shopping List" }, { "keyword": "@@Alexa To-do List@@", "todoistQuery": "##Alexa To-do List" }, { "keyword": "@@AR - Bad Ischl@@", "todoistQuery": "##AR - Bad Ischl" }, { "keyword": "@@AR Garden@@", "todoistQuery": "##AR Garden" }, { "keyword": "@@AR Stolpersteine@@", "todoistQuery": "##AR Stolpersteine" }, { "keyword": "@@AR-VR@@", "todoistQuery": "##AR-VR" }, { "keyword": "@@Brühl@@", "todoistQuery": "##Brühl" }, { "keyword": "@@Bucketlist@@", "todoistQuery": "##Bucketlist" }, { "keyword": "@@Bucketlist mit Lena@@", "todoistQuery": "##Bucketlist mit Lena" }, { "keyword": "@@buy@@", "todoistQuery": "##buy" }, { "keyword": "@@Drehorte Locations@@", "todoistQuery": "##Drehorte Locations" }, { "keyword": "@@eat@@", "todoistQuery": "##eat" }, { "keyword": "@@Einreichungen@@", "todoistQuery": "##Einreichungen" }, { "keyword": "@@films i like@@", "todoistQuery": "##films i like" }, { "keyword": "@@Förderungen@@", "todoistQuery": "##Förderungen" }, { "keyword": "@@Inbo@@", "todoistQuery": "##Inbo" }, { "keyword": "@@interesting-stuff@@", "todoistQuery": "##interesting-stuff" }, { "keyword": "@@Künstlertreff@@", "todoistQuery": "##Künstlertreff" }, { "keyword": "@@lena-geschenke@@", "todoistQuery": "##lena-geschenke" }, { "keyword": "@@lena-spanish@@", "todoistQuery": "##lena-spanish" }, { "keyword": "@@PANCC@@", "todoistQuery": "##PANCC" }, { "keyword": "@@Private@@", "todoistQuery": "##Private" }, { "keyword": "@@Projects@@", "todoistQuery": "##Projects" }, { "keyword": "@@read@@", "todoistQuery": "##read" }, { "keyword": "@@research@@", "todoistQuery": "##research" }, { "keyword": "@@Resight Competition@@", "todoistQuery": "##Resight Competition" }, { "keyword": "@@ROAR@@", "todoistQuery": "##ROAR" }, { "keyword": "@@SC - Förderungen@@", "todoistQuery": "##SC - Förderungen" }, { "keyword": "@@Self Development@@", "todoistQuery": "##Self Development" }, { "keyword": "@@SocialCard@@", "todoistQuery": "##SocialCard" }, { "keyword": "@@Sonstiges@@", "todoistQuery": "##Sonstiges" }, { "keyword": "@@Spanische Hofreitschule@@", "todoistQuery": "##Spanische Hofreitschule" }, { "keyword": "@@teneriffa-mit-lena@@", "todoistQuery": "##teneriffa-mit-lena" }, { "keyword": "@@VBW Ronacher@@", "todoistQuery": "##VBW Ronacher" }, { "keyword": "@@watch@@", "todoistQuery": "##watch" } ], "authToken": "", "enableAutomaticReplacement": false, "showSubtasks": true }

ArneNostitz commented 1 year ago

apparently there was some hickup with the api? i tried a few times more with a shortened list ... sometimes with error ... then suddenly it worked

ArneNostitz commented 1 year ago
Screenshot 2023-01-16 at 18 10 46
wesmoncrief commented 1 year ago

nice! 429 error is too many requests - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 - so makes sense that it doing it with shorter lists would help. Glad it worked!

wesmoncrief commented 1 year ago

could be a future improvement to have this plugin do batching or exponential backoff to avoid 429s

ArneNostitz commented 1 year ago

great! also there are apparently some breaking characters like "/" or german "öäü"s

commentaries also dont get transported over. and sections are missing too. also sorting is different ...

i guess alot to do :) but i did get through my single sync and did archive all todoist projects for now

thanks man! did help a lot!

skullbunnygalaxy commented 1 year ago

I too would love to be able to format how the text is populated, including removing priority.