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
Creating abstract base class BasePost. #2671
Conversation
@Kwpolska: so what's bad about refactoring the |
@felixfontein Overengineering. |
Do you really think that refactoring the |
I think that But perhaps the file-less posts could write to cc @remram44 |
Aside from the point that some other plugins might assume that Creating artificial post files in |
If you think supporting file-less posts is not something that Nikola wants to support, I totally understand. You are building on top of doit, and most people use files. I respect wanting to keep the codebase simple. I only requested #2659 because work on a PostScanner plugin had already been introduced in #1708, so I thought this was a direction you were considering -- after all, there is not much that can be done in terms of plugins if all you can do is readdir() a different directory. I am in no way blocked by #2659 personally. |
You can, but a post scanner is usually not enough to do it. For example, our Plugins site uses pkgindex_scan and pkgindex_compiler — the scan plugin creates Post elements from README.md files found in the filesystem, but then the scanner adds meta data from .plugin files and handles compiling those README files. I don’t think there is a hard dependency on |
Well, file-less posts are no problem even with doit, as long as you can efficiently create an The only way to implement something like this in Nikola is at the moment to completely rewriting the Actually, there's one trick which would simplify the procedure without creating an abstract base class: move all the file-specific methods of the constructor into a method called by the constructor. Then subclasses of I'd still prefer an abstract base class, though. And I still disagree that this is overengineering; the |
cfd953e
to
780939d
Compare
I think the principle of #1709 is sound but I'm not sure this is the right architectural direction. I'm on the fence about #2659. It seems to me, if we're going to break up Post, we should start by pulling out some of the complex functionality first, rather than starting by abstracting everything. Looking at |
First shot at #2659 and #1709. Tried to move everything which is not input file dependent into base class.