{"id":34418437,"url":"https://github.com/php-collective/djot-php","last_synced_at":"2026-04-02T22:42:56.693Z","repository":{"id":325987105,"uuid":"1105289765","full_name":"php-collective/djot-php","owner":"php-collective","description":"A PHP parser for Djot, a modern light markup language","archived":false,"fork":false,"pushed_at":"2025-12-21T11:34:14.000Z","size":636,"stargazers_count":15,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-23T03:09:16.128Z","etag":null,"topics":["djot","language","markdown","markdown-language","markup"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-collective.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"dereuromark"}},"created_at":"2025-11-27T11:54:20.000Z","updated_at":"2025-12-21T11:34:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/php-collective/djot-php","commit_stats":null,"previous_names":["php-collective/djot-php"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/php-collective/djot-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-collective%2Fdjot-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-collective%2Fdjot-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-collective%2Fdjot-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-collective%2Fdjot-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-collective","download_url":"https://codeload.github.com/php-collective/djot-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-collective%2Fdjot-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28380882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T10:00:56.084Z","status":"ssl_error","status_checked_at":"2026-01-13T09:45:11.986Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["djot","language","markdown","markdown-language","markup"],"created_at":"2025-12-21T03:00:21.974Z","updated_at":"2026-04-02T22:42:56.686Z","avatar_url":"https://github.com/php-collective.png","language":"PHP","funding_links":["https://github.com/sponsors/dereuromark"],"categories":["Parsers \u0026 Libraries","Table of Contents"],"sub_categories":["PHP","Markup and CSS"],"readme":"# Djot PHP\n\n[![CI](https://img.shields.io/github/actions/workflow/status/php-collective/djot-php/ci.yml?branch=master\u0026style=flat-square)](https://github.com/php-collective/djot-php/actions)\n[![Coverage](https://codecov.io/gh/php-collective/djot-php/branch/master/graph/badge.svg)](https://codecov.io/gh/php-collective/djot-php)\n[![Latest Stable Version](https://img.shields.io/packagist/v/php-collective/djot?style=flat-square)](https://packagist.org/packages/php-collective/djot)\n[![Total Downloads](https://img.shields.io/packagist/dt/php-collective/djot?style=flat-square)](https://packagist.org/packages/php-collective/djot)\n[![PHPStan](https://img.shields.io/badge/PHPStan-level%209-brightgreen.svg?style=flat-square)](https://phpstan.org/)\n[![PHP Version](https://img.shields.io/badge/php-%3E%3D8.2-8892BF.svg?style=flat-square)](https://php.net)\n[![Software License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](LICENSE)\n\nA PHP parser for [Djot](https://djot.net/), a modern light markup language created by John MacFarlane (author of CommonMark/Pandoc).\n\n## Installation\n\n```bash\ncomposer require php-collective/djot\n```\n\n## Quick Start\n\n```php\nuse Djot\\DjotConverter;\n\n$converter = new DjotConverter();\n$html = $converter-\u003econvert('Hello *world*!');\n// Output: \u003cp\u003eHello \u003cstrong\u003eworld\u003c/strong\u003e!\u003c/p\u003e\n```\n\n## Features\n\n- **Block elements**: Headings, paragraphs, code blocks, block quotes, lists, tables, divs, definition lists, line blocks\n- **Inline elements**: Emphasis, strong, links, images, code, superscript, subscript, highlight, insert, delete\n- **Advanced**: Footnotes, math expressions, symbols, block attributes, raw HTML blocks, comments\n- **Smart typography**: Curly quotes, en/em dashes, ellipsis\n- **Multiple renderers**: HTML, plain text, Markdown, ANSI terminal output\n- **Extensions**: Built-in extensions for external links, TOC, heading permalinks, @mentions, autolinks, default attributes\n- **Extensible**: Custom inline/block patterns, render events\n- **File support**: Parse and convert files directly\n\n## Example\n\n```php\nuse Djot\\DjotConverter;\nuse Djot\\Extension\\ExternalLinksExtension;\nuse Djot\\Extension\\DefaultAttributesExtension;\n\n$converter = new DjotConverter();\n\n// Add extensions for common features\n$converter\n    -\u003eaddExtension(new ExternalLinksExtension())\n    -\u003eaddExtension(new DefaultAttributesExtension([\n        'table' =\u003e ['class' =\u003e 'table'],\n    ]));\n\n$djot = \u003c\u003c\u003c'DJOT'\n# Welcome\n\nThis is _emphasized_ and *strong* text with a [link](https://example.com).\n\n| Name  | Role       |\n|-------|------------|\n| Alice | Developer  |\n| Bob   | Designer   |\n\n\u003e \"Djot is a light markup syntax.\"\n\n```php\necho \"Hello World\";\nDJOT;\n\necho $converter-\u003econvert($djot);\n```\n\nOutput:\n\n```html\n\u003ch1\u003eWelcome\u003c/h1\u003e\n\u003cp\u003eThis is \u003cem\u003eemphasized\u003c/em\u003e and \u003cstrong\u003estrong\u003c/strong\u003e text with a \u003ca href=\"https://example.com\" target=\"_blank\" rel=\"noopener noreferrer\"\u003elink\u003c/a\u003e.\u003c/p\u003e\n\u003ctable class=\"table\"\u003e\n\u003cthead\u003e\n\u003ctr\u003e\u003cth\u003eName\u003c/th\u003e\u003cth\u003eRole\u003c/th\u003e\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003eAlice\u003c/td\u003e\u003ctd\u003eDeveloper\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eBob\u003c/td\u003e\u003ctd\u003eDesigner\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\"Djot is a light markup syntax.\"\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003eecho \"Hello World\";\n\u003c/code\u003e\u003c/pre\u003e\n```\n\n## Documentation\n\nFull documentation is available at **https://php-collective.github.io/djot-php/**\n\n- [Getting Started](https://php-collective.github.io/djot-php/guide/) - Installation and quick start\n- [Why Djot?](https://php-collective.github.io/djot-php/guide/why-djot) - Comparison with Markdown\n- [Syntax Reference](https://php-collective.github.io/djot-php/guide/syntax) - Complete Djot syntax guide\n- [Extensions](https://php-collective.github.io/djot-php/extensions/) - Built-in extensions\n- [API Reference](https://php-collective.github.io/djot-php/reference/api) - Classes and methods\n- [Cookbook](https://php-collective.github.io/djot-php/cookbook/) - Customization recipes\n\n## Demo\n\n- [Interactive Playground](https://php-collective.github.io/djot-php/playground) - Try djot-php in your browser\n- [Sandbox](https://sandbox.dereuromark.de/sandbox/djot) - Full-featured sandbox with all options\n\n## Security\n\nWhen processing untrusted user input, enable safe mode for XSS protection:\n\n```php\n$converter = new DjotConverter(safeMode: true);\n$html = $converter-\u003econvert($untrustedInput);\n```\n\nSafe mode automatically blocks dangerous URL schemes (`javascript:`, etc.), strips event handler attributes (`onclick`, etc.), and escapes raw HTML.\n\nSee [Safe Mode](https://php-collective.github.io/djot-php/guide/safe-mode) for details and advanced configuration.\n\n\n## Implementations\n\n- [php-collective/symfony-djot](https://github.com/php-collective/symfony-djot) - Symfony bundle with Twig filters, services, forms, and validation\n- [php-collective/wp-djot](https://github.com/php-collective/wp-djot) - WordPress plugin for Djot support\n- [dereuromark/cakephp-markup](https://github.com/dereuromark/cakephp-markup) - CakePHP integration with Djot helper and view class\n\n## See Also\n\n- [Djot](https://djot.net/) - Official Djot website with syntax reference and playground\n- [jgm/djot](https://github.com/jgm/djot) - Reference implementation in JavaScript by John MacFarlane\n- [JetBrains IDE support](https://github.com/php-collective/djot-intellij) - Plugin for PhpStorm, IntelliJ IDEA, WebStorm, etc.\n- [djot-grammars](https://github.com/php-collective/djot-grammars) - Syntax highlighting grammars (TextMate, highlight.js, Prism.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-collective%2Fdjot-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-collective%2Fdjot-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-collective%2Fdjot-php/lists"}