Stream: rustdoc

Topic: status badges in search results


view this post on Zulip bstrie (May 01 2021 at 16:59):

I want to take the "deprecated" and "experimental" badges that appear on items in the module-level docs and cause them to show up in search results. having never touched rustdoc before, I assume that I'll first have to add a new item-level field to the JSON search index, then populate this field from whatever parsed representation already detects deprecated/experimental status, then update the search results page to use this field. Does that sound accurate? Would anyone like to point me to the right files to get started with?

view this post on Zulip Joshua Nelson (May 01 2021 at 17:01):

@bstrie do you happen to know a deprecated function in libstd I could use to test the current behavior?

view this post on Zulip Joshua Nelson (May 01 2021 at 17:01):

try! works

view this post on Zulip Joshua Nelson (May 01 2021 at 17:02):

I don't know much about search but most of the logic is in https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/static/search.js I believe

view this post on Zulip bstrie (May 01 2021 at 17:02):

the case that I particularly care about is https://doc.rust-lang.org/std/index.html?search=max ; the std::*::MAX consts are all deprecated, whereas *::MAX are their replacements


Last updated: Oct 11 2021 at 22:34 UTC