Skip to content

Releases: markup-carve/cakephp-carve

0.1.3

Choose a tag to compare

@dereuromark dereuromark released this 24 Oct 19:50
65b7a81

Rendering and conversion now follow the published carve-php 0.1.15 engine.

Fixes

  • Table spans, wrapped attributes in definitions and quotes, and lone + markers follow the current Carve rules through carve-php 0.1.15.

Improvements

  • The guide now covers the plugin from installation through rendering, validation, caching, and commands (#3).

Full Changelog: 0.1.2...0.1.3

0.1.2

Choose a tag to compare

@dereuromark dereuromark released this 23 Oct 16:48

Fixes

  • rawHtml now applies only under safeMode: true. With safeMode: 'strict' or an explicit SafeMode instance it is ignored, so an app-wide rawHtml: 'allow' can no longer let raw HTML through the comment preset or strict mode.
  • carve render, carve convert --output and carve format --write write through a temp file and rename it over the target, so a failed write leaves the original intact. The command needs write access to the target's directory, and refuses a file owned by another user rather than taking it over.
  • Configured extensions now run for text, Markdown and ANSI output, not only HTML.
  • CarveBehavior regenerates its text and TOC fields when one of them was set directly, as it already did for the HTML field.
  • A layout placeholder value containing {{content}} no longer creates a second body slot in CarveView.
  • Validation option strict used to be passed to the engine as strict parsing, undocumented. It now fails validation on any parse warning and names up to three of them.

Improvements

  • rawHtml (strip, escape, allow) sets raw HTML handling under safeMode: true. allow passes raw HTML verbatim and is for trusted authors only; the default stays the engine's.
  • cache.version enters the cache key and allows caching with extension instances, closures and renderers. A closure is keyed by where it is defined and the values it captures; one whose captures cannot be serialized is not cached.
  • includeResolver takes a custom include resolver for renderFile(); implementing IncludeCacheKeyProvider lets it take part in the file cache.
  • CarveRenderer::lintFile() lints a file with its includes through the configured resolver; carve lint uses it.
  • carve render --format html|text|markdown|ansi, backed by the new CarveRenderer::toAnsi() and renderFileAs().
  • carve format --align-tables, and format() takes $alignTables.
  • CarveHelper::file(), lint() and format().
  • Diagram presets d2, graphviz, wavedrom, abc, vega_lite and chart are available by name.
  • File render reports expose dependencies() and suppressedWarnings().

CarveRendererInterface gains toAnsi(), renderFileAs() and lintFile(), and format() gains an optional $alignTables. Custom renderers implementing the interface need these additions.

Full Changelog: 0.1.1...0.1.2

0.1.1

Choose a tag to compare

@dereuromark dereuromark released this 23 Oct 16:04

Fixes

  • CarveBehavior no longer saves a generated field that was set directly while its source field was not loaded. An entity loaded with only id and body_html could have body_html set to raw HTML and stored unrendered; such a value is now discarded.
  • File renders and string renders no longer share render cache keys, so a string can never be served a cached file render.
  • A relative includeRoot now expands includes instead of failing; it resolves against the current working directory.
  • RenderedCarve::meta() reads YAML frontmatter through symfony/yaml when the app has it, falling back to the yaml PHP extension. Before, it needed the extension and returned no metadata without it.

Improvements

  • labels overrides the strings the engine writes itself rather than the author, such as the footnote backlink or the table-of-contents label, keyed as in carve-php's HtmlRenderer::LABEL_DEFAULTS.
  • roundTripMode adds round-trip carriers to HTML and Markdown output.
  • renderers maps an extension name (mermaid, chart, math) to a closure that renders its source at build time in static mode. Setting it disables the render cache, since a closure cannot be keyed across requests.

With these, every carve-php render option is configurable under the Carve key; a test now fails if a new engine option is left out.

Full Changelog: 0.1.0...0.1.1

0.1.0

Choose a tag to compare

@dereuromark dereuromark released this 23 Oct 15:06

First release of the CakePHP 5 plugin for Carve, the sibling of laravel-carve, symfony-carve and tempest-carve. Requires CakePHP 5.2+, PHP 8.2+ and markup-carve/carve-php ^0.1.14.

Features

  • CarveRenderer renders HTML, plain text and Markdown, formats and lints Carve, and imports Markdown, HTML, Djot and BBCode. render() returns a RenderedCarve with the table of contents, frontmatter and warnings.
  • The engine's render options are configurable under the Carve key: safe mode (true, false, 'strict'), profiles with onDisallowed, static mode, soft breaks, smart typography, symbols, source lines and file includes confined to includeRoot.
  • Named presets (default, comment, trusted, plus your own) and extensions (table of contents, heading permalinks, mentions, wikilinks, custom instances).
  • Optional render cache through CakePHP Cache, keyed on the source, the effective options and the engine version.
  • CarveHelper for templates and CarveView for .crv template files.
  • CarveValidation as a validator provider: profile violations, lint findings with rule filters, and plain-text length limits.
  • CarveBehavior renders a source field into HTML, plain-text and TOC fields on save.
  • bin/cake carve render, convert, format and lint commands.

Full Changelog: https://github.com/markup-carve/cakephp-carve/commits/0.1.0