Lue dans les fichiers PHP du paquet au commit 15cb171229ec : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
ChangelogclassA changelog in Markdown read as releases: each second-level heading that starts with a version - "## 1.5.3 - 2026-10-25", "## [1.2.0] - 2026-10-11", "## v2.0.0 (2026-01-05)" - is a release, its date when the heading gives one, its anchor in the rendered page. "## Unreleased" is not a release.
7 methods · 1 property
MarkdownRendererclassMarkdown as a manual's page: CommonMark with GitHub's extensions (tables, task lists, autolinks, strikethrough), a front matter, an id on every heading, and symfony.com/doc's conventions written the way GitHub reads them too:
3 methods
MarkdownSourceclassA folder of Markdown files as a manual, as a repository keeps it:
5 methods
MarkdownSourceFactoryclassThe "markdown" source:
11 options · 1 method
CodeTabsclassFenced code blocks that follow each other, each with its tab="..." - shown one at a time.
1 method · 1 property
RawHtmlclassHTML the renderer itself writes into a page: a tag of the allowed list (<kbd>), a version badge. Not a string container: a heading's text, a search index's, does not read it.
1 method · 1 property
Omnidocs\Markdown
Changelog class
final class Changelog Changelog.php:17
A changelog in Markdown read as releases: each second-level heading that starts with a version - "## 1.5.3 - 2026-10-25", "## [1.2.0] - 2026-10-11", "## v2.0.0 (2026-01-05)" - is a release, its date when the heading gives one, its anchor in the rendered page. "## Unreleased" is not a release.
$changelog = Changelog::read('CHANGELOG.md'); $changelog->versions(); // ['1.5.3', '1.5.2', ...], newest first, as written $changelog->release('1.4.0'); // ['version' => '1.4.0', 'date' => '2026-10-17', 'id' => '140---2026-10-17']
public readonly Rendered $rendered
Changelog::__construct()
public function __construct(public readonly Rendered $rendered)Changelog::read()
public static function read(string $file, ?MarkdownRenderer $renderer = null, ?callable $links = null): selfChangelog::releases()
public function releases(): array- Returns
newest first, as written
Changelog::versions()
public function versions(): arrayChangelog::knownVersions()
public function knownVersions(): arrayEvery version, and its minor too ("1.5.3" also gives "1.5"): what a heading of the manual may say a feature came with.
Changelog::release()
public function release(string $version): ?arrayChangelog::firstOf()
public function firstOf(string $minor): ?arrayThe first release of a minor version ("1.4" → the 1.4.0 entry, or the oldest 1.4.x).
MarkdownRenderer class
final class MarkdownRenderer MarkdownRenderer.php:60
Markdown as a manual's page: CommonMark with GitHub's extensions (tables, task lists, autolinks, strikethrough), a front matter, an id on every heading, and symfony.com/doc's conventions written the way GitHub reads them too:
- callouts: a quote whose first line is [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION], [!SEEALSO]; [!VERSIONADDED] 1.4 and [!DEPRECATED] 2.0 carry their version;
- code in a frame that names its language (
frames), with a caption: ``js caption="app.js"``; blocks that follow each other with a tab="..." each are shown in tabs; - a heading that ends with a version the manual knows ("Keys (1.4)",
versions) gets a version badge in place of it - its anchor unchanged; - the first first-level heading is the page's title, printed by the page rather than in the prose.
Raw HTML is escaped: a manual comes from a repository and is not trusted
to write a site's markup - but for the tags inline_html allows, written
bare (<kbd>, no attribute).
$links rewrites each link and picture: it receives the address as written and whether it is a picture, and answers the one to print, or null to keep it.
MarkdownRenderer::__construct()
public function __construct(array $labels = [], readonly bool $frames = true, array $inlineHtml = [], array $versions = [])$labelsthe callouts' labels (Conventions::LABELS' keys)
$framesevery code block in its frame; false: only those with a caption
$inlineHtmlthe tags a page may write bare: ['kbd']
$versionsthe versions a heading may end with: ['1.4', '1.5.0']
MarkdownRenderer::conventions()
public function conventions(): ConventionsMarkdownRenderer::render()
public function render(string $markdown, ?callable $links = null): RenderedMarkdownSource class
final class MarkdownSource implements SourceInterface MarkdownSource.php:31
A folder of Markdown files as a manual, as a repository keeps it:
- the folders are sections, the files pages, ordered by their front
matter's
order(orweight,sidebar_position), else by a number before their name ("10-getting-started.md", the number out of the address), then by name - or asorderlists them; - a page's title is its front matter's
title, else its first first-level heading, else its name; - the home is index.md or README.md at the folder's root (or
home, a file anywhere in the repository: its README); pagesadds files from elsewhere in the repository after the folder's own (a CHANGELOG): ['changelog' => 'CHANGELOG.md'].
Links between pages go to their pages (with or without ".md"), to any other file of the repository to that file (the linker's file()), pictures to the linker's image(), paths read from the folder of the file they are written in.
new MarkdownSource('/path/to/checkout', 'docs', home: 'README.md');
MarkdownSource::__construct()
public function __construct(string $root, string $docs = 'docs', readonly string|false|null $home = null, readonly array $pages = [], readonly array $order = [], readonly array $exclude = [], readonly ?MarkdownRenderer $renderer = null, readonly string $repository = '')$rootthe folder on disk the paths are read from: a checkout, or a docs/ folder fetched alone
$docsthe folder of the pages under $root ("docs"; "" for $root itself)
$homethe home page's file under $root; null: index.md or README.md of $docs; false: none
$pagespages from other files under $root, after the folder's own: [path => file]
$orderthe first pages and sections in this order, by path; the rest after
$excludefiles and folders of $docs left out (fnmatch patterns, relative to $docs)
$repositorywhat $root is in the repository ("" its root; "docs" for a docs/ folder fetched alone)
MarkdownSource::home()
public function home(): ?NodeMarkdownSource::tree()
public function tree(): arrayMarkdownSource::page()
public function page(string $path, ?LinkerInterface $links = null): ?PageMarkdownSource::symbols()
public function symbols(): arrayMarkdownSourceFactory class
final class MarkdownSourceFactory extends SourceFactory MarkdownSourceFactory.php:24
The "markdown" source:
root the folder the paths are read from (a checkout) required docs the folder of the pages under root "docs" home the home's file under root; false for none index.md or README.md of docs pages other files as pages, after the folder's: [path => file] order the first pages and sections, by path, in their order exclude files of docs left out (fnmatch patterns) repository what root is in the repository ("docs" for a docs/ folder fetched alone) labels the callouts' words (note, tip, versionadded...) frames every code block in its frame (true) inline_html the tags a page may write bare: [kbd] versions the versions a heading may end with, for its badge
Options
| Option | Default | |
|---|---|---|
docs | 'docs' | |
home | null | |
pages | [] | |
order | [] | |
exclude | [] | |
repository | '' | |
labels | [] | |
frames | true | |
inline_html | [] | |
versions | [] | |
root | required |
MarkdownSourceFactory::getName()
public function getName(): stringOmnidocs\Markdown\Node
CodeTabs class
final class CodeTabs extends AbstractBlock CodeTabs.php:8
Fenced code blocks that follow each other, each with its tab="..." - shown one at a time.
public readonly string $id
CodeTabs::__construct()
public function __construct(public readonly string $id)RawHtml class
final class RawHtml extends AbstractInline RawHtml.php:12
HTML the renderer itself writes into a page: a tag of the allowed list (<kbd>), a version badge. Not a string container: a heading's text, a search index's, does not read it.
public readonly string $html
RawHtml::__construct()
public function __construct(public readonly string $html)