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

DOC: Nav-bar: Add icon linking to contents#21224

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

Closed
timhoffm wants to merge287 commits intomatplotlib:mainfromtimhoffm:doc-toc

Conversation

timhoffm
Copy link
Member

@timhoffmtimhoffm commentedSep 29, 2021
edited
Loading

PR Summary

The contents page should be easily accessible from every page, which means it should be linked in the nav bar.

OTOH the current nav bar is not a complete site navigation but rather a collection of selected important topics. Putting a textual "Contents" link feels a bit out of place. Therefore, I've chosen the icon link.
Since we have the nav link, we can also remove theSite map section from the index page. That section was only added to have a link to the contents page somewhere.

The HTML is not very elegant. Explicit style and the nbsp are necessary to get position and size correct relative to the text nav links. Possibly somebody with more HTML/CSS knowledge could do this better, but it works.

before:
grafik

after:
grafik

possible alternative icon
grafik

QuLogicand others added30 commitsSeptember 1, 2021 22:26
Mostly D401 (imperative mood) fixes, and a few other things.
When referring to a font glyph, "glyph name" is standard terminology(e.g. FT_Get_Glyph_Name or Adobe docs); additionally there is a separateconcept of "symbol_name" used by the mathtext parser which has adifferent meaning (`\foo` commands referring to TeX symbol names), solet's not confuse them.symbol_name is kept in the mathtext SimpleNamespaces for backcompat(changing the SimpleNamespace to a proper class with a property handlingthe deprecation is not worth the work).
Clarify support for 2D coordinate inputs to streamplot.
…tionDOC Use 'Axes' instead of 'axes' in axes._base.py
Rename symbol_name to glyph_name where appropriate.
The constructores are entirely identical (including wrt. defaults anddocstrings).
Make HandlerLine2D{,Compound} inherit constructors from HandlerNpoints.
On Gtk4, these have never been part of a released version, and can bedirectly removed.
It is nicer to just define them at the point of use rather than ~400lines later.
Try running e.g. examples/widgets/textbox.py together with`rcParams["toolbar"] = "toolmanager"`.  Before this fix, clicking on theTextBox would result in "TypeError: push() takes 2 positional argumentsbut 3 were given".
These entries have already been removed (with the corresponding APIchange documentation).Also remove the now-unused _all_deprecated.
The docs should present mpl_toolkits as more or less regular modules,that just happen to live in a different toplevel package for historicalreasons.  So just concatenate them to the end of the main module list.(This is particularly in preparation of the new website redesign, wherethe separate "Extra Toolkits" grouping is really too conspicuous on thefront page.)Remove the toolkits/index page (documenting mplot3d andaxis_grid/axisartist ("ag/aa") together doesn't make much sense exceptfor this historical grouping), merging the mplot3d intro blurb togetherwith the one previously at mplot3d/index.rst; the ag/aa blurbs werejust included from the ag/aa API docs themselves and therefore don'tneed to be kept.The mplot3d intro blurb itself can go to the top of the mplot3d APIdocs, rather than needing a separate page.
Deemphasize mpl_toolkits in API docs.
Remove now-unused rcParams _deprecated entries.
@timhoffmtimhoffm added this to thev3.5.0 milestoneSep 29, 2021
@timhoffmtimhoffm added the Documentation: websitelayout/behavior/styling changes labelSep 29, 2021
@timhoffmtimhoffmforce-pushed thedoc-toc branch 2 times, most recently fromdd73697 to3fd78f1CompareSeptember 30, 2021 00:06
@QuLogic
Copy link
Member

Hmm, that's not normally how I expect a hamburger icon to work.

cc@tacaswell@dorafc

@timhoffm
Copy link
MemberAuthor

@jklymak
Copy link
Member

jklymak commentedSep 30, 2021
edited
Loading

So what happens now when I click on "Matplotlib"? Thats what I would expect to take me to the top of the docs, though maybe it now goes to the landing page?

Edit: currently it goes tohttps://matplotlib.org/devdocs/index.html#, which is what I'd expect. That pageshould be the table of contents, and I'm not sure why we would have another?

@timhoffm
Copy link
MemberAuthor

That page [index] should be the table of contents, and I'm not sure why we would have another?

TL;DR

Index and table of contents serve different purposes. Within our current doc structure, we need the freedom of having separate toc and index. We could try to rearrange things so that both fall together, but it would be a lot of work (which we are not able to do right now before 3.5) and I'm not convinced it's even possible.

Explanation

Index page

Purpose:

  • Tell first-time visitors what matplotlib is in one sentence.
  • Guide first-time visitors to relevant infos to get started (Installation, Quick Start guide)
  • Highlight important parts of the docs for regular visitors (Learning resources)

Advantage: We have more space for information than only a navbar link.
Disadvantage: We shouldn't over-crowd this with less relevant content.

Table of contents

Purpose: Structured overview of all the contents on the page.
Advantage: We can show the full logical structure and all content.
Disadvantage: No priorization on important topics.

Nav bar

Advantage: Available on every page.
Disadvanage: Only few links possible
Purpose: Prominent links to most relevant and often used topics. (For example Installation is not in here, because you only need that once.)

Our page structure is slightly more complex due to that, but I think this makes sense:

image

Could we do it differently?

I claim we need an easily accessible table of contents so that one can see everything that is available on the page. I find the lack of a toc in the old page design quite frustrating because it's hard to find out what is available and how the whole docs is structured.

OTOH I don't think we should put all that content on the index page. Pages can get away with that if the nav bar reflects the top-level hierarchy of the toc. We don't want to do that because "Installation", "Project information" and "Search page" are reasonable top-level toc elements, but not important enough to be accessed from everywhere. OTOH, we want to highlight "Plot types", "Examples" and "Tutorials" which all logically belong into the usage guide. But we also want to link the usage guide itself.

Note also that we plan to move "Develop" out of the core documentation into a separate repo. Therefore it's nav entry will link to a page outside the toc.

So I think, we still need both:

  • The contents page gives the overall site structure
  • The nav and the index page specialize in guiding users to relevant information quickly.

@jklymak
Copy link
Member

I agree that the top-level nav should represent the doc structure as best we can.

I agree that "Installation" should be prominent on the index.html, but I don't think it logically requires it be at the top level of the docs: organizationally it could easily be a subdirectory under the usage guide. That applies even more so to "Project Information". If we move those two things down a level, then it makes the navbar largely correspond with the TOC, and have a few links that drill down a level for convenience.

@timhoffm
Copy link
MemberAuthor

I agree that the top-level nav should represent the doc structure as best we can.
I said, that this can be an aspirational goal for a project, but I also argued that "as best we can" is not good enough in our case and we thus need something else.

When I had a look at this as part of@tacaswell's restructing I didn't find a satisfying restructuring solution that'd allow to align nav bar and toc. You are welcome to propose a restructuring, but I think it has to be a complete proposal. Only saying "Installation can be part of the usage guide" is not enough. We have to make sure that every page has a logical place and the whole picture is consistent.

@dorafc
Copy link
Contributor

Have you considered putting the link to contents / site map in the footer?

I'd also suggest renaming "Site Map" to something like "table of contents" that more directly speaks to human users. The term sitemap generally refers to an SEO tool for bots to find content these days.

For what it's worth, you're dealing with a notably challenging information architecture problem here. This short book will be good intro to field -https://abookapart.com/products/everyday-information-architecture. Here are some more articleshttps://alistapart.com/blog/topic/information-architecture/

@timhoffm
Copy link
MemberAuthor

timhoffm commentedSep 30, 2021
edited
Loading

Thanks@dorafc! The "Site map" naming is a good point. Through this PR we get rid of that name.

Up to now, the footer is mainly a copyright notice. It would be awkward to only have the table of contents link in there. If we want to go this way, we'd need to have a broader thought on the footer.

I've switched the icon here tofa-list because that seems to be the common consensus when image-searching "table of contents icon". IMHO this is PR is an improvement of the current state. There might be some better solution, but that'd require significantly more work than I can do here. But if people think the icon is a bad idea, I'm ok to leave it.

@tacaswell
Copy link
Member

I am in favor of pulling more stuff from the proposed footer from the brochure site and expanding the footer.

@jklymak
Copy link
Member

jklymak commentedOct 1, 2021
edited
Loading

The problem right now is not too few table of contents - it is too many. We haveindex.html, we havecontents.html, and we haveusers/index.html which repeats most of contents.html, but not everything.

I'm suggesting the simple solution is to put most of the info that is not example galleries, API reference, or Contributing underusers/ and letusers/index.html serve as the table of contents for all the "rest" of the docs. I'd also propose movingfaq/ andresources/ to subdirectories ofusers/, but that is of secondary importance.

Navbar:

  • Plot Types
    • as is
  • Examples
    • as is
  • Tutorials
    • as is
  • API Reference (reference is too vague)
    • as is
  • User's Guide
    • Installation
    • Examples and Tutorials (just relinks the navbar items)
      • Plot Types (don't list the next level down)
      • Tutorials ("")
      • Examples ("")
    • API Reference (no subheads, just relinks navbar)
    • Explanations and How-to
      • Troubleshooting
      • Usage patterns
      • Environmental variables
      • Fonts
      • Interactive Figures
      • Miscellaneous
    • External Resources
      • Books, chapters, and articles
      • Videos
      • Tutorials
    • Contributing (no subheads)
    • Project Information
      • License
      • Citing Matplotlib, Credits
      • History
    • Release Notes (no subheads)
  • Contributing

I don't think this misses anything, and prevents us having the information in two places (and index.html).

EDIT: I think the release notes are important, but I'd link where we list the version info, not as a top navbar item.

@timhoffm
Copy link
MemberAuthor

So the solution is going the direction to put (almost) everything under "Usage guide". That's a conceptually viable approach, though I'm wondering if "Usage guide" is still the correct term then.

You started from Nav and put sections under that. Due to the technical realization in Sphinx, you have to go the other way round:
Nav is only a set of links we can point anywhere. There is however some constraint in the doc hierarchy of sphinx. Usually, you'll make a tree of the doc files by including them in the toc of the next higher level. This defines the global toc hierarchy. Our base file is currentlyhttps://github.com/matplotlib/matplotlib/blob/master/doc/contents.rst.
The main task is to reasonably setup that hierachy via.. toctree directives. By default, the toc is then also displayed on that page. That's certainly not what we want for index. You might be able to work around that with a:hidden: attribute and/or use.. ophan directives. Sorting out such a structure when you don't want to show it on index is a bit of a puzzle, but that's the way sphinx works.

@jklymak
Copy link
Member

Here is an attempt to implement what I'm suggesting:#21251

@jklymak
Copy link
Member

BTW, I'm open to inverting#21251 and moving all the references to/contents.html and getting rid of/users/index.html. We could probably just rename/users ->/miscellaneous which is what is in that directory now.

@timhoffmtimhoffm mentioned this pull requestOct 1, 2021
@timhoffmtimhoffm marked this pull request as draftOctober 1, 2021 22:39
@timhoffm
Copy link
MemberAuthor

On hold during#21251 discussion.

@timhoffm
Copy link
MemberAuthor

Superseeded by#21251

@timhoffmtimhoffm deleted the doc-toc branchJuly 19, 2024 11:35
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Documentation: websitelayout/behavior/styling changes
Projects
None yet
Milestone
v3.5.0
Development

Successfully merging this pull request may close these issues.

18 participants
@timhoffm@QuLogic@jklymak@dorafc@tacaswell@story645@anntzer@jyjoshi@dstansby@Ptrskay3@deep-jkl@fariza@beckja@greglucas@pijyoi@MalikIdreesHasanKhan@fishmandev@liamtoney

[8]ページ先頭

©2009-2025 Movatter.jp