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

Empty or non-defined extra_css generates warning #1335

Closed
kcgthb opened this issue Oct 31, 2017 · 2 comments
Closed

Empty or non-defined extra_css generates warning #1335

kcgthb opened this issue Oct 31, 2017 · 2 comments

Comments

@kcgthb
Copy link

kcgthb commented Oct 31, 2017

I have a bit of css files in my project that I don't want to include in extra_css.

With 0.17, even if I define empty lists in mkdocs.yml, I get a warning that makes --strict building fail.

For instance, with this in mkdocs.yml

extra_css:
  - ' '

I get:

$ mkdocs build --strict
WARNING -  Config value: 'extra_css'. Warning: Some files in your 'docs_dir' are not listed in the 'extra_css' config setting and will be ignored by the theme. Add the following files to the 'extra_css' config setting if you want them to have an effect on the theme: ['file.css']

Aborted with 1 Configuration Warning in 'strict' mode!

The exact same thing happens if I remove the extra_css part from mkdocs.yml.

Is there a way to build in strict mode while making sure that extra CSS files are not added to the project?

@waylan
Copy link
Member

waylan commented Nov 1, 2017

No, not at this time, although, that should be temporary. Prior to this release, all CSS files in your docs_dir were automatically added to extra_css if the setting was empty. During the transition, we are issuing a warning for those users who now need to add a list of files to the setting. I expect the warning will be downgraded to an "info" message in the future.

@kcgthb
Copy link
Author

kcgthb commented Nov 1, 2017

All right, thanks for the clarification. I guess I'll build without --strict for now.

waylan added a commit to waylan/mkdocs that referenced this issue Nov 1, 2017
The warning for missing files should only be issued if the config
setting is empty. The warning only exists because we disabled
autopopulating of the settings. Autopopulating only used to run
when the setting was empty so the warning is not nessecary if
the setting has been populated.

Given the above, no string comparisons need to be made as we
only need to check if any files exist when empty. Therefore, we
don't actually need to normalize paths. As we are no longer
modifying users' strings, they can again put any string in their
config, such as URLs of CDNs.

Fixes mkdocs#1335 & mkdocs#1336.
waylan added a commit that referenced this issue Nov 1, 2017
The warning for missing files should only be issued if the config
setting is empty. The warning only exists because we disabled
autopopulating of the settings. Autopopulating only used to run
when the setting was empty so the warning is not nessecary if
the setting has been populated.

Given the above, no string comparisons need to be made as we
only need to check if any files exist when empty. Therefore, we
don't actually need to normalize paths. As we are no longer
modifying users' strings, they can again put any string in their
config, such as URLs of CDNs.

Fixes #1335 & #1336.
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

No branches or pull requests

2 participants