Formatter
The Folio formatter normalizes .folio files so your templates stay consistent regardless of who edits them. It handles indentation, attribute spacing, and nested block layout.
Features
- Configurable indentation size
- Tab or space indentation
- Consistent attribute formatting
- Check mode for CI
- Preserves comments
CLI Usage
Format a single file:
bash
php bin/format.php --file=template.folioFormat with two-space indentation:
bash
php bin/format.php --file=template.folio --indent=2Check whether a file needs formatting without writing to disk:
bash
php bin/format.php --file=template.folio --checkFormat every .folio file in a directory:
bash
php bin/format.php --dir=templatesCI Integration
Run the formatter in check mode as part of your test suite:
bash
php bin/format.php --dir=templates --checkIf any file is not formatted, the command exits with a non-zero status.
VS Code Integration
The VS Code extension formats .folio files on save and on demand with Shift+Alt+F.