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.

using markdown in addon-notes do not work

See original GitHub issue

Describe the bug using markdown in addon-notes do not work

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Expected behavior show notes panel in the markdown way

Screenshots storybook

Code snippets config.js file:

import { configure, addDecorator } from '@storybook/react';
import { configureViewport } from '@storybook/addon-viewport';
import { withOptions } from '@storybook/addon-options';
import { withNotes } from '@storybook/addon-notes';

// automatically import all files ending in *.stories.tsx
const req = require.context('../stories', true, /.stories.(tsx|ts)$/);

function loadStories() {
  req.keys().forEach(req);
}


configureViewport({
  defaultViewport: 'iphone6'
});

// override option defaults:
addDecorator(withOptions({
  name: '',
  // url: 'https://github.com/vanilla-framework/vanilla-framework-react',
  addonPanelInRight: true,
}))
addDecorator(withNotes)

configure(loadStories, module);

index.stories.tsx file:

import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { Input } from '../src';



storiesOf('Button', module)
  // .addDecorator(withNotes('1'))
  .add('with text', () => {
    return <Input  />
  },{
    notes:{
      markdown:`
        ###

        1
        ###

        2
      `
    }
  })
  .add('with some emoji',  () => (
    <div onClick={action('button-click')}>click me,please!</div>
  ),{
    notes:'2'
  });


System:

  • OS: [e.g. iOS, Windows10, MacOS]
  • Device: [e.g. iPhoneX, Macbook Pro 2018]
  • Browser: [e.g. chrome, safari]
  • Framework: [e.g. react, vue, angular]
  • Addons: [if relevant]
  • Version: [e.g. 4.0.0]

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

3reactions
KiyaDoigcommented, Apr 11, 2019

+1 I would like to be able to use markdown in-line (without having to import or use const). Thank you.

I just worked it out. Try like:

storiesOf("Foo", module)
    .add("Bar",
        () => <div />,
        {
            notes: `
## Test
Test
            `,
        },
    );

Note it’s required that there is no indentation of the markdown contents otherwise it doesn’t work…

1reaction
transitorytammycommented, Jan 30, 2019

I am having the same issue (kinda). It seems like it is rendering the markdown but the formatting for the table in my markdown.

preview from my editor: screen shot 2019-01-30 at 11 58 31 am

what is showing in storybook: screen shot 2019-01-30 at 11 58 26 am

Read more comments on GitHub >

github_iconTop Results From Across the Web

using markdown in addon-notes do not work #5217 - GitHub
Describe the bug using markdown in addon-notes do not work To Reproduce Steps to reproduce the behavior: Go to '...' Click on '....
Read more >
Writing storybook inlined with markdown - Tomasz Pluskiewicz
There are addons but they are not presentable enough (addon-notes) or do not support all targets (addon-info). Here I present a different approach,...
Read more >
Markdown Support | PyCharm Documentation - JetBrains
The preview does not work on Android Studio. This is a known issue and there is a workaround: use JetBrains Runtime instead of...
Read more >
Storybook Addon Notes
Storybook Addon Notes allows you to write notes (text or HTML) for your ... Using Markdown in your notes is supported, Storybook will...
Read more >
storybook-addon-uxs - NPM Package Overview - Socket - Socket.dev
Using Markdown in your notes is supported, Storybook will load Markdown as raw by default. import { storiesOf } from '@storybook/react'; import ...
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