Namespace-based Export Plugins #1310
Replies: 36 comments 37 replies
-
Thanks for bringing this up; I've also been wanting to get our plugins re-done. I'm still thinking through this, but here are my thoughts so far.
That's all I've got for now. Sorry it's disorganized, but I'm still mulling over all of it. |
Beta Was this translation helpful? Give feedback.
-
Oh, I forgot to mention pluggy. It looks like a very useful, lightweight library for managing this type of problem. We'd just have to design a spec for what we wanted, and it can handle pretty much the rest of it. |
Beta Was this translation helpful? Give feedback.
-
I'm kinda liking the approach of moving the plugin directory (so a user can just drop in their plugins independent of the jrnl core plugins). This would buy us some time to redesign the plugin system while not breaking backwards compatibility (for now). What do you think, @MinchinWeb? |
Beta Was this translation helpful? Give feedback.
-
Hey @wren ! I think your vision is fairly close to mine, so I'll start working on something! |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
still planning on making this happen! |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
not stale... |
Beta Was this translation helpful? Give feedback.
-
@MinchinWeb How's this going? Any progress? Is there anything we can help with? I'd love to get the solution we talked about in to jrnl soon, since it'll make it easier to make updates to the exporters without worrying about breaking them for users. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
not stale, still WIP |
Beta Was this translation helpful? Give feedback.
-
Oh, ha. It looks like stalebot is working again. It had gone down for a while and I honestly wasn't sure if they were ever going to fix it. |
Beta Was this translation helpful? Give feedback.
-
This code is currently in the merged PR in the
There's one more thing that I want to change, though it's not a showstopper: ideally, the feature file should be able to use a "Given" step to install and test plugins. When we start getting issues from plugin developers, this will make it a lot easier to prevent regressions. |
Beta Was this translation helpful? Give feedback.
-
Surprisingly no. Maybe this is because it's an explicit import? The one place you can't put it is in the
I suppose my logic was that by showing them that a version is defined, they'll know they need to provide one. But a guess someone new could draw either conclusion.
Do we also leave out the import paths? |
Beta Was this translation helpful? Give feedback.
-
Hi, @MinchinWeb! I just wanted to follow up on the status of this. I know there are some questions that I need to answer, so I wanted to be sure you have all the info from me you need. With that in mind, I wanted to say a few things. First, thank you for all the hard work on this feature. I know it's important to you, and it's good to see a contributor step up to add features they want to see. That being said, it looks like the plugins branch still needs some work before it's up to the quality I'd like to see in jrnl. Don't get me wrong; I don't want to minimize the progress, and I recognize there's already been a lot of work that's gone into it. It's just that it's a big project, and it requires a lot of hours of work. Speaking only for myself: this feature isn't at the top of my priority list. And as such, I feel like it's been taking up a bit too much of my time lately (I'd like to focus my efforts on fixing bugs that have piled up). That's not to say that I won't happily accept PRs to keep this moving, just that I won't be working on those PRs myself for now. For the items remaining, I think the PR comments so far should be clear in what tasks are remaining, but if there's any confusion whatsoever, please let me know and I'll do what I can to lay out a clear path to success. Thanks again, for all the hard work, and thank you for your understanding in this. |
Beta Was this translation helpful? Give feedback.
-
Hi @wren ; thanks for the update. The plugins got merged to a feature branch (see #1216), and so I lost my main point of tracking what was outstanding. I will try and add everything outstanding here, let me know if I've missed anything.
Is that everything, or have I missed something? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
MinchinWeb:
|
Beta Was this translation helpful? Give feedback.
-
From above:
|
Beta Was this translation helpful? Give feedback.
-
From above:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Tests:
|
Beta Was this translation helpful? Give feedback.
-
Sample plugins (from
|
Beta Was this translation helpful? Give feedback.
-
Hi, this looks awesome, and I love the idea of jrnl so far, as I want to move from Day One to something I have more control over and can run locally, but I think I would need more plugin support to do so. Is this feature for plugins still in active development? Is there anything another python developer could help with to finish this? Thank you for everything so far, jrnl looks great, and this feature looks great too from looking over the branch! |
Beta Was this translation helpful? Give feedback.
-
@jaxspades We haven't heard from the contributor that was working on this in a while, so my assumption is that it's no longer in active development. As for what a python dev can do to help finish this, the discussion above is basically a list of todo items that remain to finish this feature. The only todo item I would add is that it'll need to get the From what I remember, the work was almost done, and probably doesn't have that much left to do in it. If you decide start working on this, please feel free to ask any questions that come up. |
Beta Was this translation helpful? Give feedback.
-
I'm thinking about reworking the export plugin system to be auto-discovered based on the module name. Assuming this works well, it could be expanded to import plugins and possibly the storage backends as well.
There would be two namespaces: one for internal plugins, and another for external/contributed plugins.
The usecase would be to solve issues such as #779 where there is a difference of opinion of what the export should look like, or if you have a special format that you need. "Contributed" plugins could also be a way to test out a format before added in to the core of jrnl.
For myself, I have a "special" plugin that I used as a prep step to feed my jrnl entries into Pelican (a static site generator). It's always seemed like too "special" of a case to submit for the main repo, but it's something I use regularly. With the support and bug fixes to DayOne support, this is probably the only reason I have left to keep a private fork of jrnl.
In terms of implementation, I'm imagining that each plugin would have five methods:
["md", "markdown"]
; this is was will used by theexport
command of jrnl)I expect that contributed plugins would override the build-in plugins if they defined the same format code.
By using namespaced plugins, the plugin would be install-able via pip and would require no more configuration or activation beyond being importable by Python.
I haven't written any code yet (but I've been trying to figure out how to do this for probably 3 years...), but I wanted to get some thoughts on if there was support for this before I spend a bunch of time on it.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions