Thanks for your patience during our recent outage at scalar.usc.edu. While Scalar content is loading normally now, saving is still slow, and Scalar's 'additional metadata' features have been disabled, which may interfere with features like timelines and maps that depend on metadata. This also means that saving a page or media item will remove its additional metadata. If this occurs, you can use the 'All versions' link at the bottom of the page to restore the earlier version. We are continuing to troubleshoot, and will provide further updates as needed. Note that this only affects Scalar projects at scalar.usc.edu, and not those hosted elsewhere.
Scalar 2 User's GuideMain MenuGetting StartedExplains account and book creation, and some interface basics.QuickStartsA path of all QuickStart content in this user's guide.Working with MediaHow to get the most out of your use of media in Scalar.Working with ContentCreating and editing content in Scalar.Working with WidgetsWorking with StructureHow to use Scalar's many options for structuring publications.Editorial WorkflowHow to use features for performing editorial review of content.VisualizationsExploring the contents of a book visually.LensesAn introduction to lenses, a tool for searching and visualizing Scalar content.Advanced TopicsDescribing Scalar's more advanced features.Third Party Plugins and Platforms
Working with Source Code
12017-02-01T10:43:57-08:00Erik Loyerf862727c4b34febd6a0341bffd27f168a35aa63732965How to enable syntax highlighting and annotations on your source code media.plain2017-02-01T10:48:11-08:00Erik Loyerf862727c4b34febd6a0341bffd27f168a35aa637
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:
Extension
Format
.css
CSS
.java
Java
.js
JavaScript
.xml
XML
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:
Extension
Format
.c
C
.cpp
C++
.cs
C#
.html
HTML
.php
PHP
.py
Python
.rb
Ruby
To enable annotations and syntax highlighting for these formats, you must do the following:
Rename the file’s extension to .code before uploading to Scalar.
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:
Suffix
Format
?lang=c
C
?lang=cplus
C++
?lang=csharp
C#
?lang=markup
HTML
?lang=php
PHP
?lang=python
Python
?lang=ruby
Ruby
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:
12014-10-01T16:38:34-07:00Erik Loyerf862727c4b34febd6a0341bffd27f168a35aa637Working with MediaErik Loyer9How to get the most out of your use of media in Scalar.plain2025-02-25T08:44:35-08:00Erik Loyerf862727c4b34febd6a0341bffd27f168a35aa637