phpdocumentor/guides
phpDocumentor Guides is a PHP documentation generator for writing and publishing rich docs in reStructuredText/Markdown. Build structured guides with navigation, code blocks, and theming, and output to HTML or other formats for your project or package.
Start by installing the package via Composer: composer require phpdocumentor/guides --dev. The entry point is the CLI command phpdocumentor guide:render (often aliased as phpdocumentor depending on setup), which expects a guides.yml config file in your project root. Begin with a minimal config that specifies an input directory (e.g., docs/) and output directory (e.g., build/docs/). Your first .rst file should be index.rst, using standard reStructuredText syntax—think headings, lists, and basic formatting. Run the command, inspect the generated HTML in build/docs/, and verify that rendering succeeds. This verifies the core pipeline: source → AST → HTML.
docs/ subdirectories (e.g., usage/, api/, contributing/) and link them via .. toctree:: directives. This mirrors how large open-source projects structure their documentation (e.g., Symfony, Laravel’s own docs historically).dev, production) in guides.yml to control behavior like link checking, analytics inclusion, or versioning.Guides by implementing NodeVisitor and Directive classes. For example, inject a .. envvar:: directive to highlight environment variables with syntax highlighting and tooltips in HTML output. Register these via guides.yml under extensions or via environment-specific config.phpdocumentor guide:render --env=production to your CI workflow. Use the --watch flag (during local dev) and --output-dir for artifact publishing. For versioned docs, generate docs per release tag and store outputs in per-version subdirectories (e.g., docs/v1.0/, docs/v2.0/).phpdocumentor/guides-renderer-html vs. future renderer packages), enabling reuse of the same reST source across distributions.:ref: roles) unless you implement them as custom extensions. Whitespace and indentation are strict—a single misaligned line can break parsing silently... include:: or image directives are resolved relative to the current document, not the project root. Use :show-inheritance: and .. only:: directives carefully—they behave differently than in Sphinx.-vvv) to see internal parsing errors or renderer failures. Check build/ log files for full stack traces.NodeVisitorInterface (post-parse transformations) and DirectiveInterface (custom syntax). Register them via DI container in guides.yml or via environment-aware bootstrap files.Xdebug or disable optional features (e.g., link validation in dev builds) via config to keep iteration fast.How can I help you explore Laravel packages today?