RST

reStructuredText document engine: parse, query, lint, build, render, translate, and safely edit RST with minimal diffs.

Alto RST parses reStructuredText into a source-positioned object model and renders safe HTML without running Python or Sphinx. The same model supports linting, formatting, editing, references, and conversion.

<?php
use Alto\Rst\Rst;

$html = Rst::sphinx()->toHtml("Guide\n=====\n\nWelcome.\n");

Start

Parsing

  • Parsing: parse once and inspect problems.
  • Profiles: choose docutils, Sphinx, or Symfony syntax.
  • Documents: traverse the object model.
  • Positions: relate nodes and problems to source bytes.

Rendering

  • Rendering: turn a parsed document into output.
  • HTML: render safe semantic HTML.
  • Policy: control URL schemes and raw content.

Linting

Editing

  • Editing: plan typed source changes.
  • Formatting: normalize conservative layout.
  • Patches: inspect exact byte changes and diffs.
  • Files: save with conflict detection.

Conversion

Reference

Extensions

Security

  • Security: control files, URLs, raw HTML, and expansion limits.

API

HTML output escapes text, filters unsafe URLs, and keeps file-reading constructs disabled by default. Read Security before granting additional authority.