Skip to content
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

Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Mar 26, 2019

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

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)
@stsewd stsewd added the PR: work in progress Pull request is not ready for full review label Mar 26, 2019
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
Copy link
Member Author

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')

Copy link
Member Author

@stsewd stsewd Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stsewd stsewd removed the PR: work in progress Pull request is not ready for full review label Mar 27, 2019
@stsewd stsewd requested a review from a team March 27, 2019 00:28
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. 👍

@ericholscher ericholscher merged commit d53eb2f into readthedocs:master Apr 3, 2019
@stsewd stsewd deleted the allow-build-mkdocs-outside-root branch April 3, 2019 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants