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

Only the new cache_safe_extras option, with tests #20

Merged
merged 5 commits into from
Oct 20, 2022
Merged

Only the new cache_safe_extras option, with tests #20

merged 5 commits into from
Oct 20, 2022

Conversation

kamilkrzyskow
Copy link
Contributor

@kamilkrzyskow kamilkrzyskow commented Oct 20, 2022

Hi, 👋
as discussed in #19, I'm splitting the PR into multiple ones.

This PR adds the new option and a version bump. I preserved the structure and most of the code from the previous branch HEAD, so it's easier to see what was added and where for this option alone.
Apart from the option, tests were added to make sure that the old code works the same way and the new code works properly. I might remove the old tests in the future, as they are redundant currently, but kept them for now to limit the amount of removals in this PR.

I'll make more changes in another PR later.

@kamilkrzyskow
Copy link
Contributor Author

Sorry for the forced push, I forgot to git add the new .yml files for the tests, so I decided to revert and fix it, to keep it in 1 commit.

@wilhelmer
Copy link
Collaborator

Thanks for your efforts, looks good to me! I think that we should find a better name for the option though.

We never call the minified files "extra" files. I know there's extra_javascript and extra_css in MkDocs, but we don't process these lists directly. Instead, the files must be listed seperately in js_files and css_files (which is useful IMHO, because you might not want all extra files to be minified, or you want to minify files that are generated by other plugins or scripts).

So cache_safe_extras could be a bit misleading; users could assume that all entries in extra_xy were hashed, which is not the case.

Suggestion: cache_safe

@kamilkrzyskow
Copy link
Contributor Author

@wilhelmer
If the files aren't in the extra_ list then they won't be added to the html 🤔, and are ultimately useless, because they won't get linked to the page at all. However, I agree that the _extra could confuse the user and make them think they don't need to add any extra_ entries apart from the internal list.

@wilhelmer
Copy link
Collaborator

Yes, the minified files are a subset of the extra files, so you could say they are still extra files. Nevertheless, I think it's better to distinguish between the two in terminology.

I'll wait for the other PR and merge both if everything looks good. Thanks again for your contribution.

@kamilkrzyskow kamilkrzyskow mentioned this pull request Oct 20, 2022
@wilhelmer wilhelmer merged commit 15bd08b into byrnereese:master Oct 20, 2022
@kamilkrzyskow kamilkrzyskow deleted the cache-safe-extras-only branch October 21, 2022 10:47
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.

2 participants