سؤال

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?
هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top