samutley74 downloadsSyntax highlighting for CRBasic (Campbell Scientific) markdown code blocks.
An Obsidian plugin that adds syntax highlighting for CRBasic — the programming language used by Campbell Scientific dataloggers (CR1000X, CR300, CR6, CR800, and others) — inside fenced markdown code blocks.
| Token | Examples |
|---|---|
| Keywords | BeginProg, EndProg, Scan, NextScan, If, Else, Sub, Public, Dim, For, While |
| Built-in functions | VoltSE, PanelTemp, Average, Sample, DataTable, GPS, SerialOpen, HTTPGet |
| Logical operators | AND, OR, NOT, MOD, XOR |
| Constants | True, False, As, LoggerType |
| Preprocessor | #If, #ElseIf, #EndIf |
| Strings | "Hello World" |
| Comments | ' this is a comment |
| Numbers | 3.14, 60, 1000 |
| Operators | =, <>, >=, +=, & |
Use the language identifier crbasic in a fenced code block:
```crbasic
' CR1000X example program
Public BattV As Float
DataTable(OneMin, True, -1)
DataInterval(0, 1, Min, 10)
Minimum(1, BattV, FP2, False)
EndTable
BeginProg
Scan(5, Sec, 1, 0)
Battery(BattV)
CallTable OneMin
NextScan
EndProg
```
main.js, manifest.json, and styles.css from the latest release.obsidian/plugins/codeblock-crbasic/ inside your vaultRequires Node.js 18+.
git clone https://github.com/utleysam/codeblock-crbasic.git
cd codeblock-crbasic
npm install --legacy-peer-deps
npm run build
The --legacy-peer-deps flag is required because the obsidian npm package has a peer dependency conflict with @codemirror/state versions.
After building, copy main.js, manifest.json, and styles.css to your vault's .obsidian/plugins/codeblock-crbasic/ folder.
| Obsidian version | Status |
|---|---|
| 1.12.7+ | ✅ Tested and working |
| Older versions | Not tested |
The plugin uses:
Plugin.registerEditorExtension() — available since Obsidian 0.13Plugin.registerMarkdownCodeBlockProcessor() — available since Obsidian 0.12This plugin provides syntax highlighting only. It does not include:
.cr1x / .cr8 filesToken lists derived from the Campbell Scientific VSCode CRBasic extension (daiwalkr.cr-basic-ms-vscode). CRBasic is a product of Campbell Scientific, Inc.