-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
projects
plugin sub-project watcher for "external" files
#6945
Comments
Thanks for suggesting!
Sorry, but could you please create a reproduction that does not require us to install some external dependencies. We can only evaluate this, if we don't need to add additional dependencies to our systems. I hope for your understanding. Ideally create a much more minimal reproduction, which will make it easier to isolate the things we need to change in order to add support for the feature you requested. |
Actually yea, that ended up being a lot easier than I thought it would be... The setup steps are the same, but now instead of editing |
Thanks for the reproduction. Indeed, a file change is detected, but since the file is located in the top-level project, only the top-level is rebuilt, since the subproject is not considered tainted, which is correct (read on to understand why). This is also why saving the project-level watch:
- ../../gen_doc_stubs.py This is not a bug in the projects plugin. To make this work "automagically", the projects plugin would either need to rebuild everything on every change (and defeat its purpose) or try to understand what parts of If this does not solve your original case, please provide more information and create another reproduction. Until then, we're considering this issue resolved by configuration. Tip: you can run the projects plugin with the following settings to get more verbose output of a specific project: plugins:
- projects:
log_level: debug |
Ahhh that makes a lot sense. In the full application I was indeed able move the |
Context
Description
As per the related discussion, I'm creating this as a feature request so that ideally the projects plugin can be compatible with
mkdocs-gen-files
.An example reproduction of this behavior can be seen in mkdocs-testing.zip.
NOTE: This does require https://crystal-lang.org/install/ as it is needed on path in order to generate the intermediary documentation format used by
mkdocstrings-crystal
.python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
mkdocs serve
From here navigate to the
My App
project in the nav. And notice you see the docs forclass Athena::Foo
, along with the#bar
method. If you were to go and editprojects/my_app/src/test.cr
to remove thefdgfdgfddfg
from line 2 and save, you will see it triggers the following, with the browser reloading:However you'll notice
fdgfdgfddfg
is still a part of the docs.Now if you open your editor to
projects/my_app/mkdocs.yml
and save that file you'll see when the browser reloads that it now properly reflects your changes inprojects/my_app/src/test.cr
with the following output:The same behavior can be seen if you were to add and edit new doc files within
projects/my_app/docs
as well. So it seems to me the file watcher events watchingdocs/
andmkdocs.yml
is different than event of "external" files. I.e. non-mkdocs files added to https://www.mkdocs.org/user-guide/configuration/#watch.Related links
Use Cases
This would make it easier to work on API docs generated from language source code files. Which ultimately provides a good ecosystem to use contextual mkdoc docs along side API docs from the source code.
Visuals
No response
Before submitting
The text was updated successfully, but these errors were encountered: