Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support custom directories to watch when running mkdocs serve #2642
Support custom directories to watch when running mkdocs serve #2642
Changes from 4 commits
fc36d84
73905cc
c2f8baf
70dea7a
a7af6a1
77fe65c
c928f20
e6f1dff
7d6bffb
ac84ad8
676ec2d
c4e17ff
fcfa3be
348ff66
325ec0c
fef6af8
62ef55c
9d740af
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the path will have to be relativized to the location of
mkdocs.yml
, as here:mkdocs/mkdocs/config/config_options.py
Lines 369 to 370 in 9880767
Well, I think that's what would be the most logical as per what I've seen from MkDocs so far.
Feel free to argue otherwise.
This would probably require a new type in config_optons.py.
ListOfPaths
or something.During validation it could reuse
FilesystemObject
.I would recommend turning it non-abstract:
Relevant implementation example:
mkdocs/mkdocs/config/config_options.py
Line 494 in 9880767
Note that we probably should not check for existence of the path (
exists=False
should be kept). Not sure though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: we should, in fact, check for existence (just set
exists=True
), otherwise it throws anOSError
anyway after startupThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify why this is important:
mkdocs serve --config-file=subdir/mkdocs.yml -w bar
I want this to watch the
foo
that is adjacent tomkdocs.yml
.The difference in the output being:
(
-w
flag not relativized intentionally)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm leaving this to you btw.
And some tests for the new config option would be nice :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to be working :).
agree this needs some tests. i'll have that soon. might take a day or two to carve out some more time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit tests for
ListOfPaths
addedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll argue in favor of this 🙂
As a data point, see this mkdocstrings issue.
That
ListOfPaths
type could be very useful to resolve it!