Docs Markdown Directives
Package documentation is Markdown under docs/ at the root of the
repo. This page is the reference of the directives available on top of plain CommonMark — each
section prints the source you write, then what the docs site renders from it.
Introduction
DMD is plain CommonMark plus a small set of directives written as HTML comments that start
with @. A file that uses none of them renders exactly as CommonMark — GitHub
shows the same file cleanly, because the comments are invisible there.
- Block directives open and close on their own lines:
<!-- @callout -->…<!-- @endcallout -->. - Self-closing directives have no body:
<!-- @method name="…" -->,@version-badge,@video. - Inline self-closing directives may sit inside a paragraph and flow with the text.
Page structure
Each page is one .md file. The first # heading is the page title;
every ## heading is listed under "On this page". Folders under
docs/ become URL segments.
Frontmatter
Optional YAML block at the top of the file. Every key is optional.
| Key | Used for |
|---|---|
title | Browser <title> and H1 when the body has no H1. |
eyebrow | Small all-caps label above the H1. |
lede | One-sentence summary under the H1; also the meta description. |
see_also | Related links at the bottom — each entry needs href, optional label and meta. |
prev / next | Previous / next page cards: href + label. |
Markdown basics
Plain CommonMark (with tables) gets the datasheet prose styles: condensed headings, square list markers, ruled tables, inline code chips.
Renders as
A third-level heading
Body copy in Plex Sans with strong text, emphasis, inline_code() and a link to the overview.
- Unordered items get square ember markers
- Nested lists keep the rhythm
- like this one
- Third item
- Ordered items use mono ordinals
- Second step
| Runtime | Entry point | Needs |
|---|---|---|
init-loop |
setup() / loop($tick) |
— |
event-driven |
event sources | ext-events |
A blockquote, for quoting a datasheet or an error message.
Callouts
Highlight a note, tip, warning, danger or info block. variant defaults to note; title is optional.
Renders as
A note: context the reader may need, with inline code.
A tip without a title uses the variant name.
The persistent store_* functions write to flash — keep them off the hot path.
Something that loses data or bricks a board.
Neutral background information.
Do / Don't
Side-by-side good / bad example. The body must contain exactly one @do and one @dont.
Renders as
Call gpio_mode($pin, GPIO_OUTPUT) before writing — the direction is explicit.
Write to a pin you never configured; it may float, and readers of your code can't see what the pin is for.
Method signatures
Introduces a command, function or method. Self-closing; often followed by @params.
Renders as
phpbm build [--clean] [--merged]
gpio_write(int $pin, int $value)
Parameter lists
@params wraps @param children with name, type, required and default, plus a Markdown description.
Renders as
dir
Directory of the new project; created if missing.
--board
A board id of the SDK. Asked when the SDK has several.
--runtime
One of the runtimes the board can run.
Code blocks
Wraps exactly one fenced block with the docs chrome: language, optional label, copy button and Shiki highlighting. Languages: php, bash, sh, text, toml, ini, c, cmake, diff, yml, cs, go, json, blade.php.
Renders as
Tabs
Alternative views of the same content. labels is comma-separated; @tab children are indexed from zero. Arrow keys move between tabs.
Renders as
Steps
Numbered walkthrough. The body must be a single Markdown list; a leading **bold** becomes the step title.
Renders as
-
Step 1: Install phpbm and the conductor
composer global require php-baremetal/phpbm php-baremetal/conductor. -
Step 2: Install an SDK
phpbm sdk:install esp32downloads the newestesp32SDK release. -
Step 3: Flash
phpbm flashbuilds if needed, then flashes the connected board.
Section divider
Visual break between topical groups inside a page: eyebrow label plus a one-line description.
Renders as
Advanced
For the curious — the bits below are not required for everyday usage.
Version badge
Added / changed / deprecated / removed markers, standalone or inline in a paragraph.
Renders as
The store keeps values across reboots. Changed in 0.2.0 Deprecated in 0.3.0 Removed in 1.0.0
Keyboard keys
The plain HTML <kbd> element, restyled as a key cap — no directive needed.
Renders as
Press Ctrl
+ ]
to leave phpbm monitor.
Video
<!-- @video src="…" poster="…" caption="…" --> embeds an MP4 with native
controls, loading only its metadata until played. Used by blog articles; no preview here
because it needs a media file.
Cross-references
Write relative Markdown links to other pages, as in a GitHub README. On the docs site, links
to .md files become the version-pinned URL of that page; anchors are kept and
external URLs pass through.
Badges & see also
Page chrome built from the package row and the frontmatter.
Package types
Source
See also (frontmatter see_also)
Master branch banner