Skip to content

Documentation Example

A reference page that exercises every formatting feature enabled on this site. Use it as a copy-paste cheat sheet when writing guides. View source for the exact Markdown.

Getting started API reference


Headings

The page title above is an h1. Section headings (h2) appear in the right-hand table of contents; sub-headings nest under them.

Heading level 3

Heading level 4

Heading level 5
Heading level 6

Inline text

Regular text with bold, italic, bold italic, strikethrough, highlighted, inserted, and inline code. Subscripts like H2O and superscripts like a2 + b2 = c2.

A link to the Entity reference, an external link to Material for MkDocs, and an autolink: https://luckyrobots.com.

Press Ctrl+C to copy and Ctrl+Shift+V to paste. On macOS that's Cmd+C.

Abbreviations show a tooltip on hover: the API is built on an ECS.

Inline code with syntax highlighting: Entity player = Entity.FindEntityByTag("Player");

Icons and emoji: and 🚀 🎉 😄.

Lists

Unordered & nested

  • Scene graph
    • Entities
      • Components
    • Prefabs
  • Math
  • Physics

Ordered

  1. Derive a class from Entity.
  2. Override a lifecycle method.
  3. Attach the script to an entity.

Task list

  • Generate the API reference
  • Apply the brand theme
  • Backfill /// doc comments
  • Publish to GitHub Pages

Definition list

Entity
The base class for all scripts; override its lifecycle methods.
Component
Data and behavior attached to an entity, retrieved with GetComponent<T>().

Blockquote

Components hold the data; entities tie them together; scripts give them behavior.

— The scripting model

Admonitions

Every type, with a custom title:

Note

General information worth calling out.

Abstract / Summary

A high-level overview of what follows.

Info

Neutral, supplementary detail.

Tip

A helpful suggestion or best practice.

Success

Something completed or passing.

Question

A frequently asked question.

Warning

Be careful — this needs attention.

Failure

Something did not work.

Danger

Critical: this can break things.

Bug

A known issue or gotcha.

Example

A worked example follows.

Quote

A cited passage.

A title-less admonition and a collapsible one:

Tip

With no title argument, the type name is used as the heading.

Collapsible (click to expand)

Use ??? for a collapsed block and ???+ for one that starts open.

Collapsible, open by default

This starts expanded.

Code blocks

Plain fenced block:

No language — rendered as plain monospace.

With a language, title, line numbers, and highlighted lines:

Spinner.cs
using Hazel;

public class Spinner : Entity
{
    public float DegreesPerSecond = 90.0f;

    protected override void OnUpdate(float ts)
    {
        Rotation += new Vector3(0.0f, DegreesPerSecond * Mathf.Deg2Rad * ts, 0.0f);
    }
}

Other languages:

import luckyrobots as lr
session = lr.connect()
mkdocs serve
{ "version": "2026.1", "aliases": ["latest"] }

Code annotations

protected override void OnCreate()
{
    CollisionBeginEvent += other => Log.Info(other.Tag); // (1)!
}
  1. Annotations let you attach explanatory notes to specific lines — click the marker.

Content tabs

Log.Info("Hello from C#");
print("Hello from Python")

Tabs can hold any content — prose, lists, admonitions:

Inside a tab

Admonitions nest inside tabs just fine.

Tables

Component Purpose Common members
TransformComponent Position / rotation / scale Translation
RigidBodyComponent Dynamic physics body AddForce
CameraComponent Render viewpoint FieldOfView

(Columns above are left-, left-, and right-aligned.)

Diagram (Mermaid)

graph LR
    A([OnCreate]) --> B[OnUpdate]
    B --> C{Input?}
    C -- key down --> D[Move entity]
    C -- otherwise --> B
    D --> B

Buttons

Primary action Secondary action

Tracked changes (critic markup)

The robot moved slowly swiftly toward the goal. You can replace thiswith that, mark a passage, or leave a side comment.

Footnotes

Scripts run on the simulation thread1, not a background worker.

Grid of cards

  • Get started

    Your first Entity script in a few lines.

    Getting started

  • API reference

    Every public type in the Hazel namespace.

    Reference


That's the full toolbox. If a feature you need isn't here, it can be enabled in mkdocs.yml under markdown_extensions.


  1. Lifecycle callbacks like OnUpdate are invoked on the engine's main update loop; avoid blocking them.