Skip to content
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

docs: link to table of contents instead of first chapter for tutorial #5163

Open
2 tasks done
Finchiedev opened this issue Oct 8, 2023 · 3 comments
Open
2 tasks done
Labels
A-docs Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations S-waiting-on-decision Status: Waiting on a go/no-go before implementing

Comments

@Finchiedev
Copy link

Please complete the following tasks

Clap Version

master (1806e28)

Describe your use case

The "quick links" section at the top of clap's docs.rs page currently links to the first chapter of both the builder and derive tutorials. I have found that when distracted or just skimming the documentation it is quite confuse this first chapter for the entire tutorial.

Describe the solution you'd like

Change the link to point to the table of contents rather than the first chapter.

Alternatives, if applicable

  • Leave it as is
  • Embed an index in the "quick links" section
  • Improve the visibility of the next module re-exported in every chapter

Additional Context

These changes are very small, I've made them available on a public fork if they're worth merging.

@Finchiedev Finchiedev added the C-enhancement Category: Raise on the bar on expectations label Oct 8, 2023
@epage epage added A-docs Area: documentation, including docs.rs, readme, examples, etc... S-waiting-on-decision Status: Waiting on a go/no-go before implementing labels Oct 9, 2023
@epage
Copy link
Member

epage commented Oct 9, 2023

I copied this from winnow when I pulled in a tutorial as I wanted the introduction first. However, I find that with clap I'm constantly jumping to the table of contents to get to a specific section to show to people. I've been unsure how representative my workflow is.

Looking back at it, I would be worried about the stutter of going to the tutorial (ToC) to just have to go to the tutorial (start). I like the introduction or quick start to be right there.

Will have to think more on this and would appreciate more input in the form of what people are trying to accomplish when they go to the tutorial, why it works or doesn't, and how they feel any suggested change may impact someone just wanting to read a tutorial.

@Finchiedev
Copy link
Author

Thanks for all of the context! There's definitely value in reducing the friction of navigating between the docs homepage and the first page of the tutorial. Similar to your workflow, I am usually interested with finding a particular topic, already knowing the general solution but looking for a reference, which a table of contents suits very well. I didn't even realize there was a table of contents or more than one page for quite a while, re-exporting pages as modules to appear in the sidebar and footer is very useful but as a frequent user of docs.rs I usually filter this out as noise. As you mentioned it's hard to know how common this is, I can only speak to my own experience.

Another solution that I'm surprised I didn't mention in the initial message: embed a small table of contents on every page, or at least on the first page. That way users are still dropped straight into the content, but it's clear what sections are covered, and the "jumping around" use-case works great as well.

@epage
Copy link
Member

epage commented Dec 7, 2023

I think having a "topics we'll cover" at the end of the first page would make sense. Granted that'd be "below the fold" which is annoying but what "fits" with the design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations S-waiting-on-decision Status: Waiting on a go/no-go before implementing
Projects
None yet
Development

No branches or pull requests

2 participants