-
Notifications
You must be signed in to change notification settings - Fork 322
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
Create version selection menu as a configuration option #372
Comments
Thank you for starting this FR! I have actually been wanting to bring this up myself and am willing to assist if needed. A few weeks ago I got this working with furo on a recent project by using the sphinx-multiversion plugin and replacing the ethical-ads section of the sidebar with the versions list. I was planning on opening up an issue/PR here to create a new empty sidebar section that the users could replace for this purpose but I like your approach of setting this feature up properly much better. Unfortunately(?) this implementation does require that each of the documentation versions to be included have to be built at the same time because the docs are monolithic - you can't build one version at a time and then show a dynamic list of versions based on what versions are deployed to your docs server, you just have to replace the entire docroot for that project. For me it's not a huge deal but there is no language selector either so I'm not sure how useful this would be as a jumping off point. I can provide info on how to duplicate this setup shortly in case it would help though. Would you think that all of the selected versions should be built at once as a standalone bundle or should each version be able to be built independently and then cobbled together somehow? It's been a long time since I've used RTD because most of my work has been private, I'm not sure how they handle it. |
OK I posted an example of how to build furo's own docs with this method here for you to check out. The biggest immediate issue I can see is that I'm not sure if we can pass arguments to sphinx via multiversion which means the builds are not in |
No need to apologize -- this is definitionally a "trackable task", which is why I asked you to file it. :)
That's neat! Using an existing plugin is a good idea. Doing this using VCS as a source of truth is a neat idea. I'll let others chip in whether that'll work for them. That said, I don't think a dump of all the links to all the versions as-is, is a particularly nice UI. :) One thing that works nicely with this idea, is that the implementation complexity of handling such systems can be moved into that plugin (or a different one, that behaves differently but provides the same HTML template variables). That's something that I like, because it means that Furo doesn't need to provide any direct coonfiguration knobs to control what "versions" in your documentation look like, deferring that to the Sphinx extension that's gathering the version information.
I don't think we should add a configuration option for "off/on" -- I'd strongly prefer that this behave something like "oh, you've provided version information, lemme include that in the pages". In other words, users who use whatever mechanism we end up with, for providing multiple versions, should not need to also set something like |
1e38428 puts the Read the Docs embed in that location as well! |
FWIW, here's where you can see the "new" Read the Docs variant selector styling: https://furo.readthedocs.io/ (scroll past the announcement) I think the thing to do would be to update |
Yeah, I would love it we could have a layout similar to the latest RTD theme. I'm not at all good at UX design, I just wanted to show a simple functional example of multiversion integration. |
Thanks @pradyunsg and @raddessi for your great comments so far! I'm definitely following this thread and will share it with this team. Keep the discussion going! |
What's the next steps here, who's doing what? :) If just baking in support for sphinx-multiversion will make people happy, then this is a fairly simple change:
Another thing I like about this is that if people want to have a different strategy for providing these context variables to Furo, they're welcome to write their own logic for generating those context variables in a Sphinx extension; allowing for custom workflows on that front as well. |
The engineers from our team that are likely to do this work will be s0undt3ch and/or waynew, but be aware we won't likely do this work until May. That's the timing I've gotten approval for. Would you like me to arrange a meeting at all, @pradyunsg ? What would be best for us to collaborate? |
Fwiw, I will send up a PR up to the I'm not trying to imply that multiversion has been chosen as the route to go down, I just want to get the feature added ahead of time in case we do use it for this. |
@pradyunsg building in support for sphinx-multiversion would certainly work for me. It would also be nice if there was built-in support for admonitions/notices that the currently-viewed version is not released or not current (like on RTD, e.g. https://sphinx-rtd-theme.readthedocs.io/en/1.0.0rc1/ ). |
Those are injected by ReadTheDocs -- and I'm pretty sure you can use something like https://pypi.org/project/sphinx-version-warning/ for that stuff. |
hi, I appreciate your work on this theme. I provide the user manual for Zrythm in multiple languages and it would be very useful to have a language switcher somewhere as well as mentioned in the OP |
I have also "hacked together" a version switcher in Furo by making a _templates/versions.html and adding
to my conf.py, but it hard-codes too many assumptions about the final docs page. I'm curious if this issue will be able to solve my needs |
I'm ambivalent. I can see the value in that, but I also have limited availability now (I'm on vacation for a few more weeks).
Comments on this issue, for now. |
By the way, in terms of a status update on our end, my team has had a lot of delays and I'm not sure when they're going to get to developing this feature. I'm currently predicting it will be July, but I'll let you know if that changes. |
Sadly it appears that https://github.com/Holzhaus/sphinx-multiversion may be unmaintained now. |
I proposed some organizational changes to improve the situation (s. sphinx-contrib/multiversion#88), but there hasn't been a response in 11 days. I'm not very familiar with python, so I can't judge whether forking |
@barbaricyawps Hiya! Let me know if y'all have had time budgeted toward this, for this month. :) |
@pradyunsg , I confirmed with my engineering team recently whether they would have time for this, so we should be good. I think we (finally) go into code freeze this week and so we'll have some cycles available to work on it. Thanks for checking in! |
Hey friends! Just starting to really dig into this. I'm pretty confident from looking at it that sphinx-multiversion is (currently) unmaintained -- the last change to the repo was 14 months ago and most changes were 2+ years. I think the last release was in 2020. That being said, that's not actually a huge blocker here - as @pradyunsg pointed out earlier, as long as we just check for the presence of some variables that mean we have some versions, we should be able to go ahead and use those variables to present the version selector (and the "hey these aren't the current docs!" warning) I don't think that I'll make it to the point today where I've got any kind of PoC -- I think some of these other efforts are heading down the right track so I'll probably just pick those up and start with the absolutely horrible dump of all the versions. Styling should just be a matter of CSS at this point in Internet history. I'll keep this thread posted with any updates 👍 |
Ah, okay super interesting! Looks like sphinx-multiversion actually takes care of rebuilding old docs versions, which is a question that we had from our internal discussion. I have a bit better handle on the operation of things now and the pieces are falling into place. I think I'm a pretty huge fan of just checking for the HTML context variable sphinx-multiversion provides. As long as they quack like a multiversion variable, we should be 💯 🆗 here. |
Okay, so I have a very basic PoC that "works" for definitely-not-good-looking values of "works". In other words, if you're using lynx it's fine, but anything like Firefox, Chrome, or Safari will just be 🤢 But that's okay because style is something that we can overcome 😂 To check it out:
At the end of that you should have your web browser open with something that looks like this in your sidebar: @pradyunsg if you'd like/want to offer some feedback I can go ahead and open a draft PR -- otherwise I'm going to hold off until I have it at least looking decent. @barbaricyawps One current limitation of sphinx-multiversion is that it doesn't offer a very elegant way to just list the most recent versions... they're blocked out/selected via regex (fun!), so it is possible, just... interesting. I also want to take another/closer look at https://pypi.org/project/sphinx-version-warning/ to see if it's pretty easy to use that capability for Salt's docs, or if we'd need to take a different approach 👍 |
Neat -- I just tried building this and, although the sphinx-multiversion run failed, I managed to hack around some quirks around the C/C++ dependencies on M1, and get the build working. I'm happy to wait until you have the styling figured out. :) |
After skimming through the discussion, I am a bit confused, why json-based solutions are not considered such as the ones in PyData and Sphinx Material themes? What I like about them is the total transparency in terms of what is going on, no reliance on VCS or any other hidden state. Also, wouldn't it be easier in terms of implementation for Furo? I have read this comment, but I do not completely understand it. The "automatic" scenario is already implemented by the RTD. Users who prefer other hosting platforms are likely to be advanced enough to deal with a json-based approach :) P.S. I have just moved to Furo from Sphinx-Material (which has a convenient version dropdown) and I want to share a smart hack for version switching (see the left sidebar): https://yura52.github.io/delu/stable/index.html Credits go to PyTorch 😄 Jokes aside, would be super cool to have a native solution! |
FWIW, I came down with COVID earlier this week so I haven't made any progress here - feeling a bit better, hope to be able to pick this back up next week. @Yura52 in regards to JSON-based solutions, the guiding ideas that simple is good enough, and more than sufficient; and more stuff is not more good are the ideas that I'm trying to follow. JSON based solutions would require a non-zero amount of Javascript to process. At least when it comes to my goals that's less ideal - it will fail on older browsers or when folks disable Javascript. It also means that Furo has to maintain some logic on how, exactly, to generate version information (probably). I could be misunderstanding, but letting Sphinx tell us what the versions are, and relying on CSS to provide some fancier behaviors for the browsers that support it feels like the right approach to me. |
Hope you get better soon @waynew with no lingering symptoms. Please don't feel any pressure from my end to do this soon. :) In addition to what @waynew says... see also (from later in the thread, relative to the comment you linked to):
Pragmatically, it means that someone else can write the code to take a JSON blurb (like pydata or material do), and expose that to the theme as template variables.1 You can't do it the other way around. This approach is not coupling your version management to the theme's implementation and is strictly more flexible.
Well... it'll be more complexity, in terms of needing to cater to more usecases "natively". One could argue that it'll be less code overall "in the ecosystem" but... if that were a goal, Furo wouldn't exist -- I would've instead finished https://github.com/pradyun/materialism, or https://github.com/pradyun/sphinx-mkdocs-theme, or contributed to sphinx-rtd-theme with a knob to add a right sidebar and collapsible left sidebar navigation, or something like that. Finally, this is the first user workflow for Furo that I don't have any use for personally -- all my OSS projects are on RTD. I won't have good/clear judgement criteria for what are reasonable workflows/approaches for this. In more ways than one, I think it'd be best to not have logic for versioning functionality in Furo. Any feature development/effort I put toward that will have to come out of my empathy for primarily-institutional users, of which I only have a limited amount. Spending that "empathy budget" on pip/Python Packaging stuff seems like a more worthwhile investment for everyone involved. :) Footnotes
|
I see, thank you very much for explaining this. |
@waynew What's the next steps here? Do you want to take this forward, should I let this linger for a bit longer or are you OK with letting someone else pick this up and take it forward? This is in a bit of a limbo at the moment and it would be good to resolve that. :) |
@pradyunsg , sorry we're moving a little slowly, but we're working with a front-end developer to make the style improvements. After that work is done, I think we'll be ready to go, right? |
Yup, sounds great to me! Thanks for the super quick response! ^.^ |
@pradyunsg , just FYI, are you aware that Wayne's PR for this has been in and ready to review for a little while now? Anything we can do to help get it merged in? #500 |
I am, yes. I've had limited OSS time thanks to life happening, but I should be able to make time to look at that PR (and Furo more broadly) this weekend. :) |
FWIW, that's for the nudge on this -- I'd missed the first one from @waynew (sorry!). |
no worries... It happens to me all the time 😅 |
We totally get it, so don't stress about it @pradyunsg . It's not crucial for us that it get merged in since we can apply the change locally if we need. We just wanted to share it more broadly with the community if it helps anyone in a similar boat. Thanks for being so great to work with! 😄 |
Hello guys! Just read the whole conversation. I am wondering if there's any update on the multi language selector for furo |
Is there a plan for adding the version selector code to furo? Anything I could help with? |
Hi, is there any plan for this? Supporting multiple version builds using furo would be very useful! |
Hi 👋🏼, I just wanted to chime in here to let you know that Read the Docs does support version and language selectors (https://docs.readthedocs.io/en/stable/localization.html). Godot is a good example of a large multi-language multi-version project hosted on Read the Docs. Take a look at their docs at https://docs.godotengine.org/en/stable/ By the way, I work at Read the Docs, so feel free to open an issue/contact support there if you are still considering hosting the documentation there. I'm happy to help you with that process. |
Adding my voice to the feature request to add version support to the Furo Sphinx Theme. Highly requested feature here too that intersects with key business outcomes, including better expectation setting for server supportability and elevating customer trust on product release lifecycles. |
What's happening?
Apologies if you'd rather I open this as a GitHub discussion rather than an issue, but I'm trying to comply with your request to make this a "trackable task" in your project. Please advise me if you'd like this content in a different location.
User stories
As a documentation reader, I want to select different versions of the documentation so that I can read the documentation for an older product version or in my preferred language.
As a documentation provider, I want the ability to use the Furo theme on the hosting platform that best meets my project's needs and policies.
Motivation for this feature
Most projects have a need for version selection in their docs, specifically in two common scenarios:
If you want to use the Furo theme (like my team does!), you have the option of hosting your docs with Read the Docs (RTD), which provides product version selection. See Read the Docs - Versioned Documentation for more information. However, if documentation teams plan to host their docs on a different platform, they won't have the ability to do version selection. It's worth noting that for my team (the Salt Project), this is preventing us from adopting Furo as our documentation theme of choice.
To my knowledge, Read the Docs does not provide language version selection, but I could be wrong. FYI, my team doesn't currently localize our docs, but it is likely we will need to do so in the future. I've spoken to other large Python project owners who have this immediate need.
Feature requirements
Helpful links, discussions, and prior art
I discussed this feature with @pradyunsg on the Write the Docs Slack earlier this year. He mentioned:
In a separate conversation, @pradyunsg mentioned:
The team that can do this work
I work with several developers as part of the Salt Project, a Python-based open source configuration management tool with 5,000 contributors. I've official approval from VMware (the company that currently sponsors this project) for some back-end and front-end developers on my team to build out the product version selector for Furo. It's possible this functionality could also be used for language selection as well. We're roughly looking at a May timeline to do the work and we hope to share our work upstream with the whole community.
Please let me know next steps and how I can connect you to my team if you'd like to have some exploratory conversations before May. I look forward to hearing what the community has to say about this proposal.
Reproducer
Not applicable to this task.
Expectation
Not applicable to this task.
Code of Conduct
The text was updated successfully, but these errors were encountered: