Code Prettify allows adding syntax highlighting to code blocks in Ghost blog posts. It works by adding JavaScript and CSS files. The JavaScript needs to be included on all pages via code injection. Additional CSS can be added to change the theme's styling of code blocks to have a colored background. The CSS file is added to the theme's folder and also via code injection. Markdown is then used to wrap code blocks in backticks with optional class names to trigger syntax highlighting.