Stories Generator to support MDX
See original GitHub issueDescription
Update the Stories Generator to support MDX format.
Motivation
Using storybook with MDX story files allows for more comprehensive documentation with inline component demos. https://storybook.js.org/docs/react/writing-docs/mdx
Suggested Implementation
@nrwl/angular:stories project --format mdx
@nrwl/angular:stories project --format csf
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Rich docs with Storybook MDX
Storybook is the standard tool for UI component development. It's used to build the most popular design systems on the web, ...
Read more >Hybrid MDX as an emergency generator - MDXers.org
I found stories about Prius owners powering their houses in storms, ... I don't need to store and maintain a generator, keep running...
Read more >Getting started - MDX
Bundlers; Build systems; Compilers; Site generators; JSX runtimes ... MDX relies on JSX, so it's required that your project supports JSX as ...
Read more >Welcome / 4. Writing Stories - Page ⋅ Storybook - Core Values
Guidelines for writing good stories. Knobs; MDX; Structure of a Story; Component generator. Guidelines for writing good stories.
Read more >Setup CSF + MDX stories with @storybook/addon-docs - GitLab
Update the component generator to boilerplate MDX-ready stories. ... To elaborate on this: it's worth noting that MDX supports JSX, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mandarini, yep I’ve made a few generators before so I’ll be able to handle that. I’ll look at the migration stuff which I haven’t done before.
Hi @ChazUK !
So, answer to (1):
The
generateFiles
method takes asrcFolder
string, which is actually the directory of the template files that are going to be used. In our case it’s the packages/angular/src/generators/component-story/files directory. You would need to create two folders, one for csf and one for mdx, and add logic in the generator to chose either one or the other as the templates path. Does this make sense? Are you familiar with the template syntax?For (2), we’ll see this eventually, hehe.