Skip to content

Commit

Permalink
PrismJS line number example moved to Code example (#69)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kennylam authored and jzhang300 committed Jan 8, 2018
1 parent a1e6e8f commit 297c10b
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion example/src/components/CodeExamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function CodeExamples() {
</ul>
</div>`}
</Code>

</div>
<div className="block-code">
<Code language="jsx">
Expand All @@ -42,6 +41,37 @@ import { Code } from 'watson-react-components';
<p>See the PrismJS website for a list of <a className="base--a" href="http://prismjs.com/#languages-list">available languages</a>.</p>
</div>
</div>


<div className="row">
<div className="block-example">
<p>&nbsp;</p>
<Code language="html" lineNumbers>
{`<div>
<ul>
<li> foo </li>
<li> bar </li>
</ul>
</div>`}
</Code>
</div>
<div className="block-code">
<p>To enable line numbers, add <code>lineNumbers</code> attribute</p>

<Code language="jsx">
{`<Code language="html" lineNumbers>
{\`<div>
<ul>
<li> foo </li>
<li> bar </li>
</ul>
</div>\`}
</Code>
`}</Code>
</div>
</div>


</section>
);
}

0 comments on commit 297c10b

Please sign in to comment.