Testing prism
See how codes are rendered using "highlight.js"
Ruby
variable = "test"
if variable
# This will put the content of variable
puts variable
result = 1 + 3
puts result
end
PHP
<?php
$test = "hello world";
echo $test;
$SomeObject = new SomeObject();
?>
HTML
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
Summary
- Download two files to use Prism: prizm.js and prisim.css.
These files can be downloaded from the link below.
- And then, you just need to include the js and css to the page which containes codes you want to highlight.
- You can see how it's doen by seeing the source codes of this html page.(Simply, use
<link> for the css, <script> for the js