Writing Documentation
The PAM documentation is part of the product. A feature is not finished until someone can learn it here: what problem it solves, a working example, its limits, and how to diagnose it when it fails. Fixing a typo, clarifying a confusing paragraph, or adding a missing example are all valuable contributions.
The site lives in push-in/pam-docs and is
built with Astro and
Starlight.
Quick Fixes
Section titled “Quick Fixes”Every page has a link to edit it on GitHub. For a small correction, edit the file in the browser and open a pull request. For anything larger, work locally.
Local Setup
Section titled “Local Setup”You need Node.js 22.12 or newer.
git clone https://github.com/push-in/pam-docs.gitcd pam-docsnpm cinpm run devnpm run dev serves the site with live reload, usually at
http://localhost:4321.
Where Things Live
Section titled “Where Things Live”src/├─ content/docs/ Pages, one .mdx file per page│ ├─ getting-started/│ ├─ runtime/│ ├─ basics/│ ├─ operations/│ ├─ reference/│ ├─ laravel/ native/ desktop/ packages/│ └─ community/ project/├─ sidebar/ Sidebar groups, one file per section└─ redirects/ Old slug → new path, one file per sectionA page’s slug is its path: src/content/docs/basics/routing.mdx is published at
/basics/routing/.
Writing a Page
Section titled “Writing a Page”-
Create the
.mdxfile with a short Title Casetitleand a one-sentencedescription:src/content/docs/runtime/example.mdx ---title: Example Featuredescription: One sentence that says what this page helps you do.---## IntroductionWhat it is, and why you would use it. -
Add the page to the right group in
src/sidebar/<section>.mjs. Each section owns its own file; edit only yours. -
If you move or rename a page, keep the old URL working by adding a redirect to
src/redirects/<section>.mjs:src/redirects/core.mjs export default {'/runtime/old-name': '/runtime/new-name/',}; -
Build the site and run the checks (below).
Style Rules
Section titled “Style Rules”The full rules are in DOCS-STYLE.md at the repository root. The essentials:
- Voice. English, second person (“you”), friendly and direct. No marketing language.
- Structure. Start every page with an Introduction. Use
##for main sections and###for subsections, and keep sections short. - Examples. Teach by example. Every concept gets a small, complete example
that works when pasted. Put the file path in the code block title, as in
```php title="routes.php". - Asides. Use
:::tip,:::note,:::caution, and:::dangersparingly. - Alternatives. Use
<Tabs>and<TabItem>from@astrojs/starlight/componentsto show alternatives side by side, such as Linux and macOS. - Links. Link generously to related pages with absolute paths such as
/runtime/async-io/, and end long pages with a short “Next Steps” list. - Neutral names. Use
example.com, Alice, and Acme in examples.
PAM Command Conventions
Section titled “PAM Command Conventions”Examples must use the PAM CLI the way users run it. An automated check enforces two rules:
- Run Composer through PAM: write
pam composer require vendor/package, never a barecomposer require. - Do not pass the current directory as a trailing dot argument: write
pam devand let PAM use the current project implicitly.
PAM Native templates use p-* directives; legacy v-* directives are rejected.
MDX Pitfalls
Section titled “MDX Pitfalls”MDX treats {, }, and < in prose as code. Wrap them in backticks
(`{id}`) or escape them (\{). Inside fenced code blocks they are safe.
Accuracy
Section titled “Accuracy”Accuracy is not negotiable:
- Never invent an API, CLI flag, configuration key, default, or number. Check it
against the source: the runtime in
push-in/pam(src/,runtime/,packages/), or the package’s own repository. When the code and older documentation disagree, the code wins. - Run your examples.
pam help <command>shows every flag a command accepts, and a scratch directory under/tmpis a good place to try them. - Say plainly when something is experimental or limited.
- Publish the benchmark protocol and raw evidence next to any performance number. Only use numbers from the checked-in benchmarks.
Checks
Section titled “Checks”Run these before you open a pull request:
node scripts/check-pam-syntax.mjsSITE_URL=https://pamphp.com npx astro buildnode scripts/check-links.mjsThe first validates command conventions, the build compiles every page, and the link check resolves every internal link in the built site.
npm run validate runs the complete suite used in CI, including type checks,
accessibility (one main landmark and heading, skip links, image dimensions, zoom,
focus outlines), and SEO checks:
npm run validateA scheduled job also runs npm run check:freshness, which compares the docs with
the latest public PAM release and opens an issue when the release page or the
installation guide falls behind.
Release Updates
Section titled “Release Updates”When PAM ships a release, the documentation needs:
- the Release Notes and, for behaviour changes, the Upgrade Guide;
- the installation page updated for the new version;
- new commands and configuration documented in the CLI Reference and Configuration Reference;
- support matrices updated on Project Status;
- links to the reproducible tests, benchmarks, and artifacts behind any claim.
Documentation-only corrections can ship at any time. Behaviour changes should land with, or right after, the runtime release that introduces them, and the pull request should cite the source commit or release that proves the change.