-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Document "fmt: off" under Usage, docs site is hard to use #2365
Comments
+1
I will admit that those two clicks have been annoying to me too (and I'm the one responsible for this change!). For this issue, I can think of three possible solutions:
My guess at how this oversight happened is that I modelled my work against Pip's documentation and their theme provides a dropdrop for each section making the structure IMO pretty easy to navigate. Unfortunately Alabaster doesn't and yep that makes this structure rather annoying. Sorry y'all, this is very much on me for missing this :/ Thanks for bringing this up. |
Looking at the mypy docs, the sidebar TOC works pretty well with RTD theme to have all of the documented in the sidebar. IIRC from testing this doesn't look or feel great with Alabaster. This is basically a specific combo of 1 + 2. |
Just to set a baseline, I think Richard's documentation restructuring was vital. Having everything in one place is much harder to read if you don't know what you're looking for.
Also, Sphinx documentation does have a search bar! That being said:
This seems entirely reasonable! I'd expect it to be there as well. We could of course have a mention in the style docs.
I agree that the Style and Usage top pages are a bit short, and maybe they could be converted to a single page with sections from the current pages. But I'm not a 100 % on this. Needs some thinking about what would be the best way of doing it. But overall I think reducing clicks is an important goal 👍
While I like the bit of personality that comes from not using RTD, it is a great theme! Don't know about Furo, but I'm all for changing the theme for the better. The dropdowns on RTD are a bit hard to hit in my opinion: But then again, it doesn't really reduce clicks, because the dropdown isn't exploded automatically when clicking on the top level. Would get rid of loading the page though, yeah.
The This could call for some restructuring though. Maybe more sections with more specialised names. A single file would be quite easy to navigate from here as well.
Yeah those dropdowns are pretty nice 👌 |
Thanks both! For what it's worth, I'd be in favour of converting the Style and Usage sections to a single page, but trust y'all to do what makes sense for black. One note about pip's docs is their user guide is basically one big page with a floating TOC. The "Commands" section has the dropdown and splits, but not sure that's the best fit for black: after all, black serves a single, simple purpose, and doesn't really have subcommands with separate functionality. |
Yeah, you've got a point for almost everything you're saying (I kinda disagree on the comment on pip's Commands vs Black's docs). As I've said before, I'm tired of documentation restructuring and I don't remember how moving to a single page per section would feel (from testing) and don't really feel doing it, but I will since I'm scared of managing to mess it up on the third try. TBH I'm a bit hesitant on such changes because I feel like such a "attempt #3 PR" would make me seem incompetent at doing docs, which I guess I maybe am, but then again, there's a problem to solve so that's probably moot :) I would be half-fine flattening it if it weren't for the Blackd docs. FTR, I want to add subcommands to blackd (I saw dmypy and realized that proper support for just running a server instance of a tool is not enough and an easy client is also necessary) so there's a good chance its docs will grow. I don't really feel like adding blackd's docs to the sidebar TOC again, even with the aforementioned changes because it feels too specific and niche to deserve such a placing. Decluttering and removing stuff from the sidebar TOC was literally one of the main reasons for the restructuring in the first place. But, making Usage single-page would break that (I thought of moving blackd's docs to a guide, but that still feels weird). Also in general, extensibility was another goal (in my original plan, there's some pages that don't exist but would live under these sections - although I do think some of them are no longer a good idea) and adding sections was to allow for that ... unfortunately they kill the UX (which is why we're here). I feel like a lot of limitations are here *because* the Alabaster theme really limits us in what structures feel and look good (forgetting about maintenance). Going the mypy route is not great since sections aren't IMO handled well (we even had to add custom CSS to support scrolling in the sidebar!) and pip commands' style (which I like obviously, although mypy is nice too) sucks currently. The TOCs provided by Furo (pip's theme) are additionally quite nice! While I'm realizing moving a new theme might not fully fix this issue, it would open up the choices (also would make this issue less of an issue for sections that I'm -1 on flattening like Guides). Maybe it's just me but I find it hard to read pip's user guide because there's just *so* *much* text thrown at you *at* *once*. I can see it's great when referring to it as a reference, but learning on how to use the tool looks a bit frustrating (I know pip isn't really a tool you learn, but Black is small enough where it would be reasonable to teach users on its features).Yes, I now see the problems with trying to make some piece of docs double as both a guide and a reference. I'll go and implement a few different solutions locally and come back with my observations and my (hopefully now educated) opinions, but I do wish this was less annoying :/ Hopefully I find something to sort out the Blackd wrinkle.
I don't know if I can be trusted with this at this point 🙃 but I'll try to do better! |
First and foremost, I think you're doing great! And in case I mismanaged my words, I'm sorry if anything I said came off sounding too critical — most of why I opened this issue was the relatively straightforward "ask 1". |
OK so via the power of procrastination (and then some thoughtful discussion with some members of the community on PyDis) I have warmed up to the general flattening idea and this is the summary that the discussion reached:
https://discord.com/channels/267624335836053506/846434317021741086/868552799162609744 There's a lot of other good stuff before that message but the TL;DR is that it is now time to convince myself this project is more important than working on blackbench and do some testing and get a PR up :)
Nah, don't worry about it, I tend for perfection so it's quite frustrating to see stuff to be less helpful / useful than I'd have hoped. Add in some general frustration and being tired with the docs and you got a probably overly expressive me :P Thanks for the compliment and thank you for maintaining mypy, my work on Black depends on it heavily via mypyc! |
I haven't found the docs to be hard to use, but I agree that the two clicks often feel excessive. My proposed solution, which I don't see mentioned here already, would be to merge the bulk of the Would a PR for this be accepted? |
I found myself wanting to turn black off for a block of code, so I searched my brain and it came up with
# format: off
. This didn't work, so I looked up black's docs. I went to: https://black.readthedocs.io/en/stable/ from which I clicked on "Usage and Configuration" from which I clicked on "The basics" from which I expanded some drop downs (whose content isn't searchable until expanded), which led me nowhere. This is a lot of clicks and no result compared to the old days when everything was in the README.So I guess I have the following asks:
# fmt: off
in Usage (grep tells me it's currently in a section called "The Black code style", which itself is two clicks away from the docs home page)Thanks and feel free to ignore if you disagree! :-)
The text was updated successfully, but these errors were encountered: