1.1.3 • Published 5 years ago

react-highlight-codeblock v1.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Highlight CodeBlock

npm.io npm.io npm.io npm.io npm.io

Syntax highlighting component based on react-syntax-highlighter development.

Install

npm install react-highlight-codeblock --save

Usage

import CodeBlock from 'react-highlight-codeblock'

Syntax highlighting of single code snippet

<CodeBlock
    code={strCode}
    callback={code => console.log(code)}
    editer={true}
    language="html"
    style="monokai"
    showLineNumbers={false}
/>

props

  • code - code snippet presentation and editing.
  • editer - default to false, is it editable.
  • style - the style to highlight code in. Available options here for hljs.do not use the default style.
  • language - the language to highlight code in. Available options here for hljs .
  • callback is used with the editer attribute as a post-edit callback function.
  • showLineNumbers if this is enabled line numbers will be shown next to the code block.
1.1.3

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago