import * as React from "react"; import SyntaxHighlighter from "react-syntax-highlighter"; import PrismSyntaxHighlighter from "react-syntax-highlighter/prism"; import PrismLightHighlighter, { registerLanguage } from "react-syntax-highlighter/prism-light"; import jsx from 'react-syntax-highlighter/languages/prism/jsx'; import { docco } from "react-syntax-highlighter/dist/styles/hljs"; import { atomDark } from "react-syntax-highlighter/dist/styles/prism"; function hljsHighlighter(): JSX.Element { const codeString: string = `class CPP { private year: number; public constructor(private version: string) { this.year = Number(version.match(/.+\d+$/)); } public version(): string { return this.version; } } `; return ( {codeString} ); } function prismHighlighter(): JSX.Element { const codeString: string = `class CPP { private year: number; public constructor(private version: string) { this.year = Number(version.match(/.+\d+$/)); } public version(): string { return this.version; } } `; return ( {codeString} ); } function primsLightHighlighter(): JSX.Element { const codeString: string = `class CPP { private year: number; public constructor(private version: string) { this.year = Number(version.match(/.+\d+$/)); } public version(): string { return this.version; } } `; registerLanguage('jsx', jsx); return ( {codeString} ) } function codeTagProps() { const codeString: string = `class CPP { private year: number; public constructor(private version: string) { this.year = Number(version.match(/.+\d+$/)); } public version(): string { return this.version; } } `; const codeTagProps = { className: 'some-classname', style: { opacity: 0, }, onMouseOver: (event: React.MouseEvent) => "foo", } return ( ) } function linePropsObject() { const codeString: string = `class CPP { private year: number; public constructor(private version: string) { this.year = Number(version.match(/.+\d+$/)); } public version(): string { return this.version; } } `; const lineProps = { otherProp: 'otherProp', className: 'some-classname', style: { opacity: 0, }, onMouseOver: (event: React.MouseEvent) => "foo" } return ( ) } function lineTagPropsFunction() { const codeString: string = `class CPP { private year: number; public constructor(private version: string) { this.year = Number(version.match(/.+\d+$/)); } public version(): string { return this.version; } } `; const lineProps = (lineNumber: number) => ({ otherProp: 'otherProp', className: 'some-classname', style: { opacity: 0, }, onMouseOver: (event: React.MouseEvent) => lineNumber * 5 }) return ( ) }