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

@storybook/addon-ondevice-notes: Markdown is very buggy #470

Open
LaurensUP opened this issue Apr 26, 2023 · 7 comments
Open

@storybook/addon-ondevice-notes: Markdown is very buggy #470

LaurensUP opened this issue Apr 26, 2023 · 7 comments

Comments

@LaurensUP
Copy link

LaurensUP commented Apr 26, 2023

These are my findings and bugs with the Notes addon for React Native:

  • Headers need a newline to get formatting
# Button
Some text

doesn't format the heading

  • If you put the newline, the rest of the content disappears
# Button

Some text

-> Formats the heading, but Some text disappears

  • Documentation says you need a new line between each element, but if you do that, the things below your element don't get rendered

  • If you don't add a new line between your element, it works, but everything in the Notes section is on one line

// Doesn't work
    *Button*

    \`\`\`
    <Button variant="primary" title="Activate" />
    \`\`\`
    Main **button** in the application

// Works, but everything is on one line...
    *Button*
    \`\`\`
    <Button variant="primary" title="Activate" />
    \`\`\`
    Main **button** in the application
@LaurensUP LaurensUP changed the title @storybook/addon-ondevice-notes Markdown doesn't work at all @storybook/addon-ondevice-notes Markdown is very buggy Apr 26, 2023
@LaurensUP LaurensUP changed the title @storybook/addon-ondevice-notes Markdown is very buggy @storybook/addon-ondevice-notes: Markdown is very buggy Apr 26, 2023
@dannyhw
Copy link
Member

dannyhw commented Apr 26, 2023

@LaurensUP yeah it's unfortunate, when I was trying to fix it I couldn't find any good libraries. I'll take another look.

@Michael-Ivlev
Copy link

Michael-Ivlev commented Jun 1, 2023

@dannyhw what is the best way to write docs and descriptions for the components?

@dannyhw
Copy link
Member

dannyhw commented Jun 1, 2023

@Michael-Ivlev seems pretty subjective to me and I'm not sure but it could be worth experimenting with this:

https://github.com/EvanBacon/expo-mdx/tree/main/packages/mdx

Then you could make custom render functions with mdx in them.

@dannyhw
Copy link
Member

dannyhw commented Jun 1, 2023

heres an example I was experimenting with just now

image

@Michael-Ivlev
Copy link

@dannyhw thank you but i use react native cli without expo,
is it possible to use markdown in notes ? how can i do it ?

@dannyhw
Copy link
Member

dannyhw commented Jun 1, 2023

@Michael-Ivlev as far as I know it doesn't require expo
Notes isn't worth investing time into because the addon is deprecated on storybook core
Though I mean technically I could make a NotesMdx addon that requires the MDX transformer

@dannyhw
Copy link
Member

dannyhw commented Oct 22, 2023

Notes addon will be fixed to use a better markdown renderer in v7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants