Ghost Blog and Syntax Highlighting
Just a quick post as this took me a bit of working out. I want to start having some code snippets on here, obviously formatted nicely and with syntax highlighting. As most of my code is c# there were a couple of steps I had to follow to get it to work.
I'm not going to go into how to add prism in detail as there are plenty of posts about that, this is more to specifically get c# snippets working.
So it turns out as well as needing the css file (prism-okaidia for example) and the core js (prism.min.js) and csharp (prism-csharp.min.js) scripts pulled down, you also need 2 more as well
prism-c.min.js
prism-clike.min.js
This is because the prism-csharp.min.js has a dependency on prism-clike.min.js and that in turn has one on prism-c.min.js. Once you reference all these files from the CDN (https://cdnjs.com/libraries/prism) your csharp snippets should start to show up nicely, like:
/// <summary>
/// I am a test class
/// </summary>
public class TestClass1
{
private string _string1 {get; set;}
public string String1 {get;}
}