question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stories Generator to support MDX

See original GitHub issue

Description

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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ChazUKcommented, Mar 8, 2022

@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.

1reaction
mandarinicommented, Mar 8, 2022

Hi @ChazUK !

So, answer to (1):

The generateFiles method takes a srcFolder 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found