feature: Add chapther numbers to search result breadcrumbs

Open
#992 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
search

Research direction

Start in src/renderer/html_handlebars/search.rs around the linked search-result generation, then read issue #631 for the proposed chapter hierarchy changes. Determine how optional chapter numbers should appear in breadcrumbs and whether the architecture work is required first. Done means search-result breadcrumbs can show chapter numbers in the requested cases without breaking the existing format.

Written by the indexing model from the issue text.

Description

A-Search

This would make the search results easier to scan is some cases (e.g. when the book is big (like The Book).

Before:
Screen Shot 2019-08-02 at 14 05 54

After:
Screen Shot 2019-08-02 at 14 05 46

It could be implemented as an optional thing.

Here's where they're being generated:
https://github.com/rust-lang-nursery/mdBook/blob/77af889a2e5331c11345ddef935caccb0305cd34/src/renderer/html_handlebars/search.rs#L92

May be better to first make some architecture changes that would make it easier to implement
A quote from #631:

The idea is a nested chapter can have links back to its parent (and maybe siblings?), making things like section numbers and breadcrumbs a lot easier to implement.

Dominant language
Rust
Stars
22.2k
Forks
1.9k
Avg merge
2d 21h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/mdBook

All issues in rust-lang/mdBook

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.