Using prettify on StackOverflow for syntax highlighting code - syntax-highlighting

I just knew that I can syntax highlight code blocks here using Prettify but I don't really get the idea. Somebody edited my other question by highlighting my code but I would like to know how I can do it myself so I can present my code problems in a nicer way.
I followed other similar question and answer here and downloaded Prettify source files comprised with set of javascript but I don't expect to upload any of those on StackOverflow to be able to syntax highlight my code here.
Can anyone explain this in a way that I can understand?

Related

I can not get pigments highlighting for Python to work in my Sphinx documentation

I've tried adding highlight_language and pygments_style in the config.py and also tried various ways I found online inside the .rst file. Can anyone offer any advice on how to get the syntax highlighting working?
Sorry, it turns out that program arguments aren't highlighted (the test I was using)

Ace Editor Custom Syntax

This is my last attempt before I completely give up. I am trying to use the Ace Editor; so far it has worked really well for existing languages but I do not find the documentation good enough to guide me on how to create a custom syntax highlighter.
I know this is a very broad question, but can anybody point me in the right direction of a decent tutorial or some pointers on how the hell to get this custom highlighter working!?
The Ace Editor tutorial just mentions two files, doesn't really explain the content very well, where to put the files (as the lib/ace/mode folder doesn't exist in the pre-packaged version), or how to change the formatting etc.
Appreciate any help.
If you want to write your mode in packed mode, then you need to copy one of existing mode files, rename it to mode-mymode.js and use define("ace/mode/mymode", define("ace/mode/mymode_highlight_rules" instead of using several files

Code highlighting problems with prettify in VoltRb

I've been having some problems getting the JavaScript prettify library to work on a project in VoltRb. The problem is that the code highlighting seems to work only when an error occurs and the page is reloaded. I think that the problem has something to do with Volt's persistent connection and that part of the problem is the prettify script is not finding the elements it needs to find, and any custom themes are also having the same problem.
Here is a simple demo project demonstrating my issue: https://github.com/ylluminarious/code_prettify_volt
How can I get code highlighting working with prettify in Volt?
As it turns out, prettify is not a good solution for code-highlighting in Volt, as it is more geared for static apps. A better solution is highlight.js (since it is more geared for dynamic apps), which actually has been incorporated into a Volt component which works very well for all your highlighting needs.

color code editor for sass scss windows

I am looking for the simple color code software to edit scss file for windows.
I am sorry if the question is repeated but i am tired of searching and found mostly broken files.
Please Suggest
I'm making the assumption that you are asking for a windows text-editor that supports SCSS syntax highlighting, and not a color-picking utility.
If so, I would recommend
notepad++ with user defined SCSS hightlighting [EDIT - old link broke, swapping out for new one] that you can download here or another here
or, if you are willing to pay $60, Sublime Text 2 is the best windows/mac/linux text editor (IMHO). There is a SCSS Plugin that should have everything you need.
If that is not what you are looking for, please clarify your question so we can help you better.

BlogEngine.Net Code Formatting Extension that works?

For months now I've been trying to find a code syntax formatting extension that works for BlogEngine.Net. I'm not fond of the behavior of the default formatting extension, and have tried a couple of others (manoli is among them), but they always seem to interact badly with the TinyMCE editor. Does anyone know of an extension that works, or a different approach that will allow me to make code samples pretty on my blog without hacking the crap out of the HTML myself?
Thanks.
I would try using Windows Live Writer along w/ the Paste From Visual Studio plugin. One you go WLW, you'll never go back to that damn TinyMCE interface.
WLW here:
http://get.live.com/writer/overview
Plugin here:
http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&l=8
Thanks, Rafe. Thanks to this post that Hanselman put up the day after I asked the question, I downloaded WLW and am now using it. As far as getting prettily formatted code, I'm using cut-and-paste from a little tool developed and available on manoli.net.
Check out SyntaxHighlighter.. Works excellent. For easy integration into BlogEngine have a look at my blog post.

Resources