Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update layout of sidebar in documentation#10374

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 3 commits intomatplotlib:masterfromtimhoffm:doc-sidebar-layout
Mar 18, 2018

Conversation

timhoffm
Copy link
Member

@timhoffmtimhoffm commentedFeb 3, 2018
edited
Loading

PR Summary

This PR contains some changes to the sidebar in the html documentation:

  • Move the search bar to the top. IMO it's one of the most important side bar items and it has a small fixed height. Therefore it's good to have it at the top.
  • Remove the section "This Page / Show Source". This was probably inherited from the sphinx defaults. However, it's rather useless if not confusing for the user to view the .rst source.
  • Make the search field use the full width. (Note: I've add recently sent a PR to sphinx that joins the search field and buttonImproved sidebar search field style sphinx-doc/sphinx#4377. This will be available from Sphinx 1.7 on. Until then it's at least visually more appealing to have the search field span the whole width).
  • Force the "Table of Contents" heading to be white as well. - It's a link and therefore was rendered black.

Index page before / after:

grafikgrafik

Other pages before / after:

grafikgrafik

@jklymak
Copy link
Member

I think this looks OK, but I was under the impression no one actually thinks the search works very well. If not, do we want it at the top?

story645 reacted with thumbs up emoji

@timhoffm
Copy link
MemberAuthor

timhoffm commentedFeb 5, 2018
edited
Loading

I agree that the search is not great. But putting the search field in a varing not easily accessible place is no solution to this.

Either we want to have a search field (even with limited capability) - then it should be easily accessible at the top. Or we are a bit ashamed of the search and don't want to advertise it. Then, the search field should go completely. In that case I propose to add a "search" link next to index. That way the search is still accessible but less advertised.

Personally, I'd keep the search field. There's a lot of less useful results and the output format is not great, but at least for simple things like "xlim" it points me to the expected documentation (pyplot.xlim, Axes.get/set_xlim at the top). However, I can live with both versions, the top search field or no search field. A badly located search field just doesn't make sense.

@dstansby
Copy link
Member

FWIW I think the search works well and use it all the time, and it really annoys me every time I try and find the search box in the pandas docs that is hidden at the bottom of the sidebar.

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm 👍, but a couple of other people should probably agree before this goes in.

@timhoffm
Copy link
MemberAuthor

@tacaswell Do you have any recommendations who should review this before merging?

@anntzer
Copy link
Contributor

I kind of like having the source readily accessible (but that may be due to my unusally good relationship with rst :-)) and doubt that anyone would really be confused by the link.
Otherwise looks fine to me.

@anntzeranntzer added this to thev2.2-doc milestoneMar 3, 2018
@timhoffm
Copy link
MemberAuthor

The .rst source is not relevant for the users, so the link should not be in such a prominent place in the official docs. Additionally, the .rst contents is also quite useless in many cases, because it mostly contains headings and autodoc directives.

If there's consus that the link is of value for the developers anyway, I'd like to either show it only in the dev-docs, or alternatively make it less prominent (e.g. by moving it to the bottom of the page).

@jklymak
Copy link
Member

I'm not in favour of this change. I rarely if ever search websites using their internal search, and would personally prefer the navigation stay on top....

@timhoffm
Copy link
MemberAuthor

IMHO it's good UX to have permanent elements such as a search field in a fixed place. Since the navigation may become very long, the place of the search field may vary widely.

On the other hand, the search has a small fixed footprint. So the only effect is a slight constant shift of the navigation.

Note that with Sphinx 1.7 we can even reduce it further to a single line (sphinx-doc/sphinx#4377). Is it safe to assume that the docs will be built on sphinx 1.7+? If so I can update the css for the single-line search. If desired, one could also remove the title bar of the search field.

@anntzer
Copy link
Contributor

(independently of whether to keep the rst sources, I'm actually +1 in moving the search bar to the top)

@timhoffm
Copy link
MemberAuthor

timhoffm commentedMar 4, 2018
edited
Loading

I've now CSS-styled the search bar to make it single line and thus take less space at the top (This is now hardly more space than the excess whitespace the current docs have at the top of the side bar).

Note: This needs sphinx 1.7+. Since the devdocs are built with this version already, I assume this is not a limitation.

grafik

@timhoffm
Copy link
MemberAuthor

Any more opinions on whether to keep or to drop the .rst source link?

@dstansby
Copy link
Member

I'm +1 for getting rid of it (i.e. not that bothered, but in favour of. I'm more like +5 on moving the search box up 😛 )

efiring and story645 reacted with thumbs up emoji

@timhoffm
Copy link
MemberAuthor

rebased to fix tests.

@timhoffm
Copy link
MemberAuthor

@anntzer I understand that sometimes there is a certain value in having access to the .rst source. Would it be an option to still have a page source link, but to clearly set it apart from the regular navigation? E.g.

grafik

jklymak reacted with thumbs up emoji

@anntzer
Copy link
Contributor

Having it "half hidden" as proposed is fine with me.

@timhoffm
Copy link
MemberAuthor

Page source link added back in and some layout improvements. Here's the final result

grafik

@tacaswelltacaswell merged commit74f06dd intomatplotlib:masterMar 18, 2018
tacaswell added a commit that referenced this pull requestMar 18, 2018
@timhoffmtimhoffm deleted the doc-sidebar-layout branchMarch 18, 2018 22:36
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer approved these changes

@jklymakjklymakjklymak approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.2-doc
Development

Successfully merging this pull request may close these issues.

5 participants
@timhoffm@jklymak@dstansby@anntzer@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp