-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[WIP] Plugin Experiment #336
Conversation
To make it easier to integrate plugins into configuration and the rendering process, it may be a good idea to break the
I feel like For example a @azerupi, what are your thoughts? After next Wednesday I've got a month or two off uni, so I'll have plenty of time to work on this. |
This is very exciting!
That is a correct assessment 😉
I think so too, plugins would probably need most of the other changes to work.
Absolutely, I didn't start with the idea of having multiple renderers. We need to progressively decouple the html renderer so that it is completely isolated. But I think it not going to be a quick fix. 😋 And renderers should know what resources they need, mdBook should only tie everything together, like you say. I am very very interested in this! So if you want to take on the work, I can only encourage you! I'm open for discussions and questions. Feel free to make new issues when you want to discuss a certain topic. |
It's an achievement in itself that Because this will largely be a structural change with me mainly rearranging existing code, I thought I might approach the task by creating an empty sub-crate (arbitrarily named So far I've copied across the summary parsing and set up a lot of the base types ( |
Seems like a sensible approach :)
That's awesome, a lot of things are untested right now and it sometimes comes back to bite us. So adding more tests is already a big improvement in itself! 😊 |
I was thinking about this as well. I don't really want to do the entire refactoring in a single pull request because a lot of stuff will be moved around and it'll probably end up with a 6000-odd line diff. Plus if I'm incrementally moving things across then other people can help out, I can use the issue tracker, and it'll help to break the task down into manageable chunks. What are your thoughts on merging an initial implementation that's pretty much just a skeleton with a bunch of stubbed out types and Also, after we find some nice way of laying things out, what are your thoughts on asking for help in the Call for Participation thread in the forums? We could easily make a bunch of easy issues along the lines of "copy X to mdbook-core and make sure everything compiles", which would be nice as an easy first PR. |
@azerupi, when you have a spare couple minutes, would you be able to have a look at what I've done so far? The easiest way will probably be to clone my fork ( |
I will check it out in the next couple of days. I still have a big project that is due Wednesday for uni, but I should be able to take some time to check out your changes. Stay tuned!
Sure I'm ok with that. So if I understand correctly, we would keep the current mdbook crate and continue parallel development in the mdbook-core crate? If we do this, I think mdbook should relatively rapidly remove some of its components and use the core as soon as possible in order to avoid diverging too much. If people continue to fix issues and contribute features we don't want to have to back-port everything constantly. What do you think?
Definitely, I have made changes to the repo recently to make it more contributor friendly. I am always happy to mentor and help others contribute. :) |
I was worried about this too. After thinking a bit more about this I'm not sure my I'll still keep my
Haha, turns out my comment at the very start of this PR was pretty accurate! It did give me a much better understanding of the task on hand and how |
Perfect, let's do that :) |
I thought I'd play around with the concept of plugins (#163) in a private fork to see how something like this could look.
I doubt anything from this PR will end up in master, but it'll give us a more informed idea for what works, what doesn't work, how much effort could be involved in implementing it properly, etc.
Note: I've started this branch on top of #335 because I needed some of the refactorings done there. I'm not sure if this is a no-no in terms of git branching and all that, so let me know if I need to fix any history.