Storybook-readme: Avoid code highlighting on stories

Created on 4 Jun 2019  路  5Comments  路  Source: tuchk4/storybook-readme

Hello,

first of all, thank you for this addon, it's really good! :) We're using it here at @algolia and we love it!

I just have one request, would it be possible to avoid injecting the github code highlighting style to the story panel, and only keep it active on the sidebar panel?

Here is the thing, we do have a component with some custom code highlighting, but it gets overriden by the github code highlighting coming from your addon, which makes our component looks different than how it should look.

Is it something doable on your end? Like having a global config like:

.addParameters({
    readme: {
        codeHighlight: <story|sidebar>
    }
});

?

Thanks in advance :)

Lucas B.

All 5 comments

@LukyVj Thanks for feedback! :)

It is easy to implement this feature.
I am going to release new minor version at the end of this week and it will include this feature.

Hello @tuchk4 ! Any update on this?

Sorry for the delay, had a lot of work

released in 5.0.4

/**
  * Enable / disable code highlighting for sidebar. true by default
  */
  highlightSidebar: true,

/**
  * Enable / disable code highlighting for content. true by default
  */
  highlightContent: true,
storiesOf('Button', module)
  .addParameters({
    readme: {
      codeTheme: 'duotone-sea',
      content: ButtonReadme,
      sidebar: ButtonUsage,
      highlightContent: false,
      highlightSidebar: false,
    },
  })
  .add('Button', () => <Button label={'Hello Im Button'} />)

Thanks a lot! you're a 猸愶笍

@LukyVj could you check it please and ping me if something wrong

Was this page helpful?
0 / 5 - 0 ratings

Related issues

beyondghx picture beyondghx  路  6Comments

mktrue picture mktrue  路  3Comments

JamesBliss picture JamesBliss  路  5Comments

robcaldecottvelo picture robcaldecottvelo  路  5Comments

jayknott picture jayknott  路  6Comments