-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Is it possible to customize/extend search functionality to more than just names? #14724
Comments
We don't currently have any plans for this. In an older version of search it included various extra fields (like |
@shilman thanks. To get these in the search index, is the recommended pattern breaking up larger MDX files into smaller files that are part of the same sub-section instead? Something like a single MDX file I wish it were possible to do this while still keeping those individual sections within a single scrollable page. |
The current search really isn't designed for this use case, so I hesitate to even recommend a workaround. That said, if I wanted to hack the system, I would do something like this in your MDX file: # Here is my page
<Story name="Page title"></Story>
I'm going to type something here about my page
<Story name="Searchable"></Story>
More text here
<Story name="Another custom term"></Story>
... I tried this and it kind of works. Each story generates a heading under Page title. The canvas for each story is blank. The name of each story is searchable. Clicking on the story scrolls to that part of the page. |
@shilman Unfortunately that doesn't work in 6.4.12, I get I'd love it if there was an option to turn on/off the ability to search by heading. Then clicking a result takes you directly to the anchor link. That workaround would kind of work like you said if it didn't throw an error. There are things that don't make sense to have a story, like configuration examples (theming is what I'm working on currently.) |
Actually, that does work with an empty fragment: <Story name="Searchable title"><></></Story> Neat! |
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
|
I understand the need to reduce the backlog but in here it's not a problem with something working not as expected (which fits into the "reproduce" concept) but rather a request to add something that's missing. Are there recommendations on how to reproduce "lack of something"? |
I'd like to be able to include more than just the page name in search. For example, if I have an MDX page about input usage rules, and one of the sections of that page is about validations, then if a user searches "validation" on my storybook, I want this page to come up as a result.
Is there anything like, the ability to add keywords to a
<Meta>
or something? I can't find anything in the docs about this.The text was updated successfully, but these errors were encountered: