-
-
Notifications
You must be signed in to change notification settings - Fork 223
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 a way for third-party plugins to parse and modify Tasks #1389
Comments
Hi @davish, Wow, thank you for a very helpful message. There's a lot to take in there. I'm very keen to seen this happen, but It's unlikely something that I would work on on my own, as I would need to learn about the innards of a second plugin to be able to test it. Would you be willing to pair on this? (By which I mean, communicating verbally and screen sharing, rather than typing via GitHub) |
re: the alternative method, wouldn't this be quite slow for end users of Obsidian? To have the parsing logic be performed by both (or X) plugins? |
My general comment for this issue is: awesome idea! What I would personally like to see from the Tasks plugin is it becoming a database for user tasks. It is already such a database, but only the Tasks plugin has read access. Other plugins need to get read access too! |
I'd like to know what progress has been made on this issue? |
Sure. For what context? |
I am really uncomfortable with questions like this, as it feels to me like they are demanding why no progress has been recorded. I realise that this is probably not your intention, @BluBloos, but that's what it feels like, as someone with unpaid responsibility for all aspects of a project with many users requesting changes. If you were asking in order to offer help, I would say let's set up a pairing session to get you started, share what you would need to know for a successful PR in this area - and the details of what has happened so far. But in any case, define progress. I have spent many hours in discussion with other plugin developers. No actual development has yet has come out of this. Trying to find overlapping free time between pairs of people responsible for large open source projects in their free time, in different time zones, is difficult. There are a tiny number of PRs that make changes towards this direction, but they all expose the innards of Task class interfaces, which would tie my hands and prevent future refactoring and improving of the internals of the code, which would seriously hamper future development. So none have been accepted. Feel free to read the discussion in #1421 to get a flavour of the concerns. |
That does not seem correct at all in any case as a conception. Obsidian is the database. Tasks is one possible interface to those data. Nothing at all stopping anything else reading the raw data. |
Oooh. I like that. Also, on reflection, I really want to keep Tasks just focussed on - erm - tasks. I greatly underestimated how much of my time it would take up, when I took it over last May-ish. I could not agree any changes in scope that would increase the very significant user support workload nor the maintenance workload. |
Can I make a meta-suggestion @claremacrae - it sort of fits with this thread but could be moved elsewhere. It fits with my conception that you are getting stressed, and are wondering about correct allocation of time. My suggestion also addresses a host of others about formatting output (like "I hate icons") and also questions about interchange with other systems ("can you please read or write todo.txt type data") and the issues of concerns about being locked into a system (everything that markdown is not about). My suggestion is: a) Regard the current specification of the formatting of a task as fixed/finalised at least for the long-term future. You are not going to change that. Publish that specification formally. For example
Will spit out a csv file instead of the usual output using the function in (b) most of which will already be written d) Also have a reverse of the Function in (b) that takes a single csv type string and spits out a task in markdown format. This could be user modifiable - at least by a programmer (so if you want a due: instead of an icon, you can bloody well do that yourself). That would seem to open things up for quite a lot of stuff
|
I am so sorry for not being more clear! I asked what progress has been made thus far because I am about to step into a bout of work to make some forward movement. I asked pretty much just to make sure I wasn't wasting my time in case some substantial work has been done, and I took a completely different approach to whatever work was already done.
Any code that has been written.
I'll take a read! I'll leave with this. Please, please, please know that I wish to put no additional stress and work on you. I'm going to do this work regardless for the sake of linking with a plugin that I plan to write, and I just thought that if I was going to do it, sharing the work might potentially be useful. |
I understand this viewpoint. For what it's worth, I'll let you know what thoughts led me to make the statement that I did.
|
Oh wow - now I am feeling super guilty and super happy! There is far too much to talk about by typing in GitHub, and I would much rather brief you, and understand what you have in mind, before you do work on it... I do have a lot of notes about this, and a lot of info from other plugin developers... And also a little code in a personal fork of Tasks... My email address is in my GitHub profile - could we set up a chance to chat please?
🎉 🚀 That is tremendous. Very many thanks indeed! |
Hi @aubreyz,
Gosh, thank you very much for the care, and for the suggestion. Much appreciated. |
Hey guys, if I may, since the potential API scope is to access the tasks eg PS this is not to advertise dataview against Tasks. It is just that the described feature seems to be already implemented elsewhere. |
I have written up some thoughts on this in #1646 If discussion could go there for now, that would keep all the comments in one place. Thanks. |
Related: from the Tasks 2.0.0 release note: 🌟 Added new public API to retrieve markdown string for a new task via the 'Add or edit task' modal - thanks |
🔖 Feature description
I am a plugin developer and would like to allow users of my plugin who also use Tasks to be able to toggle events as completed from a custom view in my plugin. I've suggested one way to do this below with Obsidian events, but happy to discuss more about what the best way to do this is.
✔️ Solution
Some core plugins provide actions that 3rd-party plugins can trigger in order to perform actions that are normally handled by the core plugin. For example, the
Page preview
plugin exposes an eventhover-link
that lets other plugins trigger hover previews over any element. It is triggered with a call like so:New actions can be created by listening with
this.app.workspace.on()
.Tasks could provide an action that plugins would be able to call with something like:
There are other objects that implement the
Events
interface (see here), in case you think there's one that's a better fit for registering this thanapp.workspace
.There could also be another Event that gets triggered when the Cache gets updated, so that plugins listening to that Event can keep track of tasks without having to parse them themselves.
❓ Alternatives
An alternative way to allow other plugins to modify tasks is to factor out all of the Task parsing and printing code into a separate library published on NPM that can be included in the Tasks plugin as well as any other plugin that would like to modify tasks. This is the approach taken by [@]liamcain with obsidian-daily-notes-interface, which they use for Calendar to create and navigate between a user's daily notes.
Downsides of this alternative:
📝 Additional Context
I'm the developer of the Obsidian Full Calendar plugin which supports basic task lists, and am starting to investigate adding Tasks support to the plugin (obsidian-community/obsidian-full-calendar#219).
The text was updated successfully, but these errors were encountered: