-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
MkDocs builds: allow to use MkDocs own themes #978
Comments
At present the theme is hard-coded: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/backends/mkdocs.py#L147 |
👍 |
The main reason is because the default mkdocs themes don't have blocks defined, which means we can't override any of the templates. This makes it hard for us to inject some of the page-level context that lets us provide RTD features on top. It's something that we need to get into upstream mkdocs before we can really support it on RTD. |
In the meantime, I think it would be good to add to the FAQ that custom themes aren't currently supported when using It wasn't clear to me that custom themes weren't supported until I found this issue. |
Agreed with @cjerdonek : I was surprised when my locally-built mkdocs website used the theme I wanted, and that the version on RTD didn't reflect this. Not a major issue, but would be fantastic if they could be implemented, or that a note be made somewhere. Thanks ! |
Same issue for me. Still not documented. |
Adding a note here probably makes most sense: https://github.com/rtfd/readthedocs.org/blob/master/docs/getting_started.rst AFAICT, this is the only part of the docs that covers MkDocs. |
👍 |
@ericholscher What blocks are needed? It would be good if we could define this somewhere, somehow. I'd be then happy to make sure MkDocs conforms to this. |
From what I can tell, the only blocks required are for search integration and the the version switcher thing. |
Definitely would love to see some progress here. I guess things become even more complicated once the MkDocs themes are only available as part of http://mkdocs.github.io/mkdocs-bootswatch/ anymore. |
Not really, that won't complicate anything I don't think. |
Don't want to take this issue OT but wouldn't RTD have to make mkdocs-bootswatch available on their infrastructure in addition to MkDocs? |
Users can specify any arbitrary Python packages they want with RTD. If this only allowed MkDocs supported themes it wouldn't be worth the effort :) |
This reverts commit b597296. Turned out readthedocs doesn't support changing mkdocs's theme. More info here - readthedocs/readthedocs.org#978
Apologies, but I am a bit unclear as to the status of this issue. Is there still work required on MkDocs's side (to define the aforementioned blocks), or we "just" need to make RTD's MkDocs builder check the theme specified in |
@tatablack I believe the work is just needed on the RTD side. It is true that MkDocs could possibly not integrate well if they don't match up with RTD's expectations (but I think this is also true with custom Sphinx themes).
It's actually simpler than that. At the moment RTD overwrites whatever theme users specify, to enable other themes RTD just needs to stop overwriting this setting. |
Thanks, @d0ugal. I just opened a PR (with an admittedly simplistic solution), let's see how it goes. |
What's the status of RTD being able to support custom themes? Would the RTD features, such as the doc flyout be implemented on custom themes? As it stands, we're opposed to allowing custom themes on mkdocs projects on RTD. The user experience is degraded without the RTD additions to documentation, and to allow custom themes would only further dilute our efforts to a cohesive user experience. I agree custom themes on Sphinx leads to the same effect, a degraded user experience. I'd much rather a common interface to documentation across projects. At least with Sphinx we have the ability to control parts of the templating process to allow for injection across all themes. |
@agjohnson, I agree with the label you put on PR #2188 (
|
A little bit strange issue - it's about 2 years but I suppose there is no real understanding what are requirements to be a RTD theme. What should be in MkDocs theme to make it equal to custom Sphinx theme? If you will decide to shutdown custom themes at all - OK. But while it's allowed it looks like there is no reason to limit MarkDown writers this way in comparison of Sphinx writers. |
¿Whats the status of this issue? |
As I mentioned in #2188 -- we've decided not to support this, for the reasons listed there. |
Is it possible to use native MkDocs themes in the RTD builds? If not, it would be a valuable addition.
Here is what I'm trying to achieve. I'm trying to setup RTD build for a GitHub project that uses mkdocs: https://readthedocs.org/projects/devtools-course-practice-mkdocs/. This is just an experiment, but it seems that the current level of mkdocs support by RTD is very limited (making it almost useless):
theme: mkdocs
in mymkdocs.yml
, but it doesn't work.So, it seems that MkDocs support is very experimental today, and RTD is still primarily targeted for Sphinx projects. But what are the plans in this direction? Are you going to support native mkdocs themes?
The text was updated successfully, but these errors were encountered: