C++ syntax highlighting html generator - syntax-highlighting

I'm writing blog posts for my company blog and I would like code snippets to show up with syntax highlighting.
All I can do is write html/css.
Is there any app/webapp that will let me paste in a c++ code snippet and get a chunk of html with the highlighting?

Try this Online syntax highlighting Site, and especially the C++ section.
You paste in your code and it does the hard work.

I use emacs M-Xhtmlize-bufferRET. Also enscript is very powerful to generate colorized HTML from many source code formats.

For others looking for a solution to this problem - you should checkout:
http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html
It's a really easy "SyntaxHighlighter for Blogger" tutorial with screenshots and everything.
You should be up and running in only a few minutes.
Also, for your C++ application, make sure you have the shBrushCpp.js library referenced in your <head></head> section like this:
<head>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
</head>

Have a look at http://www.syntaxhighlight.com - supporting 222 languages. Paste your code and get the formatted html.

Related

Ace editor / embed multiple syntax highlight

I'm using ace editor with "html" mode for web programming as a web IDE. I can highlight code for HTMl, CSS and JavaScript. It works nicely. This is my code:
editor.getSession().setMode('ace/mode/html');
I'd like to embed coffeescript and typescript syntax highlight too when using the
<script type='text/coffeescript'>
and
<script type='text/typescript'>
tags on the page. Ace does have modes for these languages but they are separate files (mode-coffee.js and mode-typescript.js) and I don't know how I could embed these into mode-html.js. The code is rather complicated.
Could you kindly help me out? I've been studying these files for several hours now and I'd appreciate any help. Thank you.
This is currently not possible. We are looking into adding this as a feature, which is being tracked by a GitHub issue here.

Is there an editor (or a solution for kate) doing syntax highlighting in a mixed code?

I'm using Kate as the editor of my Node.js projects. In the Node.js projects, I sometimes prefer to code whole index.html in a single file. At that time, I need to use:
html
css (<style>...</style>)
livescript (<script type="text/ls">...</script>)
javascript (<script [type="text/javascript"]>...</script>)
at the same time. Kate can highlight these codes if they are in their separate files.
How can I make the code highlighted correctly when they are mixed in a single file (preferably in Kate, or any other editor that would run on Linux)?
Kate can do this, too. It is supported in e.g. HTML/PHP highlighting and similar. Just have a look into the respective highlighting xml files to get an idea how to implement a highlighting for this. More information about how to write syntax highlighting files can be found in the KatePart Handbook.

CKEditor - have it return markdown syntax instead of HTML

I'm working on a CMS platform and I am planning to use CKEditor as it seems to offer everything I need.
One thing that is a bit of a bother to me is that I want my content to be in markdown format instead of html and while I found a BBCode extension for this, I couldn't figure out how it can be remade to support markdown.
I tried to find an editor that does markdown out of the box, but the ones I found are way too simple for what I need and CKEditor has the benefit of having a plugin system to adjust perfectly for me.
CKEditor now has a Markdown addon that does this exact thing. The addon project is hosted on github.
Screenshots:
See also: Integrated Markdown WYSIWYG text editor (2012)
Using Markdown instead of HTML is a very bad idea for several reasons:
Markdown has no spec, so every library works differently in details. The output which you'll produce using CKEditor may give a different (even totally wrong) result when transformed to HTML by your back-end. For example - escaping image's title and link texts - you won't be able to ensure that the text user inserted does not break the output.
Not all HTML can be transformed to Markdown.
There are plenty of tricky cases which are totally correct in HTML, but cannot be done in Markdown.
Markdown has fewer features than HTML, so you'd lose some content which users produced.
You actually gain nothing by using Markdown instead of HTML.
I am a CKEditor core developer, so I know it very well. I tried to implement a Markdown writer for CKEditor and very quickly I found that it's completely pointless. I don't say that it's not possible, because it is, but only a limited stability can be achieved - too low for anything I would personally want to use in production.

How to insert HTML/javascript/css code in joomla article

I am using Joomla 1.5. and I am writing a blog in joomla and want to highlight some HTML and javascript code but when I save that article after inserting the HTML code as it is, it gets exicuted itself. I also tried it with codecitation plugin but no result. If you people have any solution then please reply.
Use a <pre> tag it should work.
e.g.
<pre><html><\html></pre>
In your blog try "& lt;" (without space) to write < and "& gt;" (without space) to write > in your HTML Code.
This syntax is used to write "<" and ">" symbols on some web page. Otherwise it will treat your code as part of the blog article and will show its output.
You can use <pre> and <code> tags.
Also Joomla has a native plugin to display code and syntax highlighting, based on the Geshi project.
It's easy to use, just be sure it is enabled in your plugins config:
<pre lang="html" >
<p> some text </p>
</pre >
Hope it helps!
Use the a jQuery highlighter.
Sorry for coming late to the party.
I used an extension called Easy Script. Just download, install and paste your script in your article manager and Boom. It even supports Bootstraps and other scripts as well.. Just give is a trial
Easy Script

Visual Studio Blog

I want to write a blog and some of the blogs that I've seen on the Internet have code snippets in VB.NET or C# that look like the text in Visual Studio itself even with the colors.
Is there some sort of application or tool I can use to create code snippets that look like those other blogs.
google-code-prettify is a good one.
Also, SyntaxHighlighter looks great, but I haven't tried it myself. It has explicit support for VB.NET.
If you're using Windows Live Writer for a blog editor I recomend using "Paste from Visual Studio" (link). It's a great way of getting formatted code into your blog posts.
I use this site to convert my code to HTML-formatted text for my blog. Works nicely.
If you don't mind using another application, Notepad++ exports your files to HTML.
Just open your *.cs files and go to Plugins > NppExport > Export to HTML. Fonts and colors are preserved, as defined in your Notepad++ configuration.
FYI, Notepad++ exports to HTML 4.01

Resources