clap icon indicating copy to clipboard operation
clap copied to clipboard

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

Open Finchiedev opened this issue 1 year ago • 3 comments

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 avatar Oct 08 '23 02:10 Finchiedev

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.

epage avatar Oct 09 '23 18:10 epage

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.

Finchiedev avatar Dec 07 '23 12:12 Finchiedev

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.

epage avatar Dec 07 '23 15:12 epage