Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind.
<pre class="code-highlighter line-numbers theme-dark" data-line="4">
<code class="language-markup">
escapar os caracteres ( < > & © etc )
</code>
</pre>
If you need re-run PrismJS on AJAX content, use:
Prism.highlightAll();
Use .theme-light
and .theme-dark
.
<div id="container1">
<img src="sample-before.png">
<img src="sample-after.png">
</div>
<div id="container1">
<img src="sample-before.png">
<img src="sample-after.png">
</div>
<pre class="code-highlighter line-numbers theme-{dark|light}">
<code class="language-markup">
escapar os caracteres ( &lt; &gt; &amp; &copy; etc )
</code>
</pre>
code-highlighter
: Use in <pre> elementline-numbers
theme-light
theme-dark
text-break
: Use in <pre> element for break lineUse language-{language}
:
markup
css
clike
javascript
aspnet
bash
csharp
ruby
git
http
ini
java
json
markdown
php
powershell
python
scss
sql
textile
yaml
.language-javascript
function sumAll() {
var i, sum = 0;
for (i = 0; i < arguments.length; i++) {
sum += arguments[i];
}
}
.language-json
{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
{"firstName":"John", "lastName":"Resig"}
]}
.language-css
ol > li, ul > li { padding: 0; }
ol, ul { list-style-type: none; margin: 0; padding: 0; }
iframe { border: 0; }
.language-git
$ git clone https://github.com/umbler/umbootstrap.git
$ cd getting-started
<pre class="code-highlighter theme-dark">
<code class="language-{javascript|json|css|git}">
...
</code>
</pre>