DocsGenerator
Turns the documentation model into the full set of pages, plus the manifest that describes it.
Nothing here touches the filesystem: the command decides what to do with the artifacts, so a drift check can compare them against disk without writing, and a test can assert on them without a temporary directory.
Synopsis
Section titled “Synopsis”final class DocsGenerator
| Source | DocsGenerator.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
MANIFEST_FILE | '.manifest.json' |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(Markdown $markdown = new Markdown(…), string $basePath = '/api'): mixed
| Parameter | Type | Description |
|---|---|---|
$markdown | Markdown | |
$basePath | string |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
generate(ApiIndex $index): array<string, EmittedArtifact> | Every page the reference consists of, keyed by its path below the output directory. |
getDiagnostics(): list<Diagnostic> | |
| [`readManifest(string $outputDir): array<string, string> | null`](#readmanifest) |
generate()
Section titled “generate()”public function generate(ApiIndex $index): array<string, EmittedArtifact>
Every page the reference consists of, keyed by its path below the output directory.
| Parameter | Type | Description |
|---|---|---|
$index | ApiIndex |
Returns array``<``string``, EmittedArtifact>
getDiagnostics()
Section titled “getDiagnostics()”public function getDiagnostics(): list<Diagnostic>
Returns list``<Diagnostic>
readManifest()
Section titled “readManifest()”public function readManifest(string $outputDir): array<string, string>|null
Reads a manifest previously written to $outputDir.
| Parameter | Type | Description |
|---|---|---|
$outputDir | string |
Returns array``<``string``, ``string``>``|``null — Target path => checksum, or null when there is none.