omnipack / docs
The documentation, read from Markdown files: a manual in the back office, and public manuals - one per package, read in its repository, one version per branch - with a search (Typesense, or the pages' own index).
Package info
github.com/glitchr-omnisense/omnipack-docs
Type:symfony-bundle
pkg:composer/omnipack/docs
Requires
- php: ^8.1
- league/commonmark: ^2.4
- omnibridge/symfony: ^3.0
- omnisense/omnibase: ^7.0
- symfony/filesystem: ^6.0|^7.0|^8.0
- symfony/finder: ^6.0|^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: ^10.5|^11.0|^12.0
- symfony/framework-bundle: ^6.0|^7.0|^8.0
- symfony/process: ^6.0|^7.0|^8.0
- symfony/twig-bundle: ^6.0|^7.0|^8.0
Suggests
- glitchr/typesense-bundle: The public manuals' search in Typesense (wikidoc.search.typesense); without it the pages' own index answers.
- omnipack/admin: The manual in the back office (/docs).
- symfony/process: wikidoc:sync: the documentation of the branches that are not checked out (needs the git binary).
- tempest/highlight: Colours the public manuals' code blocks on the server (PHP 8.4).
Provides
None
Conflicts
None
Replaces
- omnibase/docs: v3.1.0
README
The documentation of a site, read from Markdown files: nothing is kept in a database, a page is a file, versioned with the code it describes.
- A manual in the back office (
/docs, with omnipack/admin): the bundle's and the application's pages, the application overriding the bundle's by path, a search palette. - Public manuals, the way symfony.com/doc publishes its own: one manual
per package, read in the
docs/folder and the README of its repository, one version per branch; contents, breadcrumb, previous and next, the page's own headings, anchors, code blocks, callouts, relative links that follow, "Edit this page" to the file on its forge. - A search over the public manuals: Typesense (a collection per manual and version) through glitchr/typesense-bundle, or the pages' own index when the engine is off or does not answer.
The public manuals and the engine are off until a site asks for them: a site that only has the back office's manual changes nothing.
composer require omnipack/docs
Under Symfony it runs on the core's Symfony host: Composer brings omnisense/omnibase 7.0 and
omnibridge/symfony with it; config/bundles.php registers the core's bundle before this one:
// config/bundles.php Base\BaseBundle::class => ['all' => true], Base\Wikidoc\WikidocBundle::class => ['all' => true],
A first page: a Markdown file under the application's docs/ is read by the back office's
manual at /docs (with omnipack/admin); without the framework, the snippet below renders it.
The bundle's namespace and its configuration key are still Wikidoc
(Base\Wikidoc\, wikidoc:), from the package it was before.
Without Symfony
The documentation itself loads without the framework (plan "omnibase
agnostique", step C8): the bundle's root namespace - Documentation
(the roots, their pages, the Markdown), Manual (the public manuals, their
versions, the export of a branch) and Search (the search, its index, the
Typesense client's interface) - needs PHP, league/commonmark, Symfony's
standalone Finder (and Process for an export), a PSR-6 pool if you give one,
nothing else. tests/BareTest.php loads its 20 classes (tests/Fondation.php)
with Composer's autoloader alone and fails if a class or a file of the
framework comes with them.
use Base\Wikidoc\Documentation\DocumentationRegistry; use Base\Wikidoc\Documentation\MarkdownRenderer; use Base\Wikidoc\Manual\ManualMarkdownRenderer; use Base\Wikidoc\Manual\ManualRegistry; use Base\Wikidoc\Manual\PageRenderer; use Base\Wikidoc\Search\LocalSearch; use Base\Wikidoc\Search\ManualIndex; use Base\Wikidoc\Search\ManualSearch; // The back office's pages of a root, and one of them in HTML. $pages = new DocumentationRegistry(['app' => ['path' => __DIR__.'/docs', 'label' => 'Application']]); $html = (new MarkdownRenderer())->renderFile($pages->getDefault()->file); // The public manuals found under a folder of repositories, a page, the search. $manuals = new ManualRegistry([], ['/srv/repos/*/*'], ['export_dir' => '/srv/exports']); $manual = $manuals->get('omnisense/omnitrade'); $version = $manual->getVersion(null); $page = (new PageRenderer($manuals, new ManualMarkdownRenderer()))->render( $manual, $version, $manuals->pages($manual, $version)->get('installation'), fn (string $target, ?string $anchor = null) => '/docs/'.$manual->urlPath($version->name, $target).($anchor ? '#'.$anchor : ''), fn (string $file) => '/docs/_file/'.$manual->urlPath($version->name, $file), ); $hits = (new ManualSearch($manuals, new LocalSearch(new ManualIndex($manuals, new MarkdownRenderer()))))->search('webhook');
tests/bare/docs-without-framework.php does the same over the tests'
fixtures, run by BareTest with the autoloader alone.
What needs Symfony is under src/Bridge/Symfony: the bundle, its
configuration and extension, the two controllers, the two commands and the
Typesense client of glitchr/typesense-bundle. The former names still answer
(Base\Wikidoc\WikidocBundle in config/bundles.php, the folders
@WikidocBundle/src/Controller and @WikidocBundle/src/Site/Controller in
the routes, Base\Wikidoc\DependencyInjection\*, Base\Wikidoc\Command\*):
nothing changes for a site.
Documentation
- The back office's manual
- Public manuals: configuration, versions, addresses
- Writing pages: titles, order, links, callouts, code
- Search: Typesense, the local index, the commands
- Templates and look
Tests
# in omnisense/omnibase's harness (core/docker) docker compose -f compose.yml -f compose.checkouts.yml run --rm omnibase test docs # or from an application that has the bundle php vendor/bin/phpunit -c vendor/omnibase/docs/phpunit.xml.dist
Licence
MIT since 2026-10-09; earlier versions remain published under LGPL-3.0-or-later.