Safe document rendering for Tempest

One source.
Every publishing surface.

A complete tour of the Tempest integration: view components, profiles, extensions, caching, diagnostics, editor source lines, and four output formats.

Safe modeCachedSource linesHeading numbers
article.crv
# Carve meets Tempest /Readable source/ becomes *safe HTML*, with _underlines_, =highlights=, smart typography -- and links to [Tempest](https://tempestphp.com/). ## Built for application content - Safe-by-default raw HTML handling - Named publishing profiles - Container-resolved extensions - Source-line annotations for editor synchronization > The configured renderer numbers headings and caches this output. ```php $html = $carve->render($source); ``` ```=html <script>alert('This is escaped, never executed')</script> ```

01 · View component

Drop Carve into a Tempest view

The output below comes directly from <x-carve :content="$componentSource" />. The application config enables safe mode, source-line annotations, heading numbering, smart typography, and Tempest Cache.

1 Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

1.1 Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);

<script>alert('This is escaped, never executed')</script>

02 · Publishing profiles

Match the vocabulary to the context

The same document is filtered through each carve-php profile. Restricted constructs degrade to text instead of disappearing silently.

full

The complete vocabulary, still escaped by safe mode.

Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);
<script>alert('This is escaped, never executed')</script>
article

Editorial content without raw HTML.

Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);

<script>alert('This is escaped, never executed')</script>

comment

User content with constrained structure and links.

# Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

## Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

The configured renderer numbers headings and caches this output.

$html = $carve->render($source);

<script>alert('This is escaped, never executed')</script>

minimal

Short-form text with basic inline formatting.

# Carve meets Tempest

Readable source becomes safe HTML, with underlines, highlights, smart typography – and links to Tempest.

## Built for application content

  • Safe-by-default raw HTML handling
  • Named publishing profiles
  • Container-resolved extensions
  • Source-line annotations for editor synchronization

> The configured renderer numbers headings and caches this output.

`$html = $carve->render($source);`

<script>alert('This is escaped, never executed')</script>

03 · Output formats

Render once for every channel

HTML for pages, Markdown for interchange, plain text for search and excerpts, and ANSI for the terminal.

HTML

1 Portable output

One source can serve many targets.

Markdown
# Portable output *One source* can serve **many targets**.
Plain text
Portable output One source can serve many targets.
ANSI
\e[1m\e[95mPortable output\e[0m \e[95m═══════════════\e[0m \e[3mOne source\e[0m can serve \e[1mmany targets\e[0m.

04 · Database-backed includes

Compose documents from reusable sources

A container-injected resolver backed by an in-memory SQLite repository loads Carve snippets from rows. The included row references a sibling row relatively, automatic heading shifts preserve the assembled outline, and content revisions invalidate cached output.

Parent document
# Composed handbook {{ /handbook/overview @shift:auto }}
Expanded result

1 Composed handbook

1.1 Database chapter

This Carve source was loaded from an in-memory SQLite row.

1.1.1 Nested database snippet

The resolver uses the including record as context, so relative includes work across rows.

Tracked dependencies: db:handbook/overview, db:handbook/details · 0 warnings

05 · Authoring diagnostics

Explain every compromise

renderWithReport() combines safe HTML with source-aware warnings, profile violations, and bounded target-loss reporting.

1Parser warnings
2Profile violations
1Render losses

Warnings

L3:C19 Undefined reference 'nowhere'

Profile decisions

heading Headings are disabled in comments to prevent disrupting page structure.
raw_block Raw HTML is disabled for security reasons.

Target losses

raw-format-dropped Dropped block raw format "latex" while rendering html
06

Source lines

Supported blocks in the main preview carry a data-source-line anchor for scroll synchronization.

07

Content cache

The configured renderer stores deterministic output by source, format, profile, options, extensions, and engine version.

Enabled through Tempest Cache with a one-hour expiration.

Safe by default

Raw HTML is escaped in HTML and Markdown, omitted from plain text, and represented only as text in ANSI.