Skip to content
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

Ability to escape slashes in story names #16038

Closed
tgelu opened this issue Sep 14, 2021 · 2 comments
Closed

Ability to escape slashes in story names #16038

tgelu opened this issue Sep 14, 2021 · 2 comments

Comments

@tgelu
Copy link

tgelu commented Sep 14, 2021

Seems like the assumption about / being an inescapable hierarchy separator doesn't quite hold. The only alternative one can opt for is to use a homoglyph instead of /. That is ugly and makes the urls even uglier.

In any case, I don't want to suggest we should go back to configuring the separator. I only want to suggest a way to escape the /, like one would in a regex, for example Components\/Button. Or to change the type of title from string with a special convention to Array<string> which seems to describe the intent more precisely and clearly.

@shilman
Copy link
Member

shilman commented Jun 17, 2023

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 this is still relevant in SB 7.x.

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
@SkReD
Copy link
Contributor

SkReD commented May 20, 2024

Figured out that combination of replacing in story title / with ## for example and adding manager config with renderLabel do the trick

import { addons } from '@storybook/manager-api';

addons.setConfig({
sidebar: {
    showRoots: false,
    renderLabel(item) {
        return item.name.replace(/##/g, '/')
    }
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants