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.

Not able to customize documentation with MDX

See original GitHub issue

Hi everyone, I’m trying to customize the Docs tab of my Stories. I’m following the documentation :

https://storybook.js.org/docs/react/writing-docs/docs-page

Here is my code:

CommunityCoupons.stories.js

import CommunityCouponsDocs from './CommunityCouponsDocs.mdx';

export default {
  title: "View Modules/Community Coupons",
  parameters: {
    docs: {
      page: CommunityCouponsDocs,
    },
  },
};

And then on

CommunityCoupons.mdx

<!-- Custom-MDX-Documentation.mdx -->

# Replacing DocsPage with custom `MDX` content

This file is a documentation-only `MDX`file to customize Storybook's [DocsPage](https://storybook.js.org/docs/react/writing-docs/docs-page#replacing-docspage).

It can be further expanded with your own code snippets and include specific information related to your stories.

For example:

image image

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
rodrigomlpOzcommented, Sep 21, 2022

@rodrigomlpOz have you wrapped in Meta, Canvas and Story component from @storybook/addon-docs in story.mdx file?

If we look at the docs, adding Canvas/Story adds extra styling to the Docs tab, but they are not necessary. It should work with Markdown out of the box.

1reaction
TheColorRedcommented, Sep 21, 2022

I have recently started having this issue. It was working last week till I ran npm i

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Addon Docs not compiling MDX · Issue #9598 - GitHub
The Docs tab on each component is working. However this error comes as soon as I add an MDX file.
Read more >
Not able to create documentation in MDX for Angular ...
Here's how my MDX document looks like, I'm only trying to create a doc for an existing demo component that comes with the...
Read more >
Troubleshooting MDX
This article goes through several common problems and errors that might occur when using MDX.
Read more >
Working With MDX Custom Elements and Shortcodes
Create default Layout components that help format the MDX output. · Replace default HTML elements rendered from Markdown with custom components ...
Read more >
Rich docs with Storybook MDX
Customizable docs : Fully custom documentation made simple. ... load CSF can also load Storybook MDX with no additional integration needed.
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