Scalar 2 User's Guide

Working with Source Code

Scalar offers the ability to embed and annotate source code. The process for including source code in your project depends on how you want it to appear and what you want to do with it.

Annotatable code and syntax highlighting (by default)

Scalar supports annotations and syntax highlighting by default for the following file formats:
 
ExtensionFormat
.cssCSS
.javaJava
.jsJavaScript
.xmlXML

Annotatable code and syntax highlighting (with a little extra work)

With two additional steps, Scalar will also support annotations and syntax highlighting for these file formats:
 
ExtensionFormat
.cC
.cppC++
.csC#
.htmlHTML
.phpPHP
.pyPython
.rbRuby

To enable annotations and syntax highlighting for these formats, you must do the following:
  1. Rename the file’s extension to .code before uploading to Scalar.
  2. After uploading, edit the file and add one of the following suffixes to its Media file URL depending on the language the code is written in:
 
SuffixFormat
?lang=cC
?lang=cplusC++
?lang=csharpC#
?lang=markupHTML
?lang=phpPHP
?lang=pythonPython
?lang=rubyRuby

Annotatable code without syntax highlighting

If you have source code not in one of the following formats which you still want to annotate, rename it’s file extension to .txt before uploading it to Scalar, and it will be treated as plain text without syntax highlighting.

This page has paths: