1.0.0 • Published 4 years ago

@lunit/mdx-code-block v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

How to Use

npm install @lunit/mdx-code-block
import { MDXCodeBlock } from '@lunit/mdx-code-block';

const components = {
  pre: props => <div {...props} />,
  code: MDXCodeBlock,
};

export function App() {
  return (
    <MDXProvider components={components}>
      <Content/>
    </MDXProvider>
  );
}
import { CodeBlock } from '@lunit/mdx-code-block';

function Component(sourceCode: string) {
  return (
    <CodeBlock language="js">{sourceCode}</CodeBlock>
  )
}