Source for the PHPNomad documentation site at phpnomad.com. The docs site is itself a PHPNomad application, so the same framework the documentation describes is the framework rendering it. Markdown files in public/docs/ are rendered through a Twig-backed MVC pipeline, served live during development or compiled to a static site for deployment.
index.phpis the dev server entry point. It boots the application indev()mode and broadcasts aRequestInitiatedevent that flows through the router and controllers.generate.phpis the static compile CLI. It boots incli()mode and broadcastsStaticCompileInitiatedandStaticCompileRequestedevents that walk the docs tree and write HTML to disk.src/holds the MVC source: theApplicationclass, initializers, events, theMarkdownController, and the services that render Markdown and build navigation.public/holds the Twig templates (doc.twig,404.twig,layouts/,components/), the site assets, and thedocs/tree that holds the actual documentation content.
Install dependencies and start the dev server:
composer install
php -S localhost:8080 index.phpChanges to Markdown files are reflected on the next request. To compile the static site for deployment:
php generate.phpSite configuration lives in configs/app.json. Two keys matter: docsRoot (the directory holding your Markdown files, defaults to public/docs) and templateRoot (the directory holding the Twig templates, defaults to public).
The directory layout under public/docs/ mirrors the URL structure. Subdirectories become path segments, and an index.md inside a directory becomes that directory's landing page. Links between documents work like regular Markdown links.
This repository is the canonical place to propose changes to the PHPNomad documentation. The rendered output lives at phpnomad.com.
MIT. See LICENSE.