Skip to content

Incremental file building when --dirtyreload is set #441

@jkaye2012

Description

@jkaye2012

Hey there,

I've been playing around with this plugin recently and have noticed some significant performance issues related to live reloading. The performance of the plugin is perfectly acceptable for a single documentation build, but it appears that any file change while this plugin is active leads the plugin to rebuild all files that it's watching.

I've played around with the code a bit, and I think it's relatively easy to:

  • Know when the user has --dirtyreload set (from the MkDocsConfiguration)
  • Track the most recent build that mkdocs-simple performed (e.g., using a global within plugin.py, although there may be a better way to do this)
  • Filter the list of files that will be operated on by the plugin in both merge_docs and build_docs in simple.py

The one thing I haven't been able to figure out is something that's going on under the hood leading to this error (during the build step):

[Errno 2] No such file or directory: <file that was not changed>

So it seems like something is expecting this file to be output, but I haven't been able to tell what.

Given this, two questions for you:

  1. If we can figure out how to make this work, would you be willing to merge a change like this assuming I can make it reasonable
  2. If so, could you please point me in the right direction to complete this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions