How to use the react-syntax-highlighter/dist/prism-light.registerLanguage 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 DiceBear / avatars / server / components / introductions.tsx View on Github external
import * as React from 'react';
import SyntaxHighlighter, { registerLanguage } from 'react-syntax-highlighter/dist/prism-light';
import js from 'react-syntax-highlighter/dist/languages/prism/javascript';
import prism from 'react-syntax-highlighter/dist/styles/prism/prism';

import { Meta, MetaSpriteCollection } from '../types/meta';

registerLanguage('javascript', js);

type Props = {
  meta: Meta;
};

export default class Introductions extends React.Component {
  getHttpApiDescription() {
    let spriteCollections = this.props.meta.spriteCollections.map((spriteCollection, index, array) => {
      // Is penultimate entry
      if (index === array.length - 1) {
        return (
          
            <code>{spriteCollection.id}</code>
          
        );
      }
github markmur / react-slack-feedback / demo / index.js View on Github external
registerLanguage
} from 'react-syntax-highlighter/dist/prism-light'
import jsx from 'react-syntax-highlighter/dist/languages/prism/jsx'
import json from 'react-syntax-highlighter/dist/languages/prism/json'
import syntax from 'react-syntax-highlighter/dist/styles/prism/atom-dark'

import SlackFeedback from '../src/slack-feedback'
import defaultTheme from '../src/themes/default'
import darkTheme from '../src/themes/dark'

import { version } from '../package'

import './index.css'

registerLanguage('json', json)
registerLanguage('jsx', jsx)

const themes = {
  default: defaultTheme,
  dark: darkTheme
}

const root = document.querySelector('#root')

const parseJSON = res => res.json()

const API_URL = 'http://localhost:8080/api'

const sendToSlack = (payload, success, error) => {
  if (process.env.USE_SERVER) {
    return success()
  }
github markmur / react-slack-feedback / demo / index.js View on Github external
import SyntaxHighlighter, {
  registerLanguage
} from 'react-syntax-highlighter/dist/prism-light'
import jsx from 'react-syntax-highlighter/dist/languages/prism/jsx'
import json from 'react-syntax-highlighter/dist/languages/prism/json'
import syntax from 'react-syntax-highlighter/dist/styles/prism/atom-dark'

import SlackFeedback from '../src/slack-feedback'
import defaultTheme from '../src/themes/default'
import darkTheme from '../src/themes/dark'

import { version } from '../package'

import './index.css'

registerLanguage('json', json)
registerLanguage('jsx', jsx)

const themes = {
  default: defaultTheme,
  dark: darkTheme
}

const root = document.querySelector('#root')

const parseJSON = res => res.json()

const API_URL = 'http://localhost:8080/api'

const sendToSlack = (payload, success, error) => {
  if (process.env.USE_SERVER) {
    return success()