prism.js – How to enable code snippets on a Worpress-powered blog

Thanks to David Walsh, now my blog is powered by PrismJS, a very powerful syntax highlighting plugin based on pure JS (so yes, is it YOU that are rendering this beautiful code snippets!)

This is just a sample page, where I want to test some Java, HTML, CSS, JS, XML, YAML and JSON.

Some HTML:

      <p>I'm some code.</p>

Few lines of XML:

< ?xml version="1.0" encoding="utf-8"?>
  <node with-attribute="valueof"></node>

Yes, I need CSS:

p { color: red !important; }

But more important, Java:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello, World");


And..yes, it works pretty fine!
Thanks also to Chris Coyer article on Worpress tricks on code posting and to this quick how-to

Latest articles

Written by:

One Comment

  1. 12/2/2019

    Hello Matteo ,
    Google can read it CSS, JS ?

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

6 − uno =