Click the Castor logo or press Ctrl Alt T to change theme.
# Configuration A source directory may contain a `config.php` file. It must return a callable that receives a `Castor\Docs\Documentation` object. ```php <?php use Castor\Docs\Documentation; return static function (Documentation $docs): void { $docs->addComposerJsonPath(__DIR__ . '/../../composer.json'); $docs->section('Introduction', [ 'index.md', 'getting-started.md', ]); $docs->footer('© 2026 Castor Labs Ltd - All rights reserved'); }; ``` ## Composer metadata Use `addComposerJsonPath()` when the package metadata is not at the default location. Castor Docs reads the package name, description, homepage, support URL, keywords, and requirements from Composer metadata. ## Version badge If Composer metadata contains a `version` field, that value is used for the sidebar badge. If it does not, Castor Docs detects an exact Git tag for `HEAD` with `git describe --tags --exact-match HEAD`. Semantic versions are displayed as a minor series, such as `1.2.x` instead of `1.2.3`. Untagged `main` or `master` builds show `latest`; other untagged builds fall back to `dev`. ## Navigation sections Use `section()` to define sidebar sections and page order. Paths are relative to `.dev/docs/pages`. Pages that are not listed in a configured section are still included after the configured pages. ## Footer Use `footer()` to customize the footer text shown at the bottom of each generated page. If no footer is configured, Castor Docs uses: ```text © <current_year> Castor Labs Ltd - All rights reserved ``` ## Defaults If no `config.php` file exists, Castor Docs looks for `../../composer.json` relative to the source directory and discovers pages from the filesystem convention.
Castor ecosystem