# To RST

HTML: [altophp.com/rst/conversion/to-rst](https://altophp.com/rst/conversion/to-rst/)

`MarkdownReader` reads the subset ALTO RST writes plus constructs required by its
documentation workload. It is not a general CommonMark implementation.

```php
use Alto\Rst\Convert\ConversionOptions;
use Alto\Rst\Convert\Markdown\MarkdownReader;
use Alto\Rst\Convert\MarkdownToRst;

$document = new MarkdownReader()->read($input);
$result = new MarkdownToRst()->convert(
    $document,
    ConversionOptions::symfony(),
);

echo $result->output;
```

`ConversionOptions` controls section adornments, list markers, indentation,
code-block directive names, fence and link styles, and other shared choices.
Use `ConversionOptions::symfony()` for Symfony documentation conventions.

Unsupported Markdown degrades conservatively and appears in the report. Check
the result as described in [Reports](https://altophp.com/rst/conversion/reports.md) before replacing source files.

---

Previous: [To Markdown](https://altophp.com/rst/conversion/to-markdown.md)
Next: [Projects](https://altophp.com/rst/conversion/projects.md)

---

ALTO\RST: [altophp.com/rst](https://altophp.com/rst/)
ALTO(PHP): [altophp.com](https://altophp.com/)
