markup-carve / cakephp-carve
CakePHP plugin for Carve: rendering, views, validation, ORM behavior, commands and caching
Package info
github.com/markup-carve/cakephp-carve
Type:cakephp-plugin
pkg:composer/markup-carve/cakephp-carve
Fund package maintenance!
Requires
- php: ^8.2
- cakephp/cakephp: ^5.2
- markup-carve/carve-php: ^0.1.17
Requires (Dev)
- php-collective/code-sniffer: ^0.6.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.0
- symfony/yaml: ^7.0 || ^8.0
Suggests
- ext-yaml: Alternative YAML frontmatter parser
- symfony/yaml: Parses YAML frontmatter for RenderedCarve::meta() and CarveView
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-03 22:38:04 UTC
README
This main branch ports the CakePHP plugin to the unreleased Carve 0.2 PHP engine. It pins an engine commit on main through Composer's VCS support. The branch is for integration testing and is not a package release.
Install for development
composer update
Enable the plugin and helper in your CakePHP application:
$this->addPlugin('MarkupCarve/CakeCarve'); $this->addHelper('MarkupCarve/CakeCarve.Carve');
Render
use MarkupCarve\CakeCarve\Carve\CarveRenderer; $carve = new CarveRenderer(); $html = $carve->toHtml('# Hello'); $result = $carve->render('# Hello', ['preset' => 'comment']); $headings = $result->toc(); $formatted = $carve->format("a \nb\n"); $findings = $carve->lint("{#a}\nx\n\n{#a}\ny\n"); $imported = $carve->import('<p>Hello</p>', 'html');
CarveView, the view helper, validation rule, ORM behavior, and the carve render, format, lint, and convert commands use the same renderer. HTML is escaped by default, and unsafe URL schemes are denied. HTML, Markdown and Djot import use Carve; markdown reads GitHub Flavored Markdown as in 0.1 (tables, task lists, strikethrough), and the BBCode importer has been removed. File rendering accepts includeRoot or a Carve include resolver.
Text, Markdown, and ANSI output methods use Carve's built-in writers. Named 0.2 extension bundles are configured through extensions. See rendering and options, extensions, commands, and configuration for details.