Repository navigation
Adds cache of pages when live reloading is enabled - #971
aeslaughter wants to merge 1 commit into
Conversation
|
This is interesting, but I do have a few questions/concerns. The Regardless, any time there is any change to any global template variables (including the nav), then all pages need to be rebuilt. For example, one page has its title changed. That title is displayed in the nav on every page, so every page needs to be rebuilt. So are we willing to forego consistency across pages for slightly quicker builds when using the dev server? I expect different people will give different answers to that question. I suppose leaving to the user to decide makes sense. Although, I think the default should stay as-is. Still, I doubt we want to maintain 2 different code paths for accomplishing the same thing. If this gives us something better than not disabling |
|
@aeslaughter Did you intend to close this? I support making MkDocs faster, that would be a great thing. I think generally it is fast enough for most users, but there will always be some larger projects that have trouble.
The default approach is the worst implementation of a cache, as it only caches stale artefacts. Every page is rebuild and overwrites the existing pages. So there is no speed boost. Honestly, the fact that I would like to see a smarter cache be explored, perhaps there is a way we can cover enough of the edge cases to make it okay. Ideally something like this would be best done as a plugin, then we can have as many opinionated caches as people like, but that is obviously tricky at the moment. |
I suspected as much (never really dug into that part of the code). And that is why I added my last paragraph above. We may actually be able to use this with some modifications. |
|
@d0ugal I did close this on purpose, it failed all sorts of tests. So, as I expected it is far more involved than what I need at the moment. It is something I may come back to in the future, but for now this works for my basic use case. It is also not a critical component to what I am trying to do. As far as the use goes, I understand that all links and such will not be correct, but for what I (and those who will be using our tool) need this quick reload is useful. People will be writing snippets of markdown that explain physics equations (lots of latex math), these snippets are then automatically placed into a larger markdown file that contains auto generated syntax for a framework. It is really nice to have the markdown you are writing show up live, using the same parser as it will be deployed with, but waiting for all the pages to be created. The purpose of all this is to have a single source documentation channel, where the markdown may be converted to a website (mkdocs), slides (Reveal.js), or pdf (to-be-determined). |
|
On more comment, perhaps fixing up something similar to what I have here and calling it |
|
For anyone following this discussion, it has been picked up and continued in the open issue at #990. |
Based on my past success trying to contribute enhancements, this probably won't go well 😄 , but I will try anyway.
This caches
Pageobjects enabling livereload to much more efficient, which is nice when you have a large project.This is in response to: https://groups.google.com/forum/#!topic/mkdocs/UaukffzOZMQ