Possible Duplicate:
Syntax highlighting language hints
Interface options for specifying language prettify
How do I set the language being highlighted in Stack Overflow to be colored and formatted for ruby?
I've seen this somewhere but can't find it now.
Something like a one line option at the top of a file.
1 Answer 1
You can't highlight a language with Markdown. You need to outsource this to external libraries. Such as.
EDIT: The StackOverflow way of doing this is to have a comment at the top. Like so.
<!-- language: lang-js -->
Just replace lang-js
with one of the language codes or a tag to set the language to the language associated with that tag. For example.
<!-- language: c# -->
Highlighting for c# is associated with the c# tag.
(use lowercase letters, uppercase letters like <!-- language: C# -->
does not work.)
-
Good point, my question was not clear so i added more detail.Michael Durrant– Michael Durrant2012年05月04日 01:18:44 +00:00Commented May 4, 2012 at 1:18
-
1+1 Yup, lang-rb for ruby worked for me (maybe I can do mutiple languages on one page even?)Michael Durrant– Michael Durrant2012年05月04日 01:30:24 +00:00Commented May 4, 2012 at 1:30
-
I would assume so.user184498– user1844982012年05月04日 01:33:26 +00:00Commented May 4, 2012 at 1:33
Explore related questions
See similar questions with these tags.