-
Notifications
You must be signed in to change notification settings - Fork 33
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
Handle plugin generated content and config #79
Handle plugin generated content and config #79
Conversation
96342cb
to
1e3502a
Compare
@lukasgeiter This is ready to review. The je ne sais quoi is boiled down to:
|
And to report, this is working as expected on my project 🎉 |
Thanks for creating this PR! Before I dive into reviewing, I've noticed some formatting changes that shouldn't be there. Please make sure to format the files using black. |
Please disregard the failing tests for pypy, they have nothing to do with your PR. I've actually just removed them on |
Thanks for taking a look! Yeah looks like editor ran black with a different line length (shorter) leading to some spurious reformats. I'll fix those |
@lukasgeiter All tests are passing! Ready for review when you are. |
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.
Great work! I especially appreciate the added test cases ❤️
@lukasgeiter I think that should cover those comments. Happy for another look |
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.
Almost there now 😅
Released with version 2.9.2. Thanks again for your work! |
Thank you for accepting it, and reviewing it |
This change allows
mkdocs-awesome-pages-plugin
to play nicely withmkdocs-gen-files
, specifically with generated content (.md
) and generated config (.pages
).This is accomplished by:
on_files
in the plugin that synthesizes aFile
per config in the docs dir. This means we can later unconditionally pull fromFiles
for both in-docs and generated configs.Files
down the chain toNavigationMeta
Files
to validate the "out-of-docs" check, so we also remove thedocs_dir
arg_gather_metadata
operate on a "relative file" abstraction (e.g. the path below "docs_dir)Page
s, that means addingitem.file.src_path
instead ofitem.file.abs_src_path
Meta.try_load_from
withMeta.try_load_from_files
such that we always load fromFiles
path
attribute with the relative pathThat summarizes the package changes, then there was a few test changes top facilitate this change:
docs_dir
tofiles
test_meta.py
changes for the correctFiles
lookup, and new methodmkdocs-gen-files
Fixes #78