phpdocumentor / guides-djot
Djot markup support for phpDocumentor's Guides library
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/phpdocumentor/guides-djot
Requires
- php: ^8.2
- php-collective/djot: ^0.1.8
- phpdocumentor/guides: ^1.0
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
- php-collective/code-sniffer: ^0.3.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.5 || ^12.5
This package is auto-updated.
Last update: 2025-12-11 09:24:17 UTC
README
This package adds Djot markup language support to phpDocumentor's Guides library.
Installation
composer require phpdocumentor/guides-djot
Requirements
- PHP 8.2+
- php-collective/djot ^0.1.8
- phpdocumentor/guides ^1.0
Usage
Once installed, the package automatically registers Djot as a supported input format. You can then use .djot files in your documentation.
Basic Example
Create a file docs/index.djot:
# Welcome to My Project
This is documentation written in _Djot_ markup.
## Features
- *Strong* and _emphasis_ formatting
- {=Highlighted=} text
- Code blocks with syntax highlighting
```php
echo "Hello, World!";
Links
See the official Djot spec for full syntax reference.
### Symfony Integration
If you're using Symfony, register the extension in your services:
```yaml
# config/services.yaml
services:
phpDocumentor\Guides\Djot\DependencyInjection\DjotExtension:
tags: ['kernel.extension']
Or load it programmatically:
use phpDocumentor\Guides\Djot\DependencyInjection\DjotExtension; $extension = new DjotExtension(); $extension->load([], $containerBuilder);
Supported Djot Features
| Djot Feature | Guides Node |
|---|---|
| Headings | TitleNode |
| Paragraphs | ParagraphNode |
| Code blocks | CodeNode |
| Block quotes | QuoteNode |
| Lists (ordered/unordered) | ListNode |
| Task lists | ListNode with checkboxes |
| Tables | TableNode |
| Definition lists | DefinitionListNode |
| Thematic breaks | SeparatorNode |
| Images | ImageNode / FigureNode |
| Links | HyperLinkNode |
| Strong/Emphasis | StrongInlineNode / EmphasisInlineNode |
| Inline code | LiteralInlineNode |
| Highlight/Insert/Delete | GenericTextRoleInlineNode |
| Superscript/Subscript | GenericTextRoleInlineNode |
| Footnotes | FootnoteNode |
| Math | GenericTextRoleInlineNode |
| Raw blocks | RawNode |
| Divs | SectionNode |
Why Djot?
Djot is a modern markup language created by John MacFarlane (author of Pandoc and CommonMark). It offers:
- Predictable parsing - No backtracking or context-dependent rules
- Built-in features - Highlights, insertions, deletions, attributes on any element
- Clear syntax -
_emphasis_vs*strong*(not ambiguous like Markdown) - Single specification - No "flavors" to worry about
See the djot-php documentation for more information.
License
MIT License - see LICENSE for details.