定制 phpdocumentor/guides-djot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpdocumentor/guides-djot

最新稳定版本:1.0.0

Composer 安装命令:

composer require phpdocumentor/guides-djot

包简介

Djot markup support for phpDocumentor's Guides library

README 文档

README

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.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-11