SQLite Testing: Syntax Highlighters

https://wackowiki.org/test     Version: 3 (05/21/2026 16:28)

Syntax Highlighters

Phiki stands out as the strongest modern candidate for replacing WackoWiki's outdated syntax highlighters. It delivers high-quality, server-side rendering using TextMate grammars and VS Code themes, with zero third-party dependencies.

Current WackoWiki Situation

WackoWiki relies on:

This setup creates maintenance burden, inconsistent quality, and suboptimal performance (especially with client-side JS).

Recommended Primary Replacement: Phiki

Phiki (by Ryan Chandler) is a pure-PHP syntax highlighter inspired by Shiki. It uses TextMate grammar files for accurate tokenization and VS Code themes for styling.

Key strengths:

Basic usage (Composer install: composer require phiki/phiki:^2.0):

PHP
use Phiki\Phiki;
use Phiki\Grammar\Grammar;
use Phiki\Theme\Theme;

$phiki = new Phiki();
$code = 'your code here...';

$highlighted = $phiki->codeToHtml($code, Grammar::Php, Theme::GithubLight);
echo $highlighted;  // Ready-to-use HTML


It also supports terminal output and various grammars/themes.

Integration into WackoWiki:

Pros for Wacko:

Potential cons:

Strong Alternative: Tempest Highlight

Another excellent modern PHP option is Tempest Highlight (tempest/highlight).

It could serve as a lighter alternative or complement if Phiki's grammar approach feels heavy for some use cases.

Other Options

Implementation Roadmap Suggestion

  1. Evaluate — Test Phiki + Tempest on Wacko sample pages with various languages.
  2. Core Integration — Build a PhikiFormatter (or make it configurable between Phiki/Tempest).
  3. Backward Compatibility — Alias old formatters or migrate gradually.
  4. Configuration — Admin settings for default theme, enabled languages, line numbers.
  5. Enhancements — Add common features: copy-to-clipboard, line numbers, diff highlighting, language auto-detect (fallback).
  6. Performance — Benchmark render times and implement caching for code blocks.
  7. Plugins — Optional full Highlight.js fallback or additional themes.
  8. Documentation & Testing — Update Wacko docs and test with real user content.

Phiki is the clear frontrunner: modern, high-quality, pure PHP, and designed exactly for this use case. It would significantly modernize WackoWiki's code presentation and reduce long-term maintenance.

If you share more details (e.g., target Wacko version, priority languages, or specific requirements like line numbers), I can help refine the integration approach or suggest code snippets.