How to use the react-syntax-highlighter/dist/styles.tomorrowNight.hljs function in react-syntax-highlighter

To help you get started, we’ve selected a few react-syntax-highlighter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github agermanidis / livepython / src / components / CodeView.js View on Github external
import React, {Component} from 'react'
import jq from 'jquery'

import SyntaxHighlighter from 'react-syntax-highlighter'
import { tomorrowNight } from 'react-syntax-highlighter/dist/styles'

tomorrowNight.hljs.background = 'none'
tomorrowNight.hljs.padding = 0

class CodeView extends Component {
  constructor() {
    super();
    this.state = {
      activity: null,
      intervalId: null
    };
  }

  spaceFixedLineNumber(curLine, totLines) {
    return (
      "\u00a0".repeat(totLines.toString().length - curLine.toString().length) +
      curLine.toString()
    );
github agermanidis / livepython / src / components / CodeView.js View on Github external
import React, {Component} from 'react'
import jq from 'jquery'

import SyntaxHighlighter from 'react-syntax-highlighter'
import { tomorrowNight } from 'react-syntax-highlighter/dist/styles'

tomorrowNight.hljs.background = 'none'
tomorrowNight.hljs.padding = 0

class CodeView extends Component {
  constructor() {
    super();
    this.state = {
      activity: null,
      intervalId: null
    };
  }

  spaceFixedLineNumber(curLine, totLines) {
    return (
      "\u00a0".repeat(totLines.toString().length - curLine.toString().length) +
      curLine.toString()
    );
  }