Skip to content
Novus Examples

Source code

The source-code category is a syntax-highlighting, linting, and parser fixture set: idiomatic hello-worlds plus realistic snippets across many languages, all original and documented. HTML, CSS, JavaScript, and TypeScript (shipped as .mts to sidestep the MPEG-TS .ts collision) cover the web front-end; Python, Ruby, PHP, and Shell the scripting side; Java, Kotlin, Swift, Go, and Rust the application languages; C and C++ the systems layer; SQL the database; and Wave G adds Julia, Haskell, Lua, R, Clojure, Fortran, and Nim. Intentionally invalid lint fixtures are clearly labelled. A tiny multi-language monorepo ZIP accompanies the set for unpack-then-lint pipelines. Everything text-previewable opens in the in-browser editor.

Filter source code on Browse · 125 files · 31 subcategories

125 of 125 files

C

Preview of C — Hello World
c
123 B
Actual file preview for C — Hello World

C — Hello World

The classic hello-world in C — an include, main, and printf — for testing highlighters, C compilers, and parsers against the canonical first program.

File
C · C

Clojure

C++

Preview of C++ — Series (class template, STL)
cpp
924 B
Actual file preview for C++ — Series (class template, STL)

C++ — Series (class template, STL)

A realistic C++ snippet with a class template, STL algorithms (max_element, accumulate), std::move, and range handling — for testing highlighters, g++/clang++, and parsers against real templates.

File
CPP · C++

Csharp

Css

Preview of CSS — Hello World
css
205 B
Actual file preview for CSS — Hello World

CSS — Hello World

A minimal stylesheet that centres a heading with grid — the simplest useful CSS file for testing highlighters, CSS parsers, and minifiers.

File
CSS · Css

Dart

Elixir

Fortran

Go

Preview of Go — Hello World
go
111 B
Actual file preview for Go — Hello World

Go — Hello World

The classic hello-world in Go — package main, an import, and fmt.Println, tab-indented like gofmt — for testing highlighters, the Go compiler, and parsers.

File
GO · Go

Haskell

HTML

Preview of HTML — Hello World
html
220 B
Actual file preview for HTML — Hello World

HTML — Hello World

A minimal, valid HTML5 document — doctype, head, and a single heading — for testing HTML parsers, highlighters, and validators against the simplest well-formed page.

File
HTML · HTML
Preview of HTML — Semantic article page
html
1 KB
Actual file preview for HTML — Semantic article page

HTML — Semantic article page

A realistic semantic HTML page with landmark elements (header, nav, main, article, footer), a figure with alt text and caption, and lists — for testing HTML parsers, accessibility tooling, and highlighters.

File
HTML · HTML

Java

Preview of Java — Hello World
java
163 B
Actual file preview for Java — Hello World

Java — Hello World

The classic hello-world in Java — a public class with the standard main method — for testing highlighters, javac, and Java parsers.

File
JAVA · Java

JavaScript

JSON

Julia

Kotlin

Lua

Monorepo

Nim

PHP

Preview of PHP — Invoice (enum, class, promoted properties)
php
1.1 KB
Actual file preview for PHP — Invoice (enum, class, promoted properties)

PHP — Invoice (enum, class, promoted properties)

A realistic modern-PHP snippet with strict types, a namespace, a backed enum, a final class with constructor-promoted readonly properties, and array_reduce with an arrow function — for testing highlighters, PHPStan, and parsers.

File
PHP · PHP

Python

Preview of Python — Hello World
py
168 B
Actual file preview for Python — Hello World

Python — Hello World

The classic hello-world in idiomatic Python 3, with a shebang, a module docstring, and the standard main guard — the minimal correct program for testing highlighters and interpreters.

File
PY · Python

R

Ruby

Rust

Preview of Rust — Shapes (enum, trait, pattern matching)
rs
942 B
Actual file preview for Rust — Shapes (enum, trait, pattern matching)

Rust — Shapes (enum, trait, pattern matching)

A realistic Rust snippet with an enum carrying data, a trait and impl, exhaustive match, iterators, and Option handling — for testing highlighters, rustc, clippy, and parsers against real ownership-era code.

File
RS · Rust

Scala

Shell

Preview of Shell — Backup script (strict mode, functions)
sh
706 B
Actual file preview for Shell — Backup script (strict mode, functions)

Shell — Backup script (strict mode, functions)

A realistic Bash script using strict mode (set -euo pipefail), functions, default parameters, a loop, and conditionals — an illustrative fixture (review before running) for testing highlighters, ShellCheck, and shfmt.

File
SH · Shell
Preview of Shell — Hello World
sh
79 B
Actual file preview for Shell — Hello World

Shell — Hello World

The classic hello-world in Bash — a shebang and echo, with LF line endings so it runs on Unix — for testing highlighters, ShellCheck, and shell parsers.

File
SH · Shell

Sql

Preview of SQL — Hello World
sql
72 B
Actual file preview for SQL — Hello World

SQL — Hello World

The classic first query in SQL — a single SELECT of a literal — for testing highlighters, SQL parsers, and query editors.

File
SQL · Sql
Preview of SQL — Library schema (DDL, view, join)
sql
994 B
Actual file preview for SQL — Library schema (DDL, view, join)

SQL — Library schema (DDL, view, join)

A realistic SQL script with CREATE TABLE constraints and foreign keys, INSERT seed data, a CREATE VIEW, and a grouped aggregate query with a join — for testing SQL parsers, formatters, and highlighters.

File
SQL · Sql

Swift

Preview of Swift — Task list (struct, protocol, optionals)
swift
1013 B
Actual file preview for Swift — Task list (struct, protocol, optionals)

Swift — Task list (struct, protocol, optionals)

A realistic Swift snippet with an enum, a protocol, a struct with a computed property, optionals and optional binding, and higher-order functions — for testing highlighters, the Swift compiler, SwiftLint, and parsers.

File
SWIFT · Swift

TypeScript

Preview of TypeScript — Hello World
mts
144 B
Actual file preview for TypeScript — Hello World

TypeScript — Hello World

The classic hello-world in TypeScript (shipped as .mts to avoid the MPEG-TS .ts collision) — a typed function for testing TypeScript-aware highlighters and the tsc compiler.

File
MTS · TypeScript
Preview of TypeScript — Shapes (union, generics, enum)
mts
1.1 KB
Actual file preview for TypeScript — Shapes (union, generics, enum)

TypeScript — Shapes (union, generics, enum)

A realistic TypeScript snippet with an enum, a discriminated union, generics, exhaustive switch handling, and a typed reduce — for testing the type checker, highlighters, and the TS ESLint parser.

File
MTS · TypeScript

YAML

Zig

Frequently asked questions

Which languages are included?

Hello-world and realistic snippets across many languages, including C#, Dart, Elixir, Zig, Scala, Julia, Haskell, Lua, R, Clojure, Fortran, and Nim — plus intentionally invalid lint fixtures clearly labelled as such.

Can I edit code samples in the browser?

Yes. Every text-previewable code format is editable and has an editor quick-start preset.

Do you ship a monorepo sample?

Wave G includes a tiny multi-language SAMPLE monorepo ZIP for unpack-then-lint pipelines.