1.12.3 • Published 2 years ago

@patternfly/pfe-codeblock v1.12.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

PatternFly Elements Codeblock

Render code in a styled and formatted way

Read more about Codeblock in the PatternFly Elements Codeblock documentation

Installation

Load <pfe-codeblock> via CDN:

<script src="https://unpkg.com/@patternfly/pfe-codeblock?module"></script>

Or, if you are using NPM, install it

npm install @patternfly/pfe-codeblock

Then once installed, import it to your application:

import '@patternfly/pfe-codeblock';

Usage

<h2>HTML Markup</h2>
<pfe-codeblock code-language="markup">
<pre codeblock-container>
<code>
&#x3C;h1&#x3E;example html&#x3C;/h1&#x3E;
&#x3C;p&#x3E;some paragraph text&#x3C;/p&#x3E;
</code>
</pre>
</pfe-codeblock>

<h2>Javascript Markup</h2>
<pfe-codeblock code-language="javascript">
<pre codeblock-container>
<code>
const example="javascript";
let test=null;
</code>
</pre>
</pfe-codeblock>

Caveats

This component, when imported, disabled Prism.js global autoHighlighting. To restore the default behaviour, enable auto highlight before loading <pfe-codeblock>'s script

window.Prism = { manual: false };
2.0.0-next.2

2 years ago

2.0.0-next.1

2 years ago

1.12.3

2 years ago

2.0.0-next.0

2 years ago

1.12.2

2 years ago

1.12.1

2 years ago

1.12.0

2 years ago

1.11.2

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.3

3 years ago

1.9.1

3 years ago

1.9.2

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago