pug-php/pug-filter-markdown
A Pug filter for the pug-php templating engine that renders Markdown directly inside your templates. Install it to convert Markdown blocks to HTML at compile time, keeping your Pug views clean and readable.
Architecture fit
This package is a Laravel view-layer adapter: it registers a service provider, binds a view engine for a non-Blade file extension (.pug), and delegates compilation to pug-php. Architecturally it sits on a stable Laravel extension point (view engine resolution + compiler/cache path), so it does not fight the framework. It coexists with Blade rather than replacing it, which keeps the blast radius small.
The 1.2.0 change — "Pug-php 3 compatibility" — is nominally a minor release on this package, but it is a major upstream dependency move (pug-php 2.x → 3.x). TPM framing: treat this as a dependency-line migration, not a feature update.
Integration feasibility
Low for greenfield: composer require, publish config, point a view namespace at .pug files. The real feasibility question is brownfield — any app already pinning pug-php 2.x, or any other package that co-depends on it, now has a constraint to reconcile.
Technical risk
composer update.Key questions
pug-php ^3?pug-php 2.x (dual constraint), or is it a hard bump?Stack fit
Fits cleanly as a secondary view engine alongside Blade. Recommended posture: Pug for static/markup-heavy partials, Blade for anything needing Laravel directive ergonomics (@auth, @csrf, components). Avoid a wholesale view-layer migration; mixed rendering is the low-risk position.
Migration path
pug-php to ^3 in one commit; resolve conflicts there, never on the mainline.Compatibility
pug-php — a shared transitive dependency is the most likely source of a blocked upgrade.Sequencing Dependency audit → PHP/Laravel matrix confirmation → branch upgrade + template snapshot diff → filter/keyword migration → cache-rebuild deploy step → staged rollout behind a feature flag if Pug is on a user-facing critical path. Do not bundle this with an unrelated framework or PHP upgrade; keep the failure signal attributable.
Maintenance Ongoing cost is the Pug toolchain, not this wrapper — the wrapper is thin and likely low-churn. Track three things: pug-php 3.x security advisories, the wrapper's responsiveness to upstream breaks, and our own fork of any custom filters. A thin wrapper over a major-versioned compiler means upstream breaking changes reach us with limited buffering.
Support Template-level errors surface as render-time exceptions, which are less obvious to diagnose than Blade compile errors. Support burden concentrates on whoever owns templates; document the compile-error → cache-clear → retry playbook. Team familiarity with Pug syntax vs. Blade is a real ramp cost and a hiring/support consideration.
Scaling Compilation is cached after first render, so steady-state cost is I/O on compiled templates, not parsing. Watch: writable cache path on every app node (multi-node deployments need shared or per-node warm cache), cold-cache latency after deploys, and opcache interaction with regenerated files. Validate behavior under horizontal scale before assuming parity with Blade.
Failure modes
composer update.Ramp-up Low-to-moderate. The wrapper is simple; Pug itself is the learning curve. Budget for one owner to absorb the 3.x filter/keyword API, produce a short internal template-conventions doc, and stand up the rendering-snapshot harness. That harness is the single highest-leverage deliverable here — without it, the 2.x → 3.x move is unverifiable and every future upstream bump stays expensive.
How can I help you explore Laravel packages today?