Home Logo

ZINGSURF

Documenting Code


A guide on documenting code via markdown. See how code documentation is styled!

Code blocks

A code fence is a sequence of at least three consecutive backtick characters (`) or tildes (~). (Tildes and backticks cannot be mixed.) A fenced code block begins with a code fence, indented no more than three spaces.

GitHub Flavored Markown Spec

Fencing

Example of fencing in code with triple backticks before and after a block of code to demo fenced code blocks.

# Shell
echo 'Hello world!';

Syntax highlighting

Examples of fenced code blocks that include language identifiers to demo syntax highlighting.

// Go
fmt.Println("Hello, World!")
// Rust
println!("Hello world!");
// JavaScript
console.log("Hello world!");
# Shell
echo 'Hello world!';
# Python
print("Hello, World!")