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

Version warning doesn't work with Material theme for MkDocs #7810

Closed
reginapizza opened this issue Jan 8, 2021 · 4 comments
Closed

Version warning doesn't work with Material theme for MkDocs #7810

reginapizza opened this issue Jan 8, 2021 · 4 comments
Labels
Support Support question

Comments

@reginapizza
Copy link

Details

Expected Result

I'm trying to have version warning labels set up for branches that are not stable nor latest (aka, one of my branches called 'regina-dev') . I'm using material theme for MkDocs. I went to Advanced Settings and checked the box for show version warning. I thought that this would give me a warning label somewhere on the page when I switched to my regina-dev branch in the version selector but it does not. When I go to other sites using RTD and switch older versions, I can see the version warning displayed, but I haven't seen one that does it with Material theme.

Actual Result

No version warning appears.

Is this just a limitation of the Material theme with MkDocs + RTD or am I just setting this up wrong? I've been able to implement this with mike versioning, as shown in a PR here for anyone interested, but my team would prefer to use RTD instead of mike because we prefer a service over a tool and have concerns about the maturity and upkeep with mike. Please let me know if this is possible or if you know of anyone who's gotten something like this to work... much appreciated and thanks for a great product!

@stsewd
Copy link
Member

stsewd commented Jan 11, 2021

Hi @reginapizza, I think this is because your version name is regina-dev, so rtd doesn't know how to compare that version with the latest one. If you enable other version like v0.2.2, the banner should appear.

@stsewd stsewd added the Support Support question label Jan 11, 2021
@stsewd
Copy link
Member

stsewd commented Jan 13, 2021

So, I just remembered that the banner is only available for sphinx projects, sorry https://github.com/readthedocs/readthedocs-sphinx-ext/blob/master/readthedocs_ext/versionwarning.py.

Probably we should update the documentation.

@stsewd stsewd closed this as completed Jan 13, 2021
@reginapizza
Copy link
Author

Ah, that's too bad. Thanks for your help!

@stsewd
Copy link
Member

stsewd commented Apr 8, 2021

So, I just remembered that the banner is only available for sphinx projects, sorry https://github.com/readthedocs/readthedocs-sphinx-ext/blob/master/readthedocs_ext/versionwarning.py.

I was changing this code and realized I lied here... We don't use that extension, so it works for mkdocs and sphinx, but it requires jquery and a div with a body or document class (but we are going to change that to allow role=main or a <main> tag as well. #8079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

2 participants