Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a custom URL transform option #3

Open
DanWebb opened this issue Jun 21, 2024 · 0 comments
Open

Add a custom URL transform option #3

DanWebb opened this issue Jun 21, 2024 · 0 comments

Comments

@DanWebb
Copy link
Member

DanWebb commented Jun 21, 2024

At the moment auto only supports lower kebab-case file structures and Github URLs are case sensitive.

I think that to offer max flexibility, we'd have a function parameter which receives the story like so:

parameters: {
  transformUrl(story) {
    return story.title;
  }
}

An attempt at this was already made, but unfortunately, it seems like Storybook doesn't support function parameters – it never makes it through to the useParameter hook.

Another option I've considered is to have a format option, that could specify the casing "kebab-case, "camelCase", "PascalCase" etc. It's a bit less flexible but would be an easy way to cover more file structures.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant