New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cnguy/bs-react-highlight

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cnguy/bs-react-highlight

ReasonReact bindings for akiran/react-highlight

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bs-react-highlight

Introduction

ReasonReact bindings for react-highlight.

State: Published

Installation

1

  • With yarn

yarn add @cnguy/bs-react-highlight

  • With npm

npm install --save @cnguy/bs-react-highlight

2

Add @cnguy/bs-react-highlight to bsconfig.json bs-dependencies.

3

Add a highlight.js theme.

For example:

<html>
<head>
  <link
    rel="stylesheet"
    type="text/css"
    href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"
  />
</head>
<body>
  <div id="root" />
  <script src="bundle.js"></script>
</body>
</html>

Usage

Implicit:

let component = ReasonReact.statelessComponent("App");

let code = "
  function helloWorld() {
    console.log('Hello, world!')
  }
";

let make = _children => {
  ...component,
  render: _self => <Highlight> ...code </Highlight>
};

Explicit:

let component = ReasonReact.statelessComponent("App");

let code = "
    print(\"Hello, world!\")
  ";

let make = _children => {
  ...component,
  render: _self => <Highlight className="python"> ...code </Highlight>,
};

innerHTML:

let component = ReasonReact.statelessComponent("App");

let code = "
    <h1>Hello, world!</h1>
  ";

let make = _children => {
  ...component,
  render: _self => <Highlight innerHTML=true> ...code </Highlight>,
};

Changes

0.1.0

Release

Contributing

Development

yarn start # npm run start

Keywords

FAQs

Package last updated on 23 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc