Skip to content

phpDocumentor/guides-djot

Repository files navigation

Djot Support for phpDocumentor Guides

This package adds Djot markup language support to phpDocumentor's Guides library.

Installation

composer require phpdocumentor/guides-djot

Requirements

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •  

Languages