-
-
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
Allow build mkdocs outside root #5539
Allow build mkdocs outside root #5539
Conversation
Currently we are expecting that all mkdocs projects have their docs in their root, but we generate the artifacts relative to their yaml file, we do the same for sphinx. Fix readthedocs#5532 (comment)
Old mkdocs projects rely on an auto generated file for this. We write to this location some default values when we don't find one.
@@ -76,8 +76,6 @@ def get_yaml_config(self): | |||
self.project.checkout_path(self.version.slug), | |||
'mkdocs.yml', | |||
) | |||
if not os.path.exists(mkdoc_path): | |||
return None |
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.
This was removed to keep compatibility (see the 2nd commit message)
@@ -112,9 +110,6 @@ def append_conf(self, **__): | |||
:raises: ``MkDocsYAMLParseError`` if failed due to known type errors | |||
(i.e. expecting a list and a string is found). | |||
""" | |||
if not self.yaml_file: | |||
self.yaml_file = os.path.join(self.root_path, 'mkdocs.yml') | |||
|
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.
This is already handled above
And we check for not existing files here
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.
Makes sense. 👍
Currently we are expecting that all mkdocs projects have their docs in
their root, but we generate the artifacts relative to their yaml file,
we do the same for sphinx.
https://github.com/rtfd/readthedocs.org/blob/d8a6c24013b7089074b302e7c04edd7998fe90ce/readthedocs/doc_builder/backends/sphinx.py#L42-L51
Fix #5532 (comment)
Closes #5559