From 297c10b7d231b1d83162253f9db25d1f5e84b96e Mon Sep 17 00:00:00 2001 From: kennylam Date: Mon, 8 Jan 2018 14:44:02 -0500 Subject: [PATCH] PrismJS line number example moved to Code example (#69) * added option for line numbers in prismjs codeblocks * moved PrismJS line number conditional out of inline markup * added lineNumbers propType to Code.js and removed inline boolean value from JsonLinkInlineExamples.js to remove lint warnings * moved line numbers examples from JsonLinkInline to Code component where it belongs * update line number example in Code Examples --- example/src/components/CodeExamples.js | 32 +++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/example/src/components/CodeExamples.js b/example/src/components/CodeExamples.js index a109269..58810f1 100644 --- a/example/src/components/CodeExamples.js +++ b/example/src/components/CodeExamples.js @@ -17,7 +17,6 @@ export default function CodeExamples() { `} -
@@ -42,6 +41,37 @@ import { Code } from 'watson-react-components';

See the PrismJS website for a list of available languages.

+ + +
+
+

 

+ +{`
+
    +
  • foo
  • +
  • bar
  • +
+
`} +
+
+
+

To enable line numbers, add lineNumbers attribute

+ + +{` +{\`
+
    +
  • foo
  • +
  • bar
  • +
+
\`} +
+`}
+
+
+ + ); }