A clean and modern Bootstrap-based template for phpDocumentor, designed to improve readability, navigation, and overall developer experience.
- Modern UI built with Bootstrap 5
- Improved navigation and layout
- Clean typography and spacing
- Enhanced "On this page" sidebar
- Better search UI integration
- Responsive and mobile-friendly
- Styled code blocks and documentation elements
- Improved tables of contents and element listings
- Designed for documentation sets that provide guides
The template implements the approved documentation pattern: a navy navigation rail, neutral reading surface, purple active states, system typography, navy code blocks, the fox signature and Dash as a reading companion. Bootstrap 5 remains the layout and navigation foundation.
The toolbar offers light and navy reading surfaces through a compact sun/moon button. The preference is stored locally when storage is available; reading works without JavaScript. Code blocks gain a window header with a language label. An icon Copy control appears when the browser supports the Clipboard API. Mobile navigation can be collapsed without JavaScript.
See DESIGN.md for token mappings, assets and PHP validation. Generated sites receive the required images through the template transformations, including nested guide and API pages.
Install the template with Composer:
composer require --dev fast-forward/phpdoc-bootstrap-templateReference the template from vendor in your phpdoc.xml. This template is designed for projects that ship guides, and the guide output should point to the documentation root (.) so the guide index becomes the homepage:
<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor
configVersion="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://docs.phpdoc.org/latest/phpdoc.xsd"
>
<paths>
<output>build/docs</output>
</paths>
<version number="1.0.0">
<api>
<source dsn=".">
<path>src</path>
</source>
</api>
<guide format="rst">
<source dsn=".">
<path>docs</path>
</source>
<output>.</output>
</guide>
</version>
<template name="vendor/fast-forward/phpdoc-bootstrap-template" />
</phpdocumentor>You can also generate documentation directly from the command line:
vendor/bin/phpdoc --template vendor/fast-forward/phpdoc-bootstrap-templateOr with a config file:
vendor/bin/phpdoc --config phpdoc.xmlWith this setup, the guide index document is rendered as the root index.html.
- PHP 8.3+
- phpDocumentor 3+
You can customize the template by overriding Twig files in your own project or by forking this package.
Typical customization points include:
- layout structure
- sidebar navigation
- search UI
- cards and content sections
- Bootstrap styling
Contributions are welcome. Please open an issue or submit a pull request.
This package is licensed under the MIT License. See the LICENSE file for more details.
