Skip to content

Think more about search and navigation #167

Open
@brson

Description

@brson

The organization of the book is just barely enough to be workable right now, but I hope we can do a lot more.

Today there is a single index, organized on three axes:

  • "section" - each example is stuffed into a section, like "basics", "encoding", etc. This is mostly to accommodate the linear book format, so that it's readable front-to-back and has something of a 'narrative' organization
  • crate - each example is badged by the crates they include. Those badges link to docs.rs
  • category - each example is badged by the crates.io categories it belongs to. Those badges link to the category on crates.io

There are some issues with this:

  • duplication of section and category - these are similar concepts but different. the categories are strictly tied to crates.io and examples may fit into multiple categories. sections on the other hand are organized to the needs of the book.
  • defining sections - it's not easy to organize examples into sections, to decide what the appropriate sections are, and which one section to assign any example to
  • categories' links are not obviously useful - maybe navigating to crates.io would help a user discover other interesting crates. not sure
  • scaling - the cookbook is going to eventually be really big, and a single massive index will become unnavigable

And now some of my thoughts on how to deal with these:

I think for the sake of bookish organization it's important to try to split examples up into sections, try to make them progress in a somewhat narrative way - more fundamental things first, leading to higher-level tasks that build on the foundations, etc. The actual section naming and composition I'd expect to change based on experience and based on the actual examples we've got. We can also crib off of other such books. So for now I'm inclined to just live with the semantic duplication between book sections and categories.

But I also had an intent, that is not realized at all yet, to introduce filtering or searching, based off of the crate and category badges. The idea is to be able to narrow down the index based on what you are looking for, to make it more navigable. So e.g. click on the 'rand' crate badge and every example that does not contain 'rand' disappears; click on the 'net' category and every example that is not in the 'net' category disappears.

This obviously has the problem that the badges already link somewhere, and those destinations are useful - of course there should be a docs.rs link for every crate. So to accomplish this we would need some new visual / navigation concept. I don't have any great ideas right now.

One other thing, with the 'narrative' organization of the book, it might be good to have some sort of connecting text that ties section together. e.g. the "basics" section could start with an introductory text of some kind explaining what the section is about, and what's rusty about the topics to come. Haven't thought through that much.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions