This is for my own reference as much as anything else.
- Go here https://cdnjs.com/libraries/prism
- Copy the CSS and JS for the features and theme you want
- Add them as
<link>
or<script>
as appropriate to your code injection section in the Ghost Blog Admin (I put them in the footer) - Add the language to your Markdown code blocks
Code Injection Footer
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/prism.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/plugins/line-numbers/prism-line-numbers.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/themes/prism-okaidia.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/components/prism-csharp.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/components/prism-css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/components/prism-clike.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/components/prism-javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/components/prism-markdown.min.js"></script>
Markdown Sample
```csharp public static void sayHello(){ Console.WriteLine("Hello, world"); } ```
Displays as
public static void sayHello(){
Console.WriteLine("Hello, world");
}