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:
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:
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:
Annotatable code without syntax highlightingIf 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.