dg / texy
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Requires
- php: 8.1 - 8.5
Requires (Dev)
- latte/latte: ^3.0.14
- nette/phpstan-rules: ^1.0
- nette/tester: ^2.5
- phpstan/extension-installer: ^1.4@stable
- phpstan/phpstan: ^2.1@stable
- tracy/tracy: ^2.9
Conflicts
- latte/latte: >=3.0.0 <3.0.14
Replaces
- dg/texy: *
This package is auto-updated.
Last update: 2026-07-13 17:28:07 UTC
README
Texy is a text-to-HTML engine for lightweight markup languages, written in PHP. It turns human-readable plain text into structurally valid HTML – complete with images, links, nested lists, and tables – no knowledge of HTML required.
Above all, Texy is an engine. It ships with its own rich, easy-to-read markup, but nothing about that syntax is set in stone: every rule can be switched on or off, redefined, or extended with your own. You can reshape Texy to speak a different dialect entirely – even Markdown.
And Texy is a typographer at heart. It swaps straight quotes for typographically correct ones, hyphens for dashes, the letter x for the dimension sign, and applies many more refinements so your text reads like it was professionally typeset.
Install Texy via Composer:
composer require texy/texy
Texy requires PHP 8.1 or higher.
Usage
$texy = new Texy;
$html = $texy->process($text);
For untrusted input, always enable safe mode, which restricts the output to a safe subset of HTML:
Texy\Configurator::safeMode($texy);
$html = $texy->process($text);
Documentation and Examples
The full manual is on the homepage https://texy.nette.org. The docs/ directory holds the reference for using and extending Texy:
- Syntax reference – complete reference of the Texy markup language, including syntaxes that are disabled by default
- Configuration – all configuration options, the
Configuratorpresets, and security (safe mode) - Custom handlers – changing the behavior of existing constructs via element and notification handlers
- Custom syntax – adding brand-new markup constructs
The examples/ directory contains ready-to-run demos.
Support Me
Do you like Texy? Are you looking forward to the new features?
Thank you!