Question

I've installed Orchard 1.7.0, enabled markdown for blog posts (roughly as detailed here) but I'm unable to figure out how to add syntax highlighting for C# (or any language) to my posts.

  • Does Orchard have the facility to add syntax highlighting for markdown? or
  • How does stackoverflow add syntax highlighting?
  • Will Syntax Highlighter for Orchard produce the desired effect?
Was it helpful?

Solution

StackExchange uses Google Code Prettify (see here) and there is an Orchard module TheMonarch.SyntaxHighlighter that sets this up.

This module uses Google code prettify to add syntax highlighting to Orchard Blog posts. Choose from several themes bundled from the Admin UI. Google code prettify automatically detects most languages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top