AsciiDoc Syntax for Note-Taking

Text Formatting

Syntax Result

_italic_

italic

*bold*

bold

*_bold italic_*

bold italic

`monospace`

monospace

#highlighted#`

highlighted

H~2~O

H2O (subscript)

E=mc^2^

E=mc2 (superscript)

[.line-through]#struck#

struck

[.underline]#underlined#

underlined


Admonitions (Callout Boxes)

General information or supplementary details.
Helpful advice or best practices.
Critical information you must know.
Alerts about potential issues or risks.
Actions that may cause data loss or harm.
Block admonition with title

Multi-line content with:

  • Lists

  • Code blocks

  • Any AsciiDoc content


Code Blocks with Callouts

let x = 5;           (1)
let mut y = 10;      (2)
y = y + x;           (3)
1 Immutable variable
2 Mutable variable (note mut)
3 Can reassign because y is mutable

Checklists

Course Progress
  • Completed task

  • Also completed

  • Not yet done

Interactive checklist (clickable in HTML)
  • Watch video

  • Take notes

  • Complete exercise


Keyboard Keys

Press Esc to exit insert mode.

Use Ctrl+C to cancel.

Save with Ctrl+Shift+S.

Navigate: File  Save As

Click Submit to continue.


Definition Lists

Standard

Term

Definition of the term.

Another Term

Another definition.

Horizontal (side-by-side)

CPU

Central Processing Unit

RAM

Random Access Memory

SSD

Solid State Drive

Q&A Style

  1. What is ownership in Rust?

    Each value has exactly one owner. When the owner goes out of scope, the value is dropped.

  2. What is borrowing?

    Temporarily lending a reference to a value without transferring ownership.


Block Types

Sidebar (supplementary info)

Historical Context

This is a sidebar with background information that complements but doesn’t interrupt the main content.

Example Block

Example: Variable Declaration
let name = "Evan";

Collapsible Block

Click to expand

Hidden content that expands when clicked.

Useful for solutions, spoilers, or lengthy details.

Quote Block

Talk is cheap. Show me the code.

— Linus Torvalds

Lists with Complex Content

Use + to continue list items with blocks:

  1. First step:

    cargo new myproject

    This creates a new Rust project.

  2. Second step:

    cd myproject && cargo run

Tables

Basic Table

Type Description Example

i32

32-bit signed integer

42

f64

64-bit float

3.14

bool

Boolean

true

Table with Code

Pattern Example

Immutable

let x = 5;

Mutable

let mut x = 5;
x = 10;

Icons (requires :icons: font)

Completed

Failed

Warning

Idea

Reference

Code example


Footnotes

A statement that needs clarification.[1]

Reusable footnote.[2]

Another reference to the same footnote.[2]


Hard Line Breaks

Use + at end of line for hard break:
This line appears below.

Or use [%hardbreaks] on a paragraph:

Line one
Line two
Line three


Combining Features (Course Notes Example)

Key Concept

Ownership is Rust’s most unique feature. It enables memory safety without garbage collection.

The Three Rules

  1. Each value has exactly one owner

  2. When owner goes out of scope, value is dropped

  3. Ownership can be transferred (moved) or borrowed

Think of ownership like a library book:

  • You can own the book (keep it)

  • You can lend it (& borrow)

  • You can give it away (move)

Ownership Example
let s1 = String::from("hello");  (1)
let s2 = s1;                      (2)
// println!("{}", s1);            (3)
println!("{}", s2);               (4)
1 s1 owns the String
2 Ownership moves to s2
3 ERROR: s1 no longer valid
4 OK: s2 is the owner now
  1. Why does Rust have ownership?

    To guarantee memory safety at compile time without needing a garbage collector. This makes Rust both safe AND fast.


Quick Reference

NOTE:

Info callout

TIP:

Best practice

[%collapsible]

Expandable block

Term::

Definition list

kbd:[Key]

Keyboard shortcut

icon:name[]

Font Awesome icon

. Item

Numbered list

* [ ]

Unchecked checkbox

* [x]

Checked checkbox

<1>

Code callout

^super^

Superscript

~sub~

Subscript


1. Additional context provided here.
2. This footnote can be referenced multiple times.