https://github.com/php-collective/wp-djot
Djot markup for WordPress – a modern, cleaner alternative to Markdown with syntax highlighting
https://github.com/php-collective/wp-djot
Last synced: about 1 month ago
JSON representation
Djot markup for WordPress – a modern, cleaner alternative to Markdown with syntax highlighting
- Host: GitHub
- URL: https://github.com/php-collective/wp-djot
- Owner: php-collective
- License: mit
- Created: 2025-11-30T02:18:09.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-05-21T03:08:56.000Z (about 1 month ago)
- Last Synced: 2026-05-21T09:14:50.433Z (about 1 month ago)
- Language: JavaScript
- Size: 494 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-djot - wp-djot - PHP WordPress plugin with extensions and syntax highlighting. (CMS Integration / Djot → HTML → Djot)
README
# Djot Markup for WordPress
[](https://github.com/php-collective/wp-djot/actions/workflows/ci.yml)
[](https://wordpress.org/plugins/djot-markup/)
[](https://wordpress.org/plugins/djot-markup/)
[](https://wordpress.org/plugins/djot-markup/)
[](LICENSE)
[](https://php.net)
[](https://wordpress.org)
A WordPress plugin for [Djot](https://djot.net/) markup language support.
Convert Djot syntax to HTML in posts, pages, and comments.
## What is Djot?
Djot is a light markup syntax created by John MacFarlane (creator of CommonMark and Pandoc). It aims to be a successor to Markdown with cleaner syntax and more consistent parsing rules.
[](https://www.youtube.com/watch?v=z0Nsjzp0gnw)
## Features
- **Full Djot Support**: Headings, emphasis, links, images, code blocks, tables, footnotes, and more
- **Block Editor Support**: Native Gutenberg block for writing Djot with live preview
- **Shortcode Support**: Use `[djot]...[/djot]` in your content
- **Table of Contents**: Automatic TOC generation from headings with configurable levels and position
- **Heading Permalinks**: Clickable `#` symbols on headings (show on hover, copy URL to clipboard)
- **Content Profiles**: Configurable feature restrictions (full, article, comment, minimal)
- **Safe Mode**: XSS protection for untrusted content
- **Syntax Highlighting**: Server-side highlighting with Torchlight Engine
- **Code Block Enhancements**: Line numbers and line highlighting (VitePress-style syntax)
- **WP-CLI Migration**: Migrate existing HTML/Markdown content to Djot
## Example
````
# Welcome to My Blog
This is _emphasized_ and this is *strong*.
Here's a [link to Djot](https://djot.net/) and some `inline code`.
- First item
- Second item
- Third item
> A blockquote with some wisdom.
And a code block:
``` php
# Welcome to My Blog
>
> This is _emphasized_ and this is **strong**.
>
> Here's a [link to Djot](https://djot.net/) and some `inline code`.
>
> - First item
> - Second item
> - Third item
>
> > A blockquote with some wisdom.
>
> ```php
> echo "Hello, World!";
> ```
## Requirements
- PHP 8.2 or higher
- WordPress 6.0 or higher
## Installation
### From WordPress.org
Search for "Djot Markup" in the WordPress plugin directory, or visit:
[wordpress.org/plugins/djot-markup](https://wordpress.org/plugins/djot-markup/)
### From GitHub
```bash
cd wp-content/plugins
git clone https://github.com/php-collective/wp-djot.git
cd wp-djot
composer install --no-dev
```
## Documentation
- [Usage & Configuration](docs/README.md) - Getting started guide
- [Content Profiles](docs/profiles.md) - Configure feature restrictions
- [Customization](docs/customization.md) - Custom patterns, @mentions, render handlers
- [WP-CLI Commands](docs/wp-cli.md) - Migrate existing content
- [Hooks and Filters](docs/hooks.md) - Customize plugin behavior
- [Djot Syntax](docs/syntax.md) - Quick reference
For complete Djot syntax documentation, visit [djot.net](https://djot.net/).
## See Also
- [Djot](https://djot.net/) - Official Djot website with syntax reference and playground
- [jgm/djot](https://github.com/jgm/djot) - Reference implementation in JavaScript by John MacFarlane
- [JetBrains IDE support](https://github.com/php-collective/djot-intellij) - Plugin for PhpStorm, IntelliJ IDEA, WebStorm, etc.
- [Djot playground](https://sandbox.dereuromark.de/sandbox/djot) - Live demo to check out how this markup language works.
## Credits
- [djot-php](https://github.com/php-collective/djot-php) by PHP Collective
- [Torchlight Engine](https://github.com/torchlight-api/engine) for syntax highlighting
- [djot-grammars](https://github.com/php-collective/djot-grammars) for Djot syntax highlighting in code blocks
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for version history.