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

Allow the story property to accept String or Function as values #18419

Open
himedlooff opened this issue Jun 6, 2022 · 2 comments
Open

Allow the story property to accept String or Function as values #18419

himedlooff opened this issue Jun 6, 2022 · 2 comments

Comments

@himedlooff
Copy link

Is your feature request related to a problem? Please describe
I have complex documentation per story that I'd like to render into the docs page but it is currently not possible.
For example I'd like to render some custom HTML into the description of a story.

Describe the solution you'd like
As described here: #8527 (comment)

Functions can be passed as values to parameters.docs.page:

export default {
    ...
    parameters: {
        docs: {
            page: () => (
                <>
                    <Title>My Story</Title>
                    <Description markdown={docs}/>
                    Whatever else..
                </>
            ),
        },
    },
}

But not for a specific story's description parameters.docs.description:

MyStory.parameters = {
    docs: {
        description: {
            // "story" property should also accepts a function, just like "page" for default export
            story: () => (
                <>
                    lots of complex things goes here
                </>
            ),
        },
    },
}

It would be great for story property to accept String or Function as values, for more control over story-specific descriptions

Describe alternatives you've considered
There are none that I know of.

Are you able to assist to bring the feature to reality?
Maybe with some guidance?

@jesrodri
Copy link

jesrodri commented Oct 7, 2022

Hi, can I try this one?

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

4 participants
@shilman @himedlooff @jesrodri and others