How do I use code formatting in my emails?

We use tgethr a lot here at Inkling and we develop software. So we tend to collaborate around snippets of code. Now in tgethr you can easily post or email code to your group and have that code highlighted so that it’s much easier to read with everyone’s comments. Even the emails that your group receives with that code will have the code prettied up (as long as your email client supports css, GMail has some issues here).

To use it, whenever you email or post code into tgethr wrap the code part like this:

  @@@language

  your code

  @@@

“language” is the type of code you are using in case you want special formatting. css/ruby/html for example. So if you want to paste ruby you write:

 @@@ruby

 your ruby code

 @@@

We are using the syntax highlighting engine called Ultraviolet and here’s a huge list of all the languages it supports:

—————

actionscript, active4d, active4d_html, active4d_ini, active4d_library, ada, antlr, apache, applescript, asp, asp_vb.net, bibtex, blog_html, blog_markdown, blog_text, blog_textile, build, bulletin_board, c, c++, cake, camlp4, cm, coldfusion, context_free, cs, css, css_experimental, csv, d, diff, dokuwiki, dot, doxygen, dylan, eiffel, erlang, f-script, fortran, fxscript, greasemonkey, gri, groovy, gtd, gtdalt, haml, haskell, html, html-asp, html_django, html_for_asp.net, html_mason, html_rails, html_tcl, icalendar, inform, ini, installer_distribution_script, io, java, javaproperties, javascript, javascript+prototype, javascript+prototype_bracketed, jquery_javascript, json, languagedefinition, latex, latex_beamer, latex_log, latex_memoir, lexflex, lighttpd, lilypond, lisp, literate_haskell, logo, logtalk, lua, m, macports_portfile, mail, makefile, man, markdown, mediawiki, mel, mips, mod_perl, modula-3, moinmoin, mootools, movable_type, multimarkdown, objective-c, objective-c++, ocaml, ocamllex, ocamlyacc, opengl, pascal, perl, php, plain_text, pmwiki, postscript, processing, prolog, property_list, python, python_django, qmake_project, qt_c++, quake3_config, r, r_console, ragel, rd_r_documentation, regexp, regular_expressions_oniguruma, regular_expressions_python, release_notes, remind, restructuredtext, rez, ruby, ruby_experimental, ruby_on_rails, s5, scheme, scilab, setext, shell-unix-generic, slate, smarty, sql, sql_rails, ssh-config, standard_ml, strings_file, subversion_commit_message, sweave, swig, tcl, template_toolkit, tex, tex_math, textile, tsv, twiki, txt2tags, vectorscript, xhtml_1.0, xml, xml_strict, xsl, yaml, yui_javascript

—————

We’ll hopefully have a post soon about some of the tricks to implementing Ultraviolet in your own application.

The results look like this when you’re using it:

image

Hope you like.

Recent Discussions

17 Feb, 2012 09:07 PM
30 Jan, 2012 08:45 PM
10 Aug, 2009 11:58 PM
15 Nov, 2011 10:53 PM