Skip to content

php-collective/djot-intellij

Repository files navigation

Djot IntelliJ Plugin

JetBrains Marketplace Downloads Tests License

Djot markup language support for JetBrains IDEs (PhpStorm, IntelliJ IDEA, WebStorm, etc.).

Watch the demo video

Features

  • Syntax highlighting via TextMate grammar
  • Live preview panel (split editor view)
  • IDE theme sync - preview follows dark/light mode
  • Code highlighting - syntax highlighting in code blocks (highlight.js)
  • Export to HTML - full Djot rendering via embedded djot.js
  • Live Templates - code snippets for common Djot patterns
  • Tool window for standalone preview
  • File type recognition for .djot files

Requirements

  • JetBrains IDE 2024.1+
  • Java 17+

Installation

From JetBrains Marketplace

  1. In your IDE: Settings → Plugins → Marketplace
  2. Search for "Djot"
  3. Click Install

Or install directly: JetBrains Marketplace

From Disk (manual)

  1. Download the latest release from GitHub Releases, or build it yourself:
    ./gradlew buildPlugin
  2. In your IDE: Settings → Plugins → ⚙️ → Install Plugin from Disk
  3. Select the djot-intellij-*.zip file (in build/distributions/ if built locally)
  4. Restart the IDE

Usage

  1. Open any .djot file
  2. Editor opens in split view (editor + preview)
  3. Preview updates live as you type
  4. Right-click for "Export to HTML" option
  5. Use Ctrl+Shift+D to toggle preview tool window

Live Templates

Type a prefix and press Tab to expand. Available templates:

Prefix Description
djh1-djh6 Headings
djb, dji, djc Bold, italic, code
djhi, djsup, djsub Highlight, superscript, subscript
djins, djdel Insert, delete
djlink, djlinkref, djimg Links and images
djcode, djraw Code blocks
djquote, djdiv, djhr Blockquote, div, horizontal rule
djul, djol, djtask, djdef Lists
djtable Table
djfn, djfndef Footnotes
djmath, djmathblock Math
djattr, djid, djspan Attributes
djfront YAML frontmatter
djcomment Comment block

Preview Rendering

The plugin supports two rendering engines, configurable via Settings > Tools > Djot:

djot.js (default)

Uses djot.js for accurate Djot rendering with:

  • Code syntax highlighting (highlight.js)
  • IDE theme synchronization (dark/light)
  • Task list checkboxes
  • Full Djot feature support
  • No additional dependencies required

php-djot (PHP CLI)

Uses php-collective/djot for rendering via PHP CLI:

  • Requires PHP installed on your system
  • Requires php-collective/djot installed in your project:
    composer require php-collective/djot
  • Useful for consistency with PHP-based projects
  • Uses the package's vendor/bin/djot CLI when present, falling back to a built-in inline converter for older versions
  • Supports custom converter scripts

About Djot

Djot is a lightweight markup language created by John MacFarlane (creator of Pandoc). It improves on Markdown with:

  • Consistent, unambiguous parsing rules
  • Better syntax for highlights, super/subscript, attributes
  • No backtracking required during parsing

Links

Development

Building, running, and the release/publishing process are documented in docs/development.md. For contributing (setup, project structure, grammar updates, testing), see CONTRIBUTING.md.

About

Djot IntelliJ Plugin - Djot markup language support for JetBrains IDEs (PhpStorm, IntelliJ IDEA, WebStorm, etc.)

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors