storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.68k stars 9.32k forks source link

indexer documentation is lacking #29515

Open githorse opened 1 week ago

githorse commented 1 week ago

I'd like to call my storybook file Widget.demo.tsx instead of Widget.stories.tsx. This is possible with custom indexers; in fact, the docs specifically say

Unless your indexer is doing something relatively trivial (e.g. indexing stories with a different naming convention), in addition to indexing the file ...

But that link just takes me in circles -- nowhere does it tell me what that trivial indexer actually looks like. Digging into the API reference, the examples all seem to elide critical parts of the actual code:

// Read file and generate entries ... 

Could the docs be updated to show some real working examples of indexers, including a simple "noop" indexer that just picks up a different filename than the convention?